Skip to content

Commit 89c0a55

Browse files
captain5050acmel
authored andcommitted
perf pmu: To info add event_type_desc
All PMU events are assumed to be "Kernel PMU event", however, this isn't true for fake PMUs and won't be true with the addition of more software PMUs. Make the PMU's type description name configurable - largely for printing callbacks. Signed-off-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: Ravi Bangoria <[email protected]> Cc: Sandipan Das <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Yang Jihong <[email protected]> Cc: Dominique Martinet <[email protected]> Cc: Clément Le Goffic <[email protected]> Cc: Colin Ian King <[email protected]> Cc: Howard Chu <[email protected]> Cc: Ze Gao <[email protected]> Cc: Yicong Yang <[email protected]> Cc: Changbin Du <[email protected]> Cc: Junhao He <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Weilin Wang <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Will Deacon <[email protected]> Cc: James Clark <[email protected]> Cc: Mike Leach <[email protected]> Cc: Jing Zhang <[email protected]> Cc: Leo Yan <[email protected]> Cc: Oliver Upton <[email protected]> Cc: Benjamin Gray <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Kan Liang <[email protected]> Cc: Athira Jajeev <[email protected]> Cc: [email protected] Cc: Sun Haiyong <[email protected]> Cc: Tiezhu Yang <[email protected]> Cc: Xu Yang <[email protected]> Cc: John Garry <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Veronika Molnarova <[email protected]> Cc: Dr. David Alan Gilbert <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent f08cc25 commit 89c0a55

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

tools/perf/util/pmu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,6 +1856,7 @@ int perf_pmu__for_each_event(struct perf_pmu *pmu, bool skip_duplicate_pmus,
18561856
struct perf_pmu_alias *event;
18571857
struct pmu_event_info info = {
18581858
.pmu = pmu,
1859+
.event_type_desc = "Kernel PMU event",
18591860
};
18601861
int ret = 0;
18611862
struct strbuf sb;

tools/perf/util/pmu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ struct pmu_event_info {
194194
const char *encoding_desc;
195195
const char *topic;
196196
const char *pmu_name;
197+
const char *event_type_desc;
197198
const char *str;
198199
bool deprecated;
199200
};

tools/perf/util/pmus.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ struct sevent {
371371
const char *encoding_desc;
372372
const char *topic;
373373
const char *pmu_name;
374+
const char *event_type_desc;
374375
bool deprecated;
375376
};
376377

@@ -444,6 +445,7 @@ static int perf_pmus__print_pmu_events__callback(void *vstate,
444445
COPY_STR(encoding_desc);
445446
COPY_STR(topic);
446447
COPY_STR(pmu_name);
448+
COPY_STR(event_type_desc);
447449
#undef COPY_STR
448450
s->deprecated = info->deprecated;
449451
state->index++;
@@ -498,7 +500,7 @@ void perf_pmus__print_pmu_events(const struct print_callbacks *print_cb, void *p
498500
aliases[j].alias,
499501
aliases[j].scale_unit,
500502
aliases[j].deprecated,
501-
"Kernel PMU event",
503+
aliases[j].event_type_desc,
502504
aliases[j].desc,
503505
aliases[j].long_desc,
504506
aliases[j].encoding_desc);
@@ -511,6 +513,7 @@ void perf_pmus__print_pmu_events(const struct print_callbacks *print_cb, void *p
511513
zfree(&aliases[j].encoding_desc);
512514
zfree(&aliases[j].topic);
513515
zfree(&aliases[j].pmu_name);
516+
zfree(&aliases[j].event_type_desc);
514517
}
515518
if (printed && pager_in_use())
516519
printf("\n");

0 commit comments

Comments
 (0)