Re: [PATCH 04/11] perf, tools: Support per pmu json aliases

From: Andi Kleen
Date: Wed Jan 18 2017 - 19:21:22 EST


> > index 8bffe99d8e3f..4bfc98953aba 100644
> > --- a/tools/perf/util/pmu.c
> > +++ b/tools/perf/util/pmu.c
> > @@ -587,14 +587,13 @@ static struct perf_pmu *pmu_lookup(const char *name)
> > if (pmu_format(name, &format))
> > return NULL;
> >
> > - if (pmu_aliases(name, &aliases))
> > + if (pmu_type(name, &type))
> > return NULL;
> >
> > - pmu_add_cpu_aliases(&aliases, name);
> > -
> > - if (pmu_type(name, &type))
> > + if (pmu_aliases(name, &aliases))
> > return NULL;
> >
> > + pmu_add_cpu_aliases(&aliases, name);
>
> AFAICS you switched the calls.. how does it matter?

It avoids lots of duplicate messages with -v (and also is more efficient)

-Andi