@@ -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;
Prep work for adding PMU support in gputop. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> --- tools/gputop.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)