Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4367195rdh; Tue, 28 Nov 2023 22:03:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEG0p4Nfr7wLqM9P+ZpxISkmkCqL+LK2H5zobE3iX0GH5kNyroMGJMkTvNz6sXuaeuxMVFV X-Received: by 2002:a17:903:2292:b0:1cf:ba9d:abc0 with SMTP id b18-20020a170903229200b001cfba9dabc0mr15407760plh.67.1701237806712; Tue, 28 Nov 2023 22:03:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701237806; cv=none; d=google.com; s=arc-20160816; b=eANS9gK9tYk2Nqta1cj0iQ8XneZChfWkDBHQBaiLS+KWKLofWuJ700t1SQZKz0q6iW M8jRXAGAdh/W8g5CRRtZLWx++LKYJW4JS5kQvVtdNcCaainj140/LGe6wvGyYQmNN2KL tPitKWyMR6BY65n9u2ihDVQYZqvSPQIAhBFtg8ztjZZEPdkSO8NSTp3ngYCegaAB+nEx aYG1j0mLat+uS2PfBUU5fYV8AwNLYHl1A8TgCHsjOVPzZRnPecq7Cz/6KvGnJKh/+6Vx w37uKY2llyl0l7io7BmKisHPEXpYY9KnMp1MAONc5xa/FgAWz+yn5Al+6Eua9oAQot+R uiVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=hx1FXofSm6/tFgZiy1TvVwbEYJz6ssRcV+dGOMGcvW0=; fh=uYKNI4aCUAMYZ/8oQVBIse94GgoxWIIZr1zaTbrWG7c=; b=DWVmabyEk0tV6u8daMkHMJT/ZQuJQWucviRg5/Sxfeb1RzfhLSeDtBfdD1xWQJlS3j zlIHaCRR15/3G+03bhKvCrHZiF8MiLFwJ2a3U37JUbvf8LiIGocpjtybA0hyy92SXLb8 03u1DveLWY+Eo/7vAcohs2XIhyE1l8yvxqKNQWmUGM7ml+llUOtdyv71YPL/IwZcjM/4 9UkBt3ioTm3X3mxMOed7ZYs2pE1mYjzlsPgOiBlUnazLdFmrIqX8xYT/iliX1FwTAOjK E3aL8ulRwlZyPpVz4oO7/VEKcMJBOCJJvxk/di5whQn6G1x7oENv7uTFLoCXwLVKFhz+ SumA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cZfJJGiR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f11-20020a170902ce8b00b001cfb971ee07si8669302plg.165.2023.11.28.22.03.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 22:03:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=cZfJJGiR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A95FF81EB464; Tue, 28 Nov 2023 22:03:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377035AbjK2GDD (ORCPT + 99 others); Wed, 29 Nov 2023 01:03:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377001AbjK2GCh (ORCPT ); Wed, 29 Nov 2023 01:02:37 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4978B19BB for ; Tue, 28 Nov 2023 22:02:44 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5ca26c07848so98507307b3.0 for ; Tue, 28 Nov 2023 22:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701237763; x=1701842563; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=hx1FXofSm6/tFgZiy1TvVwbEYJz6ssRcV+dGOMGcvW0=; b=cZfJJGiRnIlA8GdwUq/oU0RlrfPGoiItm5nZ2HcpyvEr4tVzQOY/2hl5ZythbdT+xr v3AT9s/llHVuRpVJRf7Qc/GqfPYyTA/X0nQKUlk/EK/NhDAagPZrdlyhQMNNwe9g2O/9 c8Npi68QpzjfSqfMeQRSSnGhfireqB4MBtCNovKGuweTbegohaaKkD1ojALt55jSmJGJ GwQweBtlnxWbsutlbZYItnHsP5w+mfkrq9M2F28Pv9trvcBGUNsbxJaPDjxRT3TtBDM0 wnYjHsPC/wcRG6vtupUxyTAVL94FpTEL4H5JYlC1kVBOwjuC7ey/JUUOFU4vpztW5QA8 iRbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701237763; x=1701842563; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hx1FXofSm6/tFgZiy1TvVwbEYJz6ssRcV+dGOMGcvW0=; b=uxoiKuy3B1h95rt3Wf/pjKh1o4FCC02hhp0cKfA2KHTaB6AVRR+ufgEzooKib/Znln C/R4eVrTbXoyGPHA5zSUYgqFPmVNbUq1mdRuGYKXAUFzP62aLedewnRT6BjE+PFfcDF4 Ecj2glVx1CfMGb+VkYfN2U2uquVUw++he5Z8kDjT81P7R0UXrgNHMHdRPh4zl3UPhmZg CO/R2uMiFAy//eDCw/FpvHhoOKK07YW7mRif9dYRKCzTFSfu93zjhiVqaHLq09T+PiU0 8/nopK72gCAH6AnMYcu65lJc6JM+8iSG6D+XSchBSUWIzZI/OeENb6MOKLpard0pbV7L Rfgw== X-Gm-Message-State: AOJu0Yxno9oeX6nLhQ1gvzcBlkDPwosM4rKA80GGaWVOdjvtNJU/bFk0 minYwkjbJPhlwov/LuzAWFh1dF4QatfV X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:763b:80fa:23ca:96f8]) (user=irogers job=sendgmr) by 2002:a05:690c:2f0d:b0:5cb:e3c9:ca22 with SMTP id ev13-20020a05690c2f0d00b005cbe3c9ca22mr465449ywb.7.1701237763521; Tue, 28 Nov 2023 22:02:43 -0800 (PST) Date: Tue, 28 Nov 2023 22:02:09 -0800 In-Reply-To: <20231129060211.1890454-1-irogers@google.com> Message-Id: <20231129060211.1890454-13-irogers@google.com> Mime-Version: 1.0 References: <20231129060211.1890454-1-irogers@google.com> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Subject: [PATCH v1 12/14] perf stat: Remove duplicate cpus_map_matched function From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , John Garry , Will Deacon , Thomas Gleixner , Darren Hart , Davidlohr Bueso , "=?UTF-8?q?Andr=C3=A9=20Almeida?=" , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 22:03:21 -0800 (PST) Use libperf's perf_cpu_map__equal that performs the same function. Signed-off-by: Ian Rogers --- 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. */ -- 2.43.0.rc1.413.gea7ed67945-goog