* [PATCH v1] perf list: Fix topic and pmu_name argument order
@ 2024-11-09 2:58 Ian Rogers
2024-11-11 14:48 ` Liang, Kan
0 siblings, 1 reply; 5+ messages in thread
From: Ian Rogers @ 2024-11-09 2:58 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, Kan Liang, Jean-Philippe Romain,
Junhao He, linux-perf-users, linux-kernel
From: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
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: e5c6109f4813 ("perf list: Reorganize to use callbacks to allow honouring command line options")
Signed-off-by: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
Tested-by: Ian Rogers <irogers@google.com>
---
Note from Ian, I fixed the two callers and added it to
Jean-Phillippe's original change.
---
tools/perf/builtin-list.c | 4 ++--
tools/perf/util/pfm.c | 4 ++--
tools/perf/util/pmus.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index b8378ba18c28..9e7fdfcdd7ff 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -113,7 +113,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,
@@ -354,7 +354,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,
diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
index 5ccfe4b64cdf..0dacc133ed39 100644
--- a/tools/perf/util/pfm.c
+++ b/tools/perf/util/pfm.c
@@ -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",
diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
index 107de86c2637..6d4c7c9ecf3a 100644
--- a/tools/perf/util/pmus.c
+++ b/tools/perf/util/pmus.c
@@ -501,8 +501,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,
--
2.47.0.277.g8800431eea-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v1] perf list: Fix topic and pmu_name argument order
2024-11-09 2:58 [PATCH v1] perf list: Fix topic and pmu_name argument order Ian Rogers
@ 2024-11-11 14:48 ` Liang, Kan
2024-11-11 17:34 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 5+ messages in thread
From: Liang, Kan @ 2024-11-11 14:48 UTC (permalink / raw)
To: Ian Rogers, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Adrian Hunter, Jean-Philippe Romain, Junhao He, linux-perf-users,
linux-kernel
On 2024-11-08 9:58 p.m., Ian Rogers wrote:
> From: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
>
> 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: e5c6109f4813 ("perf list: Reorganize to use callbacks to allow honouring command line options")
> Signed-off-by: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
> Tested-by: Ian Rogers <irogers@google.com>
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Thanks,
Kan
> ---
> Note from Ian, I fixed the two callers and added it to
> Jean-Phillippe's original change.
> ---
> tools/perf/builtin-list.c | 4 ++--
> tools/perf/util/pfm.c | 4 ++--
> tools/perf/util/pmus.c | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> index b8378ba18c28..9e7fdfcdd7ff 100644
> --- a/tools/perf/builtin-list.c
> +++ b/tools/perf/builtin-list.c
> @@ -113,7 +113,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,
> @@ -354,7 +354,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,
> diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
> index 5ccfe4b64cdf..0dacc133ed39 100644
> --- a/tools/perf/util/pfm.c
> +++ b/tools/perf/util/pfm.c
> @@ -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",
> diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
> index 107de86c2637..6d4c7c9ecf3a 100644
> --- a/tools/perf/util/pmus.c
> +++ b/tools/perf/util/pmus.c
> @@ -501,8 +501,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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] perf list: Fix topic and pmu_name argument order
2024-11-11 14:48 ` Liang, Kan
@ 2024-11-11 17:34 ` Arnaldo Carvalho de Melo
2024-11-11 18:20 ` Ian Rogers
0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-11-11 17:34 UTC (permalink / raw)
To: Liang, Kan
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
Jean-Philippe Romain, Junhao He, linux-perf-users, linux-kernel
On Mon, Nov 11, 2024 at 09:48:41AM -0500, Liang, Kan wrote:
>
>
> On 2024-11-08 9:58 p.m., Ian Rogers wrote:
> > From: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
> >
> > 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: e5c6109f4813 ("perf list: Reorganize to use callbacks to allow honouring command line options")
> > Signed-off-by: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
> > Tested-by: Ian Rogers <irogers@google.com>
>
> Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
> > ---
> > Note from Ian, I fixed the two callers and added it to
> > Jean-Phillippe's original change.
I think that in this case we need:
[ I fixed the two callers and added it to Jean-Phillippe's original change. ]
Signed-off-by: Ian Rogers <irogers@google.com>
Ok?
- Arnaldo
> > ---
> > tools/perf/builtin-list.c | 4 ++--
> > tools/perf/util/pfm.c | 4 ++--
> > tools/perf/util/pmus.c | 2 +-
> > 3 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> > index b8378ba18c28..9e7fdfcdd7ff 100644
> > --- a/tools/perf/builtin-list.c
> > +++ b/tools/perf/builtin-list.c
> > @@ -113,7 +113,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,
> > @@ -354,7 +354,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,
> > diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
> > index 5ccfe4b64cdf..0dacc133ed39 100644
> > --- a/tools/perf/util/pfm.c
> > +++ b/tools/perf/util/pfm.c
> > @@ -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",
> > diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
> > index 107de86c2637..6d4c7c9ecf3a 100644
> > --- a/tools/perf/util/pmus.c
> > +++ b/tools/perf/util/pmus.c
> > @@ -501,8 +501,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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] perf list: Fix topic and pmu_name argument order
2024-11-11 17:34 ` Arnaldo Carvalho de Melo
@ 2024-11-11 18:20 ` Ian Rogers
2024-11-12 15:24 ` Jean-philippe ROMAIN
0 siblings, 1 reply; 5+ messages in thread
From: Ian Rogers @ 2024-11-11 18:20 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Liang, Kan, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
Jean-Philippe Romain, Junhao He, linux-perf-users, linux-kernel
On Mon, Nov 11, 2024 at 9:35 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Mon, Nov 11, 2024 at 09:48:41AM -0500, Liang, Kan wrote:
> >
> >
> > On 2024-11-08 9:58 p.m., Ian Rogers wrote:
> > > From: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
> > >
> > > 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: e5c6109f4813 ("perf list: Reorganize to use callbacks to allow honouring command line options")
> > > Signed-off-by: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
> > > Tested-by: Ian Rogers <irogers@google.com>
> >
> > Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
>
> > > ---
> > > Note from Ian, I fixed the two callers and added it to
> > > Jean-Phillippe's original change.
>
> I think that in this case we need:
>
> [ I fixed the two callers and added it to Jean-Phillippe's original change. ]
> Signed-off-by: Ian Rogers <irogers@google.com>
>
> Ok?
Sgtm.
Thanks,
Ian
> > > ---
> > > tools/perf/builtin-list.c | 4 ++--
> > > tools/perf/util/pfm.c | 4 ++--
> > > tools/perf/util/pmus.c | 2 +-
> > > 3 files changed, 5 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> > > index b8378ba18c28..9e7fdfcdd7ff 100644
> > > --- a/tools/perf/builtin-list.c
> > > +++ b/tools/perf/builtin-list.c
> > > @@ -113,7 +113,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,
> > > @@ -354,7 +354,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,
> > > diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
> > > index 5ccfe4b64cdf..0dacc133ed39 100644
> > > --- a/tools/perf/util/pfm.c
> > > +++ b/tools/perf/util/pfm.c
> > > @@ -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",
> > > diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
> > > index 107de86c2637..6d4c7c9ecf3a 100644
> > > --- a/tools/perf/util/pmus.c
> > > +++ b/tools/perf/util/pmus.c
> > > @@ -501,8 +501,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,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v1] perf list: Fix topic and pmu_name argument order
2024-11-11 18:20 ` Ian Rogers
@ 2024-11-12 15:24 ` Jean-philippe ROMAIN
0 siblings, 0 replies; 5+ messages in thread
From: Jean-philippe ROMAIN @ 2024-11-12 15:24 UTC (permalink / raw)
To: Ian Rogers, Arnaldo Carvalho de Melo
Cc: Liang, Kan, Peter Zijlstra, Ingo Molnar, Namhyung Kim,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
Junhao He, linux-perf-users, linux-kernel
On 11/11/24 19:20, Ian Rogers wrote:
> On Mon, Nov 11, 2024 at 9:35 AM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
>> On Mon, Nov 11, 2024 at 09:48:41AM -0500, Liang, Kan wrote:
>>>
>>> On 2024-11-08 9:58 p.m., Ian Rogers wrote:
>>>> From: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
>>>>
>>>> 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: e5c6109f4813 ("perf list: Reorganize to use callbacks to allow honouring command line options")
>>>> Signed-off-by: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
>>>> Tested-by: Ian Rogers <irogers@google.com>
>>> Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
>>>> ---
>>>> Note from Ian, I fixed the two callers and added it to
>>>> Jean-Phillippe's original change.
>> I think that in this case we need:
>>
>> [ I fixed the two callers and added it to Jean-Phillippe's original change. ]
>> Signed-off-by: Ian Rogers <irogers@google.com>
>>
>> Ok?
> Sgtm.
>
> Thanks,
> Ian
>
Reviewed-by: Jean-Philippe Romain <jean-philippe.romain@foss.st.com>
Many thanks,
Jean-Philippe
>>>> ---
>>>> tools/perf/builtin-list.c | 4 ++--
>>>> tools/perf/util/pfm.c | 4 ++--
>>>> tools/perf/util/pmus.c | 2 +-
>>>> 3 files changed, 5 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
>>>> index b8378ba18c28..9e7fdfcdd7ff 100644
>>>> --- a/tools/perf/builtin-list.c
>>>> +++ b/tools/perf/builtin-list.c
>>>> @@ -113,7 +113,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,
>>>> @@ -354,7 +354,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,
>>>> diff --git a/tools/perf/util/pfm.c b/tools/perf/util/pfm.c
>>>> index 5ccfe4b64cdf..0dacc133ed39 100644
>>>> --- a/tools/perf/util/pfm.c
>>>> +++ b/tools/perf/util/pfm.c
>>>> @@ -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",
>>>> diff --git a/tools/perf/util/pmus.c b/tools/perf/util/pmus.c
>>>> index 107de86c2637..6d4c7c9ecf3a 100644
>>>> --- a/tools/perf/util/pmus.c
>>>> +++ b/tools/perf/util/pmus.c
>>>> @@ -501,8 +501,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,
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-11-12 15:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-09 2:58 [PATCH v1] perf list: Fix topic and pmu_name argument order Ian Rogers
2024-11-11 14:48 ` Liang, Kan
2024-11-11 17:34 ` Arnaldo Carvalho de Melo
2024-11-11 18:20 ` Ian Rogers
2024-11-12 15:24 ` Jean-philippe ROMAIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).