perf list: Fix topic and pmu_name argument order
BugLink: https://bugs.launchpad.net/bugs/2101915
[ Upstream commit d99b3125726aade4f5ec4aae04805134ab4b0abd ]
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: e5c6109f48 ("perf list: Reorganize to use callbacks to allow honouring command line options")
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
Tested-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Junhao He <hejunhao3@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20241109025801.560378-1-irogers@google.com
[ I fixed the two callers and added it to Jean-Phillippe's original change. ]
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
committed by
Stefan Bader
parent
716c8bfebd
commit
00b5e6804d
@@ -99,7 +99,7 @@ static void wordwrap(FILE *fp, const char *s, int start, int max, int corr)
|
||||
}
|
||||
}
|
||||
|
||||
static void default_print_event(void *ps, const char *pmu_name, const char *topic,
|
||||
static void default_print_event(void *ps, const char *topic, const char *pmu_name,
|
||||
const char *event_name, const char *event_alias,
|
||||
const char *scale_unit __maybe_unused,
|
||||
bool deprecated, const char *event_type_desc,
|
||||
@@ -333,7 +333,7 @@ static void fix_escape_fprintf(FILE *fp, struct strbuf *buf, const char *fmt, ..
|
||||
fputs(buf->buf, fp);
|
||||
}
|
||||
|
||||
static void json_print_event(void *ps, const char *pmu_name, const char *topic,
|
||||
static void json_print_event(void *ps, const char *topic, const char *pmu_name,
|
||||
const char *event_name, const char *event_alias,
|
||||
const char *scale_unit,
|
||||
bool deprecated, const char *event_type_desc,
|
||||
|
||||
@@ -233,7 +233,7 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
|
||||
}
|
||||
|
||||
if (is_libpfm_event_supported(name, cpus, threads)) {
|
||||
print_cb->print_event(print_state, pinfo->name, topic,
|
||||
print_cb->print_event(print_state, topic, pinfo->name,
|
||||
name, info->equiv,
|
||||
/*scale_unit=*/NULL,
|
||||
/*deprecated=*/NULL, "PFM event",
|
||||
@@ -267,8 +267,8 @@ print_libpfm_event(const struct print_callbacks *print_cb, void *print_state,
|
||||
continue;
|
||||
|
||||
print_cb->print_event(print_state,
|
||||
pinfo->name,
|
||||
topic,
|
||||
pinfo->name,
|
||||
name, /*alias=*/NULL,
|
||||
/*scale_unit=*/NULL,
|
||||
/*deprecated=*/NULL, "PFM event",
|
||||
|
||||
@@ -484,8 +484,8 @@ void perf_pmus__print_pmu_events(const struct print_callbacks *print_cb, void *p
|
||||
goto free;
|
||||
|
||||
print_cb->print_event(print_state,
|
||||
aliases[j].pmu_name,
|
||||
aliases[j].topic,
|
||||
aliases[j].pmu_name,
|
||||
aliases[j].name,
|
||||
aliases[j].alias,
|
||||
aliases[j].scale_unit,
|
||||
|
||||
Reference in New Issue
Block a user