Re: [PATCH v1 1/2] perf metrics: Avoid segv if default metricgroup isn't set

From: Namhyung Kim
Date: Tue Dec 05 2023 - 14:11:07 EST


On Tue, Dec 5, 2023 at 10:48 AM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> Em Tue, Dec 05, 2023 at 09:24:42AM -0800, Namhyung Kim escreveu:
> > Hi Arnaldo,
> >
> > On Tue, Dec 5, 2023 at 7:51 AM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> > >
> > > Em Mon, Dec 04, 2023 at 07:33:18PM -0800, Namhyung Kim escreveu:
> > > > On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen <ilkka@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> > > > > On Mon, 4 Dec 2023, Ian Rogers wrote:
> > > > > > A metric is default by having "Default" within its groups. The default
> > > > > > metricgroup name needn't be set and this can result in segv in
> > > > > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup
> > > > > > that assume it has a value when there is a Default metric group. To
> > > > > > avoid the segv initialize the value to "".
> > >
> > > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup")
> > > > > > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > >
> > > > > Thanks! I was going to look for the bug but got pulled to other
> > > > > tasks. The patch looks good to me and I tested it successfully on
> > > > > AmpereOne.
> > >
> > > > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@xxxxxxxxxxxxxxxxxxxxxx>
> > >
> > > > Looks like it needs to go through perf-tools for v6.7.
> > > > Ian, do you think this one is enough?
> > >
> > > So I had this on my local perf-tools-next, removed now, I also have some
> > > other fixes by Ian on the tmp.perf-tools-next, please let me know what
> > > you guys decide to have in perf-tools for v6.7 so that I can remove it
> > > from there.
> >
> > I think we need this one and the Ampere default-metric-group fix.
> >
> > https://lore.kernel.org/r/20231201021550.1109196-2-ilkka@xxxxxxxxxxxxxxxxxxxxxx/
> >
> > Also perf list JSON fix can go to v6.7.
> >
> > https://lore.kernel.org/r/20231129213428.2227448-2-irogers@xxxxxxxxxx/
>
> Ok, removed both, please augment the later description to:
>
> "perf list: Fix JSON segfault by setting the used skip_fuplicate_pmus callback"
>
> The original description was vague, improving it a bit like that helps
> when just looking at the output of "git log --oneline".

Done and pushed to tmp.perf-tools!

Thanks,
Namhyung