Skip to content

Commit d99b312

Browse files
Jean-Philippe Romainacmel
authored andcommitted
perf list: Fix topic and pmu_name argument order
Fix function definitions to match header file declaration. Fix two callers to pass the arguments in the right order. On Intel Tigerlake, before: ``` $ perf list -j|grep "\"Topic\""|sort|uniq "Topic": "cache", "Topic": "cpu", "Topic": "floating point", "Topic": "frontend", "Topic": "memory", "Topic": "other", "Topic": "pfm icl", "Topic": "pfm ix86arch", "Topic": "pfm perf_raw", "Topic": "pipeline", "Topic": "tool", "Topic": "uncore interconnect", "Topic": "uncore memory", "Topic": "uncore other", "Topic": "virtual memory", $ perf list -j|grep "\"Unit\""|sort|uniq "Unit": "cache", "Unit": "cpu", "Unit": "cstate_core", "Unit": "cstate_pkg", "Unit": "i915", "Unit": "icl", "Unit": "intel_bts", "Unit": "intel_pt", "Unit": "ix86arch", "Unit": "msr", "Unit": "perf_raw", "Unit": "power", "Unit": "tool", "Unit": "uncore_arb", "Unit": "uncore_clock", "Unit": "uncore_imc_free_running_0", "Unit": "uncore_imc_free_running_1", ``` After: ``` $ perf list -j|grep "\"Topic\""|sort|uniq "Topic": "cache", "Topic": "floating point", "Topic": "frontend", "Topic": "memory", "Topic": "other", "Topic": "pfm icl", "Topic": "pfm ix86arch", "Topic": "pfm perf_raw", "Topic": "pipeline", "Topic": "tool", "Topic": "uncore interconnect", "Topic": "uncore memory", "Topic": "uncore other", "Topic": "virtual memory", $ perf list -j|grep "\"Unit\""|sort|uniq "Unit": "cpu", "Unit": "cstate_core", "Unit": "cstate_pkg", "Unit": "i915", "Unit": "icl", "Unit": "intel_bts", "Unit": "intel_pt", "Unit": "ix86arch", "Unit": "msr", "Unit": "perf_raw", "Unit": "power", "Unit": "tool", "Unit": "uncore_arb", "Unit": "uncore_clock", "Unit": "uncore_imc_free_running_0", "Unit": "uncore_imc_free_running_1", ``` Fixes: e5c6109 ("perf list: Reorganize to use callbacks to allow honouring command line options") Reviewed-by: Kan Liang <[email protected]> Signed-off-by: Jean-Philippe Romain <[email protected]> Tested-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Junhao He <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ I fixed the two callers and added it to Jean-Phillippe's original change. ] Signed-off-by: Ian Rogers <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 463c203 commit d99b312

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tools/perf/builtin-list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static void wordwrap(FILE *fp, const char *s, int start, int max, int corr)
113113
}
114114
}
115115

116-
static void default_print_event(void *ps, const char *pmu_name, const char *topic,
116+
static void default_print_event(void *ps, const char *topic, const char *pmu_name,
117117
const char *event_name, const char *event_alias,
118118
const char *scale_unit __maybe_unused,
119119
bool deprecated, const char *event_type_desc,
@@ -354,7 +354,7 @@ static void fix_escape_fprintf(FILE *fp, struct strbuf *buf, const char *fmt, ..
354354
fputs(buf->buf, fp);
355355
}
356356

357-
static void json_print_event(void *ps, const char *pmu_name, const char *topic,
357+
static void json_print_event(void *ps, const char *topic, const char *pmu_name,
358358
const char *event_name, const char *event_alias,
359359
const char *scale_unit,
360360
bool deprecated, const char *event_type_desc,

tools/perf/util/pfm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
233233
}
234234

235235
if (is_libpfm_event_supported(name, cpus, threads)) {
236-
print_cb->print_event(print_state, pinfo->name, topic,
236+
print_cb->print_event(print_state, topic, pinfo->name,
237237
name, info->equiv,
238238
/*scale_unit=*/NULL,
239239
/*deprecated=*/NULL, "PFM event",
@@ -267,8 +267,8 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
267267
continue;
268268

269269
print_cb->print_event(print_state,
270-
pinfo->name,
271270
topic,
271+
pinfo->name,
272272
name, /*alias=*/NULL,
273273
/*scale_unit=*/NULL,
274274
/*deprecated=*/NULL, "PFM event",

tools/perf/util/pmus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ void perf_pmus__print_pmu_events(const struct print_callbacks *print_cb, void *p
503503
goto free;
504504

505505
print_cb->print_event(print_state,
506-
aliases[j].pmu_name,
507506
aliases[j].topic,
507+
aliases[j].pmu_name,
508508
aliases[j].name,
509509
aliases[j].alias,
510510
aliases[j].scale_unit,

0 commit comments

Comments
 (0)