* [PATCH] perf list: fix arguments order issue for events printing
@ 2024-11-08 8:29 Jean-Philippe Romain
2024-11-09 2:27 ` Ian Rogers
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Philippe Romain @ 2024-11-08 8:29 UTC (permalink / raw)
To: Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
Liang Kan
Cc: linux-perf-users, linux-kernel, fabrice.gasnier, alexandre.torgue
Misalignment of callbacks with print_event:
- pmu_name and topic arguments to reverse
Signed-off-by: Jean-Philippe ROMAIN <jean-philippe.romain@foss.st.com>
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 65b8cba324be..c5331721dfee 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -112,7 +112,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,
@@ -353,7 +353,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,
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] perf list: fix arguments order issue for events printing
2024-11-08 8:29 [PATCH] perf list: fix arguments order issue for events printing Jean-Philippe Romain
@ 2024-11-09 2:27 ` Ian Rogers
0 siblings, 0 replies; 2+ messages in thread
From: Ian Rogers @ 2024-11-09 2:27 UTC (permalink / raw)
To: Jean-Philippe Romain
Cc: Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Adrian Hunter, Liang Kan,
linux-perf-users, linux-kernel, fabrice.gasnier, alexandre.torgue
On Fri, Nov 8, 2024 at 12:31 AM Jean-Philippe Romain
<jean-philippe.romain@foss.st.com> wrote:
>
> Misalignment of callbacks with print_event:
> - pmu_name and topic arguments to reverse
>
> Signed-off-by: Jean-Philippe ROMAIN <jean-philippe.romain@foss.st.com>
>
> diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> index 65b8cba324be..c5331721dfee 100644
> --- a/tools/perf/builtin-list.c
> +++ b/tools/perf/builtin-list.c
> @@ -112,7 +112,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,
So it looks like the call sites are doing this wrong too:
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/util/pmus.c?h=perf-tools-next#n504
```
...
print_cb->print_event(print_state,
aliases[j].pmu_name,
aliases[j].topic,
...
```
I'll review the call-sites and send a bigger change.
Thanks,
Ian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-09 2:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 8:29 [PATCH] perf list: fix arguments order issue for events printing Jean-Philippe Romain
2024-11-09 2:27 ` Ian Rogers
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).