Re: [PATCH] perf: arm-spe: Fix perf report --mem-mode

From: Leo Yan
Date: Sun Apr 10 2022 - 10:35:35 EST


On Sat, Apr 09, 2022 at 12:12:37PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Sat, Apr 09, 2022 at 05:59:41PM +0800, Leo Yan escreveu:
> > On Fri, Apr 08, 2022 at 11:13:09AM -0700, Namhyung Kim wrote:
> > > Hello,
> > >
> > > On Fri, Apr 8, 2022 at 7:41 AM James Clark <james.clark@xxxxxxx> wrote:
> > > >
> > > > Since commit bb30acae4c4d ("perf report: Bail out --mem-mode if mem info
> > > > is not available") "perf mem report" and "perf report --mem-mode" don't
> > > > allow opening the file unless one of the events has PERF_SAMPLE_DATA_SRC
> > > > set.
> > > >
> > > > SPE doesn't have this set even though synthetic memory data is generated
> > > > after it is decoded. Fix this issue by setting DATA_SRC on SPE events.
> > > > This has no effect on the data collected because the SPE driver doesn't
> > > > do anything with that flag and doesn't generate samples.
> > > >
> > > > Fixes: bb30acae4c4d ("perf report: Bail out --mem-mode if mem info is not available")
> > > > Signed-off-by: James Clark <james.clark@xxxxxxx>
> > >
> > > Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> >
> > Tested-by: Leo Yan <leo.yan@xxxxxxxxxx>
> >
> > It's a bit awkward that after the commit bb30acae4c4d we cannot be
> > backward compatible and any old perf data file will be failed to
> > support by 'perf mem report' tool.
>
> oh well, I think we should put in place a mechanism to run perf record
> before some change, then make sure that a new perf is able to process
> it after a rebuild.
>
> If its something unsurmountable, then a proper explanation should be
> done with a workaround to process those older files, even if pointing
> out to the perf version that is able to process the old file.

I will follow up to add a sub test case for Arm SPE with 'perf mem'.

I tried to find possible workround for old perf data files but failed,
the 'perf mem' tool reports error in a very early time so I cannot add
workaround in Arm SPE specific code (e.g. arm_spe_process_auxtrace_info()).
I will check furthermore, as a backup will send a patch to remind
suitable perf version.

A backlog task for me is to setup an automatic testing envoirnment
for daily testing perf on Arm64. I will setup an automatic testing
for this.

> Anyway, applying this pa tch.

Thanks!

Leo