Re: [PATCH 18/20] perf stat: Display event stats using aggr counts

From: Namhyung Kim
Date: Thu Jun 15 2023 - 13:31:22 EST


Hi Jiri,

On Thu, Jun 15, 2023 at 1:10 AM Jiri Olsa <olsajiri@xxxxxxxxx> wrote:
>
> On Wed, Jun 14, 2023 at 09:20:53AM -0700, Ian Rogers wrote:
> > On Wed, Jun 14, 2023 at 6:40 AM Jiri Olsa <olsajiri@xxxxxxxxx> wrote:
> > >
> > > On Mon, Oct 17, 2022 at 07:02:25PM -0700, Namhyung Kim wrote:
> > > > Now aggr counts are ready for use. Convert the display routines to use
> > > > the aggr counts and update the shadow stat with them. It doesn't need
> > > > to aggregate counts or collect aliases anymore during the display. Get
> > > > rid of now unused struct perf_aggr_thread_value.
> > > >
> > > > Note that there's a difference in the display order among the aggr mode.
> > > > For per-core/die/socket/node aggregation, it shows relevant events in
> > > > the same unit together, whereas global/thread/no aggregation it shows
> > > > the same events for different units together. So it still uses separate
> > > > codes to display them due to the ordering.
> > > >
> > > > One more thing to note is that it breaks per-core event display for now.
> > > > The next patch will fix it to have identical output as of now.
> > > >
> > > > Acked-by: Ian Rogers <irogers@xxxxxxxxxx>
> > > > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> > >
> > > hi,
> > > this one seems to break 'perf stat -r X' not sure why so far..
> > >
> > > final counts seems to be accumulated instead of displaying average, like:
> > >
> > >
> > > with this patch:
> > >
> > > Performance counter stats for './test_progs -n 103/1' (2 runs):
> > >
> > > 206,815,929 cycles:u ( +- 0.05% )
> > > 16,052,747,533 cycles:k ( +- 0.10% )
> > > 16,259,643,167 cycles ( +- 0.10% )
> > >
> > > 1.98093 +- 0.00586 seconds time elapsed ( +- 0.30% )
> > >
> > >
> > > without this patch:
> > >
> > > Performance counter stats for './test_progs -n 103/1' (2 runs):
> > >
> > > 103,300,812 cycles:u ( +- 0.37% )
> > > 8,016,856,866 cycles:k ( +- 0.32% )
> > > 8,120,200,572 cycles ( +- 0.32% )
> > >
> > > 1.97272 +- 0.00270 seconds time elapsed ( +- 0.14% )
> > >
> > >
> > > any idea? ;-)
> >
> > Is this still broken in perf-tools-next? The patch is quite old and
> > there's been work in this area. I'm assuming yes, but thought it was
> > worth checking.
>
> yes

I'll take a look.