From nobody Mon Dec 29 11:19:08 2025 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 6C50AC4167B for ; Wed, 29 Nov 2023 06:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234939AbjK2GDF (ORCPT ); Wed, 29 Nov 2023 01:03:05 -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-Google-Smtp-Source: AGHT+IFkHheFXSho6uLG11gC+NuzV7oPEGtX6gzG3KyX8XN+0sHsL9fCMoG1bThASPDwSTf3YxUPIjvReV9+ 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D { .iostat_run =3D false, }; =20 -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) !=3D perf_cpu_map__nr(b->core.cpus)) - return false; - - for (int i =3D 0; i < perf_cpu_map__nr(a->core.cpus); i++) { - if (perf_cpu_map__cpu(a->core.cpus, i).cpu !=3D - 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 =3D NULL; @@ -194,7 +174,7 @@ static void evlist__check_cpu_maps(struct evlist *evlis= t) /* Check that leader matches cpus with each member. */ if (leader =3D=3D evsel) continue; - if (cpus_map_matched(leader, evsel)) + if (perf_cpu_map__equal(leader->core.cpus, evsel->core.cpus)) continue; =20 /* If there's mismatch disable the group and warn user. */ --=20 2.43.0.rc1.413.gea7ed67945-goog