[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fWh4+_7Pwy=y6bauiObg0sDG1KRPMUikNZVSNuEC1TPAQ@mail.gmail.com>
Date: Wed, 10 Dec 2025 14:06:06 -0800
From: Ian Rogers <irogers@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>, James Clark <james.clark@...aro.org>,
Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 3/4] perf report: Fix histogram entry collapsing for -F option
On Tue, Dec 9, 2025 at 6:33 PM Namhyung Kim <namhyung@...nel.org> wrote:
>
> Users can use -F/--fields option to set output fields and sort keys
> together. But it missed to set perf_hpp_list->need_collapse for sort
> entries that have se_collapse callbacks. So it ends up with having
> duplicated entries separately.
>
> For example, let's run this command first.
>
> $ perf mem record -t load -U -- perf test -w datasym
>
> This will record samples for memory access (load) to struct 'buf' and a
> loop condition ('sig_atomic_t') types. So the following two commands
> should have identical output.
>
> $ perf report -s type --stdio --percent-limit=1 -q
> 87.80% perf buf
> 12.17% perf sig_atomic_t
>
> But using -F option didn't collapse the entries based on types so the
> result looked like below:
>
> $ perf report -F overhead,type --stdio --percent-limit=1 -q
> 23.31% perf buf
> 22.84% perf buf
> 21.26% perf buf
> 20.39% perf buf
> 12.17% perf sig_atomic_t
>
> Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Reviewed-by: Ian Rogers <irogers@...gle.com>
Thanks,
Ian
> ---
> tools/perf/util/sort.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index a0a5c1c40af0c318..c51604eaae0a4b90 100644
> --- a/tools/perf/util/sort.c
> +++ b/tools/perf/util/sort.c
> @@ -3578,6 +3578,9 @@ static int __sort_dimension__add_output(struct perf_hpp_list *list,
> if (__sort_dimension__add_hpp_output(sd, list, level) < 0)
> return -1;
>
> + if (sd->entry->se_collapse)
> + list->need_collapse = 1;
> +
> sd->taken = 1;
> return 0;
> }
> --
> 2.52.0.223.gf5cc29aaa4-goog
>
Powered by blists - more mailing lists