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 BE780C433F5 for ; Thu, 23 Dec 2021 07:48:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347230AbhLWHs0 (ORCPT ); Thu, 23 Dec 2021 02:48:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242786AbhLWHri (ORCPT ); Thu, 23 Dec 2021 02:47:38 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A775C06139E for ; Wed, 22 Dec 2021 23:47:22 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id w5-20020a25ac05000000b005c55592df4dso8705200ybi.12 for ; Wed, 22 Dec 2021 23:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=9MlO9Oc0ygtrZ/h2HPcbPSvrjEKGPTLy8AFmEb58PdQ=; b=QRvmyQ7dNLCCzxTek5kADkOOAY1TOzPPY4YUro9+3bnIA71ybO6VL5mpwQ6+/AL4L+ +zMCRVNebJJT5zqf6Yhn8uShyaZQ/cxf/tPjzhJW+Wdzf2pPo4NoDt5YepVxJVilRkrR ZHs5n+0bWa1l44WmXtzMjOlnGG5QGZnZIoD78fi5t1pgjG5BJWi2UU/no+TZAkOrLJ6B FuNamVbKccv1PslUXtsBRmAN/MlvwCWvfCQV6aqkZk5l47leYhjWcHwpqnFpq/o6MIOk OJn51HpK8ss0QhHvm4As8UTzqJJmykWjG7nWNwHZ8kCqRihirym89DRfneUF43B15U5M gY8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=9MlO9Oc0ygtrZ/h2HPcbPSvrjEKGPTLy8AFmEb58PdQ=; b=yhqTSQh7LaIFv01vt9c3ENiYgo3vXD3tFCHzWU8Ew3Y4mFApWD6LQ2Cw/HvmvZR8Ct jZfdcEwUG2cC9ubWjYbz3AoRYpAaP1ZktePMRCukYUqAcdE1q5SZO4W0xjlNKceosgUb 4MHIhMUOGray/l+TuELduJumhznILpJhmO/RiDFR3K3+LWv8i5C/1M/cUmvlRBZui/+f c+AiJjXqqz/Boq58pohMz2miuCoAuJNPOoenSXieQRKFSUchiZ8d9H9m7dIMDzhX8uag eKwLSz1pFu9Mer3AlS7ntXB+AZLvNlwGPyKAMdySwy5F7R3hDIWbeNO1y0gc2NaZKFJj coEQ== X-Gm-Message-State: AOAM531TGSVZ+XiC25MUks07dku9JTT/2ZenhQuC7b6V57wLyZd7aNJE Qo4F8awFBkLtC46nUDRwcxn3gCxXcbOX X-Google-Smtp-Source: ABdhPJw+xZ/j9KPjaoan9KyhnSh4c7HwSNgk0Z8l1o/khlbiifft972N8n40w8o6xk7NCchdOZ7J2Vjb8AI2 X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:4fef:90ff:589d:24ca]) (user=irogers job=sendgmr) by 2002:a25:aaaa:: with SMTP id t39mr1542314ybi.201.1640245641771; Wed, 22 Dec 2021 23:47:21 -0800 (PST) Date: Wed, 22 Dec 2021 23:45:22 -0800 In-Reply-To: <20211223074541.3318938-1-irogers@google.com> Message-Id: <20211223074541.3318938-30-irogers@google.com> Mime-Version: 1.0 References: <20211223074541.3318938-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.307.g9b7440fafd-goog Subject: [PATCH v2 29/48] perf counts: Switch name cpu to cpu_map_idx From: Ian Rogers To: Andi Kleen , Jiri Olsa , Namhyung Kim , John Garry , Kajol Jain , "Paul A . Clarke" , Arnaldo Carvalho de Melo , Riccardo Mancini , Kan Liang , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh , James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: eranian@google.com, Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Try to reduce confusion in particular when the cpu map doesn't contain an entry for every CPU. Signed-off-by: Ian Rogers --- tools/perf/util/counts.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/counts.h b/tools/perf/util/counts.h index 3e275e9c60d1..5de275194f2b 100644 --- a/tools/perf/util/counts.h +++ b/tools/perf/util/counts.h @@ -18,21 +18,21 @@ struct perf_counts { static inline struct perf_counts_values* -perf_counts(struct perf_counts *counts, int cpu, int thread) +perf_counts(struct perf_counts *counts, int cpu_map_idx, int thread) { - return xyarray__entry(counts->values, cpu, thread); + return xyarray__entry(counts->values, cpu_map_idx, thread); } static inline bool -perf_counts__is_loaded(struct perf_counts *counts, int cpu, int thread) +perf_counts__is_loaded(struct perf_counts *counts, int cpu_map_idx, int thread) { - return *((bool *) xyarray__entry(counts->loaded, cpu, thread)); + return *((bool *) xyarray__entry(counts->loaded, cpu_map_idx, thread)); } static inline void -perf_counts__set_loaded(struct perf_counts *counts, int cpu, int thread, bool loaded) +perf_counts__set_loaded(struct perf_counts *counts, int cpu_map_idx, int thread, bool loaded) { - *((bool *) xyarray__entry(counts->loaded, cpu, thread)) = loaded; + *((bool *) xyarray__entry(counts->loaded, cpu_map_idx, thread)) = loaded; } struct perf_counts *perf_counts__new(int ncpus, int nthreads); -- 2.34.1.307.g9b7440fafd-goog