From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755527AbbIHOcy (ORCPT ); Tue, 8 Sep 2015 10:32:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41395 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755049AbbIHOcV (ORCPT ); Tue, 8 Sep 2015 10:32:21 -0400 Date: Tue, 8 Sep 2015 11:32:25 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Adrian Hunter , mingo@kernel.org, kan.liang@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 07/14] perf tools: Add evsel->own_cpus Message-ID: <20150908143225.GE2435@redhat.com> References: <1441636076-31390-1-git-send-email-adrian.hunter@intel.com> <1441636076-31390-8-git-send-email-adrian.hunter@intel.com> <20150908064508.GA20530@krava.brq.redhat.com> <55EE8996.3010608@intel.com> <20150908073854.GB2038@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150908073854.GB2038@krava.brq.redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.20 (2009-12-10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Sep 08, 2015 at 09:38:54AM +0200, Jiri Olsa escreveu: > On Tue, Sep 08, 2015 at 10:09:10AM +0300, Adrian Hunter wrote: > > On 08/09/15 09:45, Jiri Olsa wrote: > > > On Mon, Sep 07, 2015 at 05:27:49PM +0300, Adrian Hunter wrote: > > >> +++ b/tools/perf/util/evlist.c > > >> @@ -1111,9 +1111,12 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist) > > >> * We already have cpus for evsel (via PMU sysfs) so > > >> * keep it, if there's no target cpu list defined. > > >> */ > > >> - if (!evsel->cpus || evlist->has_user_cpus) { > > >> + if (!evsel->own_cpus || evlist->has_user_cpus) { > > >> cpu_map__put(evsel->cpus); > > >> evsel->cpus = cpu_map__get(evlist->cpus); > > >> + } else if (evsel->cpus != evsel->own_cpus) { > > >> + cpu_map__put(evsel->cpus); > > >> + evsel->cpus = cpu_map__get(evsel->own_cpus); > > > > > > hum, so (evsel->cpus != evsel->own_cpus) could happen only when: > > > - evsel->own_cpus != NULL > > > - we overloaded evsel->cpus with evlist->cpus via perf_evlist__propagate_maps > > > - we changed evlist->has_user_cpus = false > > > - we recall perf_evlist__propagate_maps > > > I'm missing usecase for that, or something else ;-) > > That's true but the idea is to establish rules (invariants) that are always > > true. Like an evsel either has its own cpu map or the same as the evlist. > ook, jirka Yup, I haven't even looked at the code that much, but at least Adrian's explanation matches my expectations 8-) - Arnaldo