Skip to content

Commit

Permalink
wrapper: print out counter descriptions when listing them
Browse files Browse the repository at this point in the history
  • Loading branch information
llandwerlin-intel committed Jan 31, 2018
1 parent fe9266d commit e545895
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions wrapper/gputop-wrapper-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,21 @@ static void print_metrics(void)

static void print_metric_counter(const struct gputop_metric_set *metric_set)
{
int i;
int i, max_symbol_length = 0;
comment("ALL: Timestamp");
for (i = 0; i < metric_set->n_counters; i++)
for (i = 0; i < metric_set->n_counters; i++) {
comment(",%s", metric_set->counters[i].symbol_name);
comment("\n");
max_symbol_length = MAX2(strlen(metric_set->counters[i].symbol_name),
max_symbol_length);
}
comment("\n\n");
comment("Detailed:\n");
for (i = 0; i < metric_set->n_counters; i++) {
comment("%s:%*s %s\n",
metric_set->counters[i].symbol_name,
max_symbol_length - strlen(metric_set->counters[i].symbol_name), "",
metric_set->counters[i].desc);
}
}

static void print_metric_colum_names(void)
Expand Down

0 comments on commit e545895

Please sign in to comment.