lkml.org 
[lkml]   [2015]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/2] perf,tools: check and re-organize evsel cpu maps
On Tue, Jun 30, 2015 at 01:42:49PM +0000, Liang, Kan wrote:
>
>
> > > diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index
> > > 6cfdee6..f179379 100644
> > > --- a/tools/perf/util/evlist.c
> > > +++ b/tools/perf/util/evlist.c
> > > @@ -1101,6 +1101,71 @@ int perf_evlist__mmap(struct perf_evlist
> > *evlist, unsigned int pages,
> > > return perf_evlist__mmap_ex(evlist, pages, overwrite, 0, false); }
> > >
> > > +static int cmp_ids(const void *a, const void *b) {
> > > + return *(int *)a - *(int *)b;
> > > +}
> > > +
> > > +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

jirka


\
 
 \ /
  Last update: 2015-06-30 16:21    [W:0.053 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site