Re: [PATCH 1/5] perf tools: Add fallback functions for cases where cpumode is insufficient

From: Arnaldo Carvalho de Melo
Date: Mon Nov 05 2018 - 15:32:01 EST


Em Mon, Nov 05, 2018 at 07:53:17PM +0000, Hunter, Adrian escreveu:
> > -----Original Message-----
> > From: Arnaldo Carvalho de Melo [mailto:acme@xxxxxxxxxx]
> > Sent: Monday, November 5, 2018 9:36 PM
> > To: Hunter, Adrian <adrian.hunter@xxxxxxxxx>
> > Cc: Jiri Olsa <jolsa@xxxxxxxxxx>; Andi Kleen <ak@xxxxxxxxxxxxxxx>; linux-
> > kernel@xxxxxxxxxxxxxxx; leo.yan@xxxxxxxxxx; David Miller
> > <davem@xxxxxxxxxxxxx>; Mathieu Poirier <mathieu.poirier@xxxxxxxxxx>
> > Subject: Re: [PATCH 1/5] perf tools: Add fallback functions for cases where
> > cpumode is insufficient
> >
> > Em Mon, Nov 05, 2018 at 07:21:44PM +0000, Hunter, Adrian escreveu:
> > > > In Monday, November 5, 2018 7:30 PM, Arnaldo Carvalho de Melo wrote
> > > > Also have you considered making this fallback to be performed only
> > > > from code that is that arch specific?

> > > > I.e. the code that supports branch samples/stacks is x86_86 specific
> > > > at this point and thus only in that case we would call the routines
> > > > that perform the fallback, which, in turn, wouldn't need to check for
> > "sparc"?
> >
> > > I will look at it, but theoretically someone could be processing x86
> > > data but doing it on a machine of a different architecture.
> >
> > Right, that should be supported, yes. What I meant was that when
> > processing perf.data file with samples where the cpumode can't be inferred,
> > we should use the fallback routines.
> >
> > It is super unfortunate that we have addresses without a accompanying
> > cpumode :-\ Don't you think those coulde be fixed somehow? If this comes
> > from things synthesized from Intel PT traces, then we can use the address
> > ranges for kernel/userspace to derive that before hitting the core code, that
> > would be fed with addr/cpumode pairs, just like we have hdr.misc &
> > USER/KERNEL and the PERF_CONTEXT_ markers in callchains.
>
> Yes we will probably need to look at that, but at the moment I would like a fix for stable.

Ok, with that check for archs like sparc, fair enough, and its great
that you consider doing the better fix on top of it, later, thanks!

- Arnaldo