* [PATCH v1] perf stat: Don't display zero tool counts
@ 2023-08-01 20:54 Ian Rogers
2023-08-03 20:38 ` Andi Kleen
2023-08-03 20:54 ` Arnaldo Carvalho de Melo
0 siblings, 2 replies; 8+ messages in thread
From: Ian Rogers @ 2023-08-01 20:54 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Adrian Hunter, Kan Liang, Athira Rajeev, Claire Jensen,
linux-perf-users, linux-kernel, Andi Kleen
Cc: Ian Rogers
Skip zero counts for tool events.
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/stat-display.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 7329b3340f88..d45d5dcb0e2b 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -931,6 +931,11 @@ static bool should_skip_zero_counter(struct perf_stat_config *config,
*/
if (config->aggr_mode == AGGR_THREAD && config->system_wide)
return true;
+
+ /* Tool events have the software PMU but are only gathered on 1. */
+ if (evsel__is_tool(counter))
+ return true;
+
/*
* Skip value 0 when it's an uncore event and the given aggr id
* does not belong to the PMU cpumask.
--
2.41.0.585.gd2178a4bd4-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1] perf stat: Don't display zero tool counts
2023-08-01 20:54 [PATCH v1] perf stat: Don't display zero tool counts Ian Rogers
@ 2023-08-03 20:38 ` Andi Kleen
2023-08-03 20:54 ` Arnaldo Carvalho de Melo
1 sibling, 0 replies; 8+ messages in thread
From: Andi Kleen @ 2023-08-03 20:38 UTC (permalink / raw)
To: Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Adrian Hunter, Kan Liang, Athira Rajeev, Claire Jensen,
linux-perf-users, linux-kernel
On Tue, Aug 01, 2023 at 01:54:52PM -0700, Ian Rogers wrote:
> Skip zero counts for tool events.
>
> Reported-by: Andi Kleen <ak@linux.intel.com>
> Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Andi Kleen <ak@linux.intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] perf stat: Don't display zero tool counts
2023-08-01 20:54 [PATCH v1] perf stat: Don't display zero tool counts Ian Rogers
2023-08-03 20:38 ` Andi Kleen
@ 2023-08-03 20:54 ` Arnaldo Carvalho de Melo
2023-08-07 14:54 ` Andi Kleen
1 sibling, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-08-03 20:54 UTC (permalink / raw)
To: Andi Kleen, Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Jiri Olsa, Namhyung Kim, Adrian Hunter, Kan Liang, Athira Rajeev,
Claire Jensen, linux-perf-users, linux-kernel
Em Tue, Aug 01, 2023 at 01:54:52PM -0700, Ian Rogers escreveu:
> Skip zero counts for tool events.
>
> Reported-by: Andi Kleen <ak@linux.intel.com>
Andi,
Have you tested this? Can we please have your Tested-by?
- Arnaldo:1
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
> tools/perf/util/stat-display.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index 7329b3340f88..d45d5dcb0e2b 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -931,6 +931,11 @@ static bool should_skip_zero_counter(struct perf_stat_config *config,
> */
> if (config->aggr_mode == AGGR_THREAD && config->system_wide)
> return true;
> +
> + /* Tool events have the software PMU but are only gathered on 1. */
> + if (evsel__is_tool(counter))
> + return true;
> +
> /*
> * Skip value 0 when it's an uncore event and the given aggr id
> * does not belong to the PMU cpumask.
> --
> 2.41.0.585.gd2178a4bd4-goog
>
--
- Arnaldo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] perf stat: Don't display zero tool counts
2023-08-03 20:54 ` Arnaldo Carvalho de Melo
@ 2023-08-07 14:54 ` Andi Kleen
2023-08-07 19:43 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2023-08-07 14:54 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
Kan Liang, Athira Rajeev, Claire Jensen, linux-perf-users,
linux-kernel
On Thu, Aug 03, 2023 at 05:54:59PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 01, 2023 at 01:54:52PM -0700, Ian Rogers escreveu:
> > Skip zero counts for tool events.
> >
> > Reported-by: Andi Kleen <ak@linux.intel.com>
>
> Andi,
>
> Have you tested this? Can we please have your Tested-by?
I thought I had sent it earlier?
Tested-by: Andi Kleen <ak@linux.intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] perf stat: Don't display zero tool counts
2023-08-07 14:54 ` Andi Kleen
@ 2023-08-07 19:43 ` Arnaldo Carvalho de Melo
2023-08-07 19:57 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-08-07 19:43 UTC (permalink / raw)
To: Andi Kleen
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
Kan Liang, Athira Rajeev, Claire Jensen, linux-perf-users,
linux-kernel
Em Mon, Aug 07, 2023 at 07:54:47AM -0700, Andi Kleen escreveu:
> On Thu, Aug 03, 2023 at 05:54:59PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Aug 01, 2023 at 01:54:52PM -0700, Ian Rogers escreveu:
> > > Skip zero counts for tool events.
> > >
> > > Reported-by: Andi Kleen <ak@linux.intel.com>
> >
> > Andi,
> >
> > Have you tested this? Can we please have your Tested-by?
>
> I thought I had sent it earlier?
>
> Tested-by: Andi Kleen <ak@linux.intel.com>
Yeah, you did it, sorry, somehow I didn't notice.
Applying.
- Arnaldo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] perf stat: Don't display zero tool counts
2023-08-07 19:43 ` Arnaldo Carvalho de Melo
@ 2023-08-07 19:57 ` Arnaldo Carvalho de Melo
2023-08-08 17:38 ` Andi Kleen
0 siblings, 1 reply; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-08-07 19:57 UTC (permalink / raw)
To: Andi Kleen
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
Kan Liang, Athira Rajeev, Claire Jensen, linux-perf-users,
linux-kernel
Em Mon, Aug 07, 2023 at 04:43:38PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Mon, Aug 07, 2023 at 07:54:47AM -0700, Andi Kleen escreveu:
> > On Thu, Aug 03, 2023 at 05:54:59PM -0300, Arnaldo Carvalho de Melo wrote:
> > > Em Tue, Aug 01, 2023 at 01:54:52PM -0700, Ian Rogers escreveu:
> > > > Skip zero counts for tool events.
> > > >
> > > > Reported-by: Andi Kleen <ak@linux.intel.com>
> > >
> > > Andi,
> > >
> > > Have you tested this? Can we please have your Tested-by?
> >
> > I thought I had sent it earlier?
> >
> > Tested-by: Andi Kleen <ak@linux.intel.com>
>
> Yeah, you did it, sorry, somehow I didn't notice.
>
> Applying.
Would be good to have the original link with your report and to figure
out the cset that introduced the problem, so that we could have a Fixes
tag to help justifying getting this into 6.5.
- Arnaldo
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] perf stat: Don't display zero tool counts
2023-08-07 19:57 ` Arnaldo Carvalho de Melo
@ 2023-08-08 17:38 ` Andi Kleen
2023-08-08 19:50 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2023-08-08 17:38 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
Kan Liang, Athira Rajeev, Claire Jensen, linux-perf-users,
linux-kernel
On Mon, Aug 07, 2023 at 04:57:31PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, Aug 07, 2023 at 04:43:38PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Mon, Aug 07, 2023 at 07:54:47AM -0700, Andi Kleen escreveu:
> > > On Thu, Aug 03, 2023 at 05:54:59PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > Em Tue, Aug 01, 2023 at 01:54:52PM -0700, Ian Rogers escreveu:
> > > > > Skip zero counts for tool events.
> > > > >
> > > > > Reported-by: Andi Kleen <ak@linux.intel.com>
> > > >
> > > > Andi,
> > > >
> > > > Have you tested this? Can we please have your Tested-by?
> > >
> > > I thought I had sent it earlier?
> > >
> > > Tested-by: Andi Kleen <ak@linux.intel.com>
> >
> > Yeah, you did it, sorry, somehow I didn't notice.
> >
> > Applying.
>
> Would be good to have the original link with your report and to figure
> out the cset that introduced the problem, so that we could have a Fixes
> tag to help justifying getting this into 6.5.
Just bisected it. The original patch was below. Remarkably it had a "Fixes"
tag too)
My report was
https://lore.kernel.org/linux-perf-users/ZMlrzcVrVi1lTDmn@tassilo/
commit b897613510890d6e92b6a276a20f6c3d96fe90e8
Author: Namhyung Kim <namhyung@kernel.org>
Date: Tue Dec 6 09:58:04 2022 -0800
perf stat: Update event skip condition for system-wide per-thread mode and merged uncore and hybrid events
In print_counter_aggrdata(), it skips some events that has no aggregate
count. It's actually for system-wide per-thread mode and merged uncore
and hybrid events.
Let's update the condition to check them explicitly.
Fixes: 91f85f98da7ab8c3 ("perf stat: Display event stats using aggr counts")
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1] perf stat: Don't display zero tool counts
2023-08-08 17:38 ` Andi Kleen
@ 2023-08-08 19:50 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-08-08 19:50 UTC (permalink / raw)
To: Andi Kleen
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, Adrian Hunter,
Kan Liang, Athira Rajeev, Claire Jensen, linux-perf-users,
linux-kernel
Em Tue, Aug 08, 2023 at 10:38:48AM -0700, Andi Kleen escreveu:
> On Mon, Aug 07, 2023 at 04:57:31PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Aug 07, 2023 at 04:43:38PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Em Mon, Aug 07, 2023 at 07:54:47AM -0700, Andi Kleen escreveu:
> > > > On Thu, Aug 03, 2023 at 05:54:59PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > Em Tue, Aug 01, 2023 at 01:54:52PM -0700, Ian Rogers escreveu:
> > > > > > Skip zero counts for tool events.
> > > > > >
> > > > > > Reported-by: Andi Kleen <ak@linux.intel.com>
> > > > >
> > > > > Andi,
> > > > >
> > > > > Have you tested this? Can we please have your Tested-by?
> > > >
> > > > I thought I had sent it earlier?
> > > >
> > > > Tested-by: Andi Kleen <ak@linux.intel.com>
> > >
> > > Yeah, you did it, sorry, somehow I didn't notice.
> > >
> > > Applying.
> >
> > Would be good to have the original link with your report and to figure
> > out the cset that introduced the problem, so that we could have a Fixes
> > tag to help justifying getting this into 6.5.
>
> Just bisected it. The original patch was below. Remarkably it had a "Fixes"
> tag too)
>
> My report was
>
> https://lore.kernel.org/linux-perf-users/ZMlrzcVrVi1lTDmn@tassilo/
Thanks, I did this research and bisection earlier today, some more tests
and the result matches yours and is available at:
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools.git/commit/?h=perf-tools
I used that ZMlrzcVrVi1lTDmn@tassilo in the Link: tag, as Linus stated
he prefers the discussion leading to the patch than the URL for the
patch itself once submitted.
Now I'll wait a bit till it lands in linux-next/pending-fixes to then
send it to Linus.
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?h=pending-fixes
Thanks again!
- Arnaldo
> commit b897613510890d6e92b6a276a20f6c3d96fe90e8
> Author: Namhyung Kim <namhyung@kernel.org>
> Date: Tue Dec 6 09:58:04 2022 -0800
>
> perf stat: Update event skip condition for system-wide per-thread mode and merged uncore and hybrid events
>
> In print_counter_aggrdata(), it skips some events that has no aggregate
> count. It's actually for system-wide per-thread mode and merged uncore
> and hybrid events.
>
> Let's update the condition to check them explicitly.
>
> Fixes: 91f85f98da7ab8c3 ("perf stat: Display event stats using aggr counts")
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-08-08 20:30 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01 20:54 [PATCH v1] perf stat: Don't display zero tool counts Ian Rogers
2023-08-03 20:38 ` Andi Kleen
2023-08-03 20:54 ` Arnaldo Carvalho de Melo
2023-08-07 14:54 ` Andi Kleen
2023-08-07 19:43 ` Arnaldo Carvalho de Melo
2023-08-07 19:57 ` Arnaldo Carvalho de Melo
2023-08-08 17:38 ` Andi Kleen
2023-08-08 19:50 ` Arnaldo Carvalho de Melo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.