Re: [PATCH v1] perf stat: Avoid merging/aggregating metric counts twice

From: Arnaldo Carvalho de Melo
Date: Thu Feb 09 2023 - 16:29:55 EST


Em Thu, Feb 09, 2023 at 11:06:22AM -0800, Namhyung Kim escreveu:
> On Wed, Feb 8, 2023 at 10:45 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:

> > The added perf_stat_merge_counters combines uncore counters. When
> > metrics are enabled, the counts are merged into a metric_leader
> > via the stat-shadow saved_value logic. As the leader now is
> > passed an aggregated count, it leads to all counters being added
> > together twice and counts appearing approximately doubled in
> > metrics.

> > This change disables the saved_value merging of counts for evsels
> > that are merged. It is recommended that later changes remove the
> > saved_value entirely as the two layers of aggregation in the code
> > is confusing.

> +1

'perf stat' code needs help, that I'm sure, its great that you guys are
looking/working at/on it, please continue.

> >
> > Fixes: 942c5593393d ("perf stat: Add perf_stat_merge_counters()")
> > Reported-by: Perry Taylor <perry.taylor@xxxxxxxxx>
> > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
>
> Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Thanks, applied.

- Arnaldo