Re: [PATCH 05/14] perf tools: Add parse_events_fake interface

From: Jiri Olsa
Date: Mon Jun 01 2020 - 11:49:41 EST


On Mon, Jun 01, 2020 at 12:04:28PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, Jun 01, 2020 at 11:08:50AM +0200, Jiri Olsa escreveu:
> > On Mon, Jun 01, 2020 at 12:28:31AM -0700, Ian Rogers wrote:
> > > On Sun, May 24, 2020 at 3:42 PM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> > > >
> > > > Adding parse_events_fake interface to parse events
> > > > and use fake pmu event in case pmu event is parsed.
> > > >
> > > > This way it's possible to parse events from PMUs
> > > > which are not present in the system. It's available
> > > > only for testing purposes coming in following
> > > > changes.
> > > >
> > > > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
> > >
> > > Acked-by: Ian Rogers <irogers@xxxxxxxxxx>
> > >
> > > Alternatively fake_pmu could be an argument to parse_events.
> >
> > yea I checked that and I was surprised how many parse_events calls
> > we have in perf, so I went this way.. but I haven't really tried it,
> > so it might look actually etter despite the many places we need to change,
> > I'll try
>
> Thanks! My admitedly unchecked thinking is that most places will just
> pass NULL, only the test case will pass it, right?

I changed that per Ian's suggestion and it looks better,
so I'll post it in v2

jirka