Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbbGBQIP (ORCPT ); Thu, 2 Jul 2015 12:08:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753550AbbGBQII (ORCPT ); Thu, 2 Jul 2015 12:08:08 -0400 Date: Thu, 2 Jul 2015 18:08:03 +0200 From: Jiri Olsa To: "acme@kernel.org" Cc: "Liang, Kan" , "jolsa@kernel.org" , "ak@linux.intel.com" , "namhyung@kernel.org" , "eranian@google.com" , "Hunter, Adrian" , "dsahern@gmail.com" , "a.p.zijlstra@chello.nl" , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 2/2] perf,tools: check and re-organize evsel cpu maps Message-ID: <20150702160803.GA19742@krava.brq.redhat.com> References: <1435607735-6332-1-git-send-email-kan.liang@intel.com> <1435607735-6332-2-git-send-email-kan.liang@intel.com> <20150630121428.GF25631@krava.brq.redhat.com> <37D7C6CF3E00A74B8858931C1DB2F07701883578@SHSMSX103.ccr.corp.intel.com> <20150630135449.GB2789@krava.brq.redhat.com> <20150630144225.GD5888@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150630144225.GD5888@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1507 Lines: 39 On Tue, Jun 30, 2015 at 11:42:25AM -0300, acme@kernel.org wrote: > 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? it's done within perf_evlist__create_maps.. checking the v2 jirka > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/