From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22055C433EF for ; Wed, 4 May 2022 14:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343689AbiEDOTs (ORCPT ); Wed, 4 May 2022 10:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346912AbiEDOTr (ORCPT ); Wed, 4 May 2022 10:19:47 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52736BE2E; Wed, 4 May 2022 07:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651673771; x=1683209771; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=MWohxTGSYgiw+QLiiSWOsACclXShwViZvjP92qdVJmo=; b=mO3pgXA/k0owI8ahsvfx4y2Y5jwySnFahkLSqJt968yEFnPS8OyC43rx L7cj446ERnI9CMdHkGC5xxRas5aFpJq5ejo2m6YP/uBd8u2NdFAisyJ6n RlF/5+dw7MQuqvti391hhJSP3HiLYdaIP2uuBRmBRapH15vVgCjzNudXA nZIVay2R3yX5QLXv2GjuI2XO7FRNcxUPJ54+YMaeYqQYFEgeMNsF8Z0IN YYAzsDaxdgyDCih9PvixtqjeI7KL6rhAYdGtQmv1CeLEhFdJOODhWGJrQ nXLkrqxXuvHXdsASxLD036a/yXNifHPLDoXCQODFPHX7KTBsumJi68Nm5 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10337"; a="292966698" X-IronPort-AV: E=Sophos;i="5.91,198,1647327600"; d="scan'208";a="292966698" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 07:16:11 -0700 X-IronPort-AV: E=Sophos;i="5.91,198,1647327600"; d="scan'208";a="584757563" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.32.90]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 May 2022 07:16:02 -0700 Message-ID: <9e862a01-b955-70c0-25ae-2efc03f636bf@intel.com> Date: Wed, 4 May 2022 17:15:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.8.1 Subject: Re: [PATCH v5 2/6] perf evlist: Clear all_cpus before propagating Content-Language: en-US To: Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Kajol Jain , James Clark , German Gomez , Riccardo Mancini , Andi Kleen , Alexey Bayduraev , Alexander Antonov , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stephane Eranian References: <20220503041757.2365696-1-irogers@google.com> <20220503041757.2365696-3-irogers@google.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20220503041757.2365696-3-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On 3/05/22 07:17, Ian Rogers wrote: > all_cpus is merged into during propagation. Initially all_cpus is set > from PMU sysfs. perf_evlist__set_maps will recompute it and change > evsel->cpus to user_requested_cpus if they are given. If all_cpus isn't > cleared then the union of the user_requested_cpus and PMU sysfs values > is set to all_cpus, whereas just user_requested_cpus is necessary. To > avoid this make all_cpus empty prior to propagation. > > Signed-off-by: Ian Rogers Reviewed-by: Adrian Hunter > --- > tools/lib/perf/evlist.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/lib/perf/evlist.c b/tools/lib/perf/evlist.c > index a09315538a30..974b4585f93e 100644 > --- a/tools/lib/perf/evlist.c > +++ b/tools/lib/perf/evlist.c > @@ -59,6 +59,10 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist) > { > struct perf_evsel *evsel; > > + /* Recomputing all_cpus, so start with a blank slate. */ > + perf_cpu_map__put(evlist->all_cpus); > + evlist->all_cpus = NULL; > + > perf_evlist__for_each_evsel(evlist, evsel) > __perf_evlist__propagate_maps(evlist, evsel); > }