Prep work for adding PMU support in gputop.

Cc: Rodrigo Vivi <rodrigo.v...@intel.com>
Cc: Lucas De Marchi <lucas.demar...@intel.com>
Cc: Kamil Konieczny <kamil.koniec...@linux.intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaum...@intel.com>
---
 tools/gputop.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tools/gputop.c b/tools/gputop.c
index 43b01f566..4e3663417 100644
--- a/tools/gputop.c
+++ b/tools/gputop.c
@@ -42,6 +42,34 @@ static const char *bars[] = { " ", "▏", "▎", "▍", "▌", "▋", 
"▊", "
 #define ANSI_HEADER "\033[7m"
 #define ANSI_RESET "\033[0m"
 
+struct pmu_pair {
+       uint64_t cur;
+       uint64_t prev;
+};
+
+struct pmu_counter {
+       uint64_t type;
+       uint64_t config;
+       unsigned int idx;
+       struct pmu_pair val;
+       double scale;
+       const char *units;
+       bool present;
+};
+
+#define MAX_GTS 4
+
+struct pmu_info {
+       char device_events_path[300];
+       int pmu_fd;
+       struct pmu_counter req_freq[MAX_GTS];
+       struct pmu_counter act_freq[MAX_GTS];
+       struct pmu_counter c6[MAX_GTS];
+       int num_gts;
+       int num_counters;
+       uint64_t ts_cur, ts_prev;
+};
+
 static void n_spaces(const unsigned int n)
 {
        unsigned int i;
-- 
2.38.1

Reply via email to