From: Jiri Olsa <jolsa@redhat.com>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: "acme@kernel.org" <acme@kernel.org>,
"jolsa@kernel.org" <jolsa@kernel.org>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"namhyung@kernel.org" <namhyung@kernel.org>,
"eranian@google.com" <eranian@google.com>,
"Hunter, Adrian" <adrian.hunter@intel.com>,
"dsahern@gmail.com" <dsahern@gmail.com>,
"a.p.zijlstra@chello.nl" <a.p.zijlstra@chello.nl>,
"mingo@redhat.com" <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] perf,tools: check and re-organize evsel cpu maps
Date: Tue, 30 Jun 2015 15:54:49 +0200 [thread overview]
Message-ID: <20150630135449.GB2789@krava.brq.redhat.com> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07701883578@SHSMSX103.ccr.corp.intel.com>
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
next prev parent reply other threads:[~2015-06-30 13:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-29 19:55 [PATCH 1/2] perf,tools: get correct cpu id for print_aggr kan.liang
2015-06-29 19:55 ` [PATCH 2/2] perf,tools: check and re-organize evsel cpu maps kan.liang
2015-06-30 12:14 ` Jiri Olsa
2015-06-30 13:42 ` Liang, Kan
2015-06-30 13:54 ` Jiri Olsa [this message]
2015-06-30 14:42 ` acme
2015-07-02 16:08 ` Jiri Olsa
2015-06-30 15:52 ` Stephane Eranian
2015-06-30 16:45 ` Liang, Kan
2015-07-02 16:10 ` Jiri Olsa
2015-06-30 6:46 ` [PATCH 1/2] perf,tools: get correct cpu id for print_aggr Jiri Olsa
2015-06-30 13:24 ` Liang, Kan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150630135449.GB2789@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®