Re: [PATCH 2/2] perf,tools: check and re-organize evsel cpu maps

From: acme@xxxxxxxxxx
Date: Tue Jun 30 2015 - 10:42:43 EST


Em Tue, Jun 30, 2015 at 03:54:49PM +0200, Jiri Olsa escreveu:
> On Tue, Jun 30, 2015 at 01:42:49PM +0000, Liang, Kan wrote:
> > > > +static int perf_evlist__check_evsel_cpus(struct perf_evlist *evlist,
> > > > +struct perf_evsel *evsel) {
> > > > + const struct cpu_map *cpus = evlist->cpus;
> > > > + const int ncpus = cpu_map__nr(evlist->cpus);
> > > > + int j = 0, cpu_nr = 0, tmp = 0;
> > > > + int i;
> > > > +
> > > > + /* ensure we process id in increasing order */
> > > > + qsort(evlist->cpus->map, evlist->cpus->nr, sizeof(int), cmp_ids);
> > >
> > > wouldn't sorting maps affect some other code?
> > >
> >
> > I didn't find any bad effect after sorting the maps.
> > Any codes I need to check?
>
> I dont think so, but I'm not sure either.. thats why I asked ;-)
>
> I guess any code dealing with cpu maps.. it might affect
> perf stat output.. but it looks sorted now anyway ;-)
> I dont think it's an issue

Is this being done at cpu_map__new time, i.e. when we first parse it?

That way any assumption about repositioning gets out of the way.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/