Re: [PATCH v1 2/2] perf script: Fix for `perf script +F metric` with leader sampling
From: Andi Kleen
Date: Tue Jul 23 2024 - 11:26:53 EST
> > For some reason I only get the metric: lines when I record with -a. I
> > noticed this because Andi's test doesn't use -a so it fails.
> >
> > I'm not sure if that's expected or it's related to your disclaimer below?
>
> It is. When you don't do -a the cpu map just contains -1 and for some
The intention was to make it work without -a
> reason it is busted. The whole indirections to arrays of arrays,
That's what I tried to fix earlier with my patch that remapped to index 0,
but it ran into the problem that it conflicted with the perf stat report setup.
The metrics code doesn't really need a map, all it wants to do is to
process the last contiguous group.
That is at some point perhaps it would be nice to extend it to multiple
groups, but I wasn't trying to support that here.
> counts, stats, aggregations, with indices into various other arrays
> and a lack of helpers. The code works for perf stat, but there is a
> lot of complexity that I don't fully grok in that. Here I've tried to
I don't really know how we ended up with such convoluted code, but that's
a different issue.
-Andi