Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4568876rdb; Tue, 12 Dec 2023 03:28:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4isawM40oejO8UhvvkcU7p7JgRhyY5pj4Y3utTcnY8Xgz3WgnxLY7UD1i36L7UieZpTz+ X-Received: by 2002:a17:903:1104:b0:1d3:33b1:f57c with SMTP id n4-20020a170903110400b001d333b1f57cmr592870plh.28.1702380533973; Tue, 12 Dec 2023 03:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702380533; cv=none; d=google.com; s=arc-20160816; b=zmZ6BMd5NMwSiK2DrQ3xOlevxAcnlHtFJFtbFyOw6J7i9wL3pAMx0tI5eieeWyWDun YLzPyxrm7AR7XGN5FF4zF4a0Py2L947lcbRH/1TM5jkkobkps/Rvmhk4b6kMlvwWznbf c+WfzYS89z7rb0dbXsmLwkhFleczn4MhLkDckXGifLwyow4/UWMtk/dUGT+TC6BCDrHC jlJCzO5gKJ/5YDBTn8PKvKGQbvzUp9xinbD70sL2TRCgYoyutm4H/kT9pwm5FqwbYHZp RqkqPHAO/3YgOceRv9jgTQPv3GbkG59xUuo22/dj3hDlT2CSCD9ulSY+P48OwwbS4tsz mOXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=OJHDNd74ibzfhxlbfl5UHUVXnd8lmxAcLPSB7h1YmIg=; fh=5EP3x1uDWWBI9dywppNETb2J5CyUqdqYJErdwPGhe68=; b=yE3i/inBs/dpYQaNbkrOrosoDFn0NIhYt1Gzl7hvFYIfu2hTM3T8PymzyOryZ7tdjn /enYcAvjnQ97gAPE3CFyxczzeuZtMwbZTPHTMECZtI3FtKKpVdWEnWmnRjNxKAb0gHpH ur64uPPP0PT8XP/mTyYR4NTPy+3dwT+8vqDZ3yNqPdkRidU+aIJjyLcwO0+BnT9Ozi5j NxEqT9ElZ+a1+Vvv0NAdsRwmlYP1hGbBwtTFo1gp95SR//pSf4XF2C3cM7oQ2nDZEJZ9 xRkbUI74oon0/5ebE2hXtbZU3b1yzU/DbwX0SIGgVn/R+K0M3FqB/yIjahNcGsetVziR 2DbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t12-20020a170902a5cc00b001d049eca370si7409947plq.589.2023.12.12.03.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 03:28:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8C8318056A33; Tue, 12 Dec 2023 03:28:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346286AbjLLL20 (ORCPT + 99 others); Tue, 12 Dec 2023 06:28:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346266AbjLLL2Z (ORCPT ); Tue, 12 Dec 2023 06:28:25 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 85D6CB8; Tue, 12 Dec 2023 03:28:31 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 918C7143D; Tue, 12 Dec 2023 03:29:17 -0800 (PST) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A0333F762; Tue, 12 Dec 2023 03:28:26 -0800 (PST) Message-ID: <1c5494f7-960e-07e9-eb8c-6c9dd8405004@arm.com> Date: Tue, 12 Dec 2023 11:28:22 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v1 12/14] perf stat: Remove duplicate cpus_map_matched function Content-Language: en-US To: Ian Rogers References: <20231129060211.1890454-1-irogers@google.com> <20231129060211.1890454-13-irogers@google.com> Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , Thomas Gleixner , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=c3=a9_Almeida?= , Kan Liang , K Prateek Nayak , Sean Christopherson , Paolo Bonzini , Kajol Jain , Athira Rajeev , Andrew Jones , Alexandre Ghiti , Atish Patra , "Steinar H. Gunderson" , Yang Jihong , Yang Li , Changbin Du , Sandipan Das , Ravi Bangoria , Paran Lee , Nick Desaulniers , Huacai Chen , Yanteng Si , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org From: James Clark In-Reply-To: <20231129060211.1890454-13-irogers@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 03:28:51 -0800 (PST) On 29/11/2023 06:02, Ian Rogers wrote: > Use libperf's perf_cpu_map__equal that performs the same function. > > Signed-off-by: Ian Rogers > --- Reviewed-by: James Clark > tools/perf/builtin-stat.c | 22 +--------------------- > 1 file changed, 1 insertion(+), 21 deletions(-) > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > index f583027a0639..8e2f90b5c276 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -164,26 +164,6 @@ static struct perf_stat_config stat_config = { > .iostat_run = false, > }; > > -static bool cpus_map_matched(struct evsel *a, struct evsel *b) > -{ > - if (!a->core.cpus && !b->core.cpus) > - return true; > - > - if (!a->core.cpus || !b->core.cpus) > - return false; > - > - if (perf_cpu_map__nr(a->core.cpus) != perf_cpu_map__nr(b->core.cpus)) > - return false; > - > - for (int i = 0; i < perf_cpu_map__nr(a->core.cpus); i++) { > - if (perf_cpu_map__cpu(a->core.cpus, i).cpu != > - perf_cpu_map__cpu(b->core.cpus, i).cpu) > - return false; > - } > - > - return true; > -} > - > static void evlist__check_cpu_maps(struct evlist *evlist) > { > struct evsel *evsel, *warned_leader = NULL; > @@ -194,7 +174,7 @@ static void evlist__check_cpu_maps(struct evlist *evlist) > /* Check that leader matches cpus with each member. */ > if (leader == evsel) > continue; > - if (cpus_map_matched(leader, evsel)) > + if (perf_cpu_map__equal(leader->core.cpus, evsel->core.cpus)) > continue; > > /* If there's mismatch disable the group and warn user. */