Message ID | 20211223074541.3318938-30-irogers@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71F2CC433F5 for <linux-arm-kernel@archiver.kernel.org>; Thu, 23 Dec 2021 08:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=O3lcy4P7+0F8DL6EopH+S9AiAyAdeA4xwjVkDqK8dDc=; b=bM1Hy1M7P/3AP6MHbUNDVFFQJU kxY23gXg7ognU0huyBuRB2LEf3wBeo/EWxjBSSxev6vEG3ctjp8arqVSpBIpKLUGZoxzs+3mDuIJT d3KVcJ3KQ4bQI5vfL8iPjbr9OvSOaT1gPoPoQT365EATxHkm0TMxq/e6XLlZqqkpftTtx8oqF0ypY +/ePECzC+NpWtq9vZa/xLB+76lUblbBDNSMdYAIQbsqE4RNUXr+bMqeB1F9iYVqemUSJ29DVNRUoY lyL1rlIr58zWDO1zdPf+s5pKqEFvuAB8s0IyonZDOcR0ruq93wXcLCyczt1ChXF78WcThGbjIVxAx uOM0zMrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0J9s-00C851-1t; Thu, 23 Dec 2021 08:09:07 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Iot-00Bzvf-Ec for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 07:47:24 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id d205-20020a251dd6000000b0060977416ad4so8517030ybd.16 for <linux-arm-kernel@lists.infradead.org>; 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=tJVavLrttpCJ1u8flafI5Mc2d6yPM1T9GeU7h/DAFZjIbA+NYnuIJmC8yJ/h/vFkp1 EV44tDYhdPzM4W/dXSydAydTb1mLjVoNXBxAzM6ie1gPSpUTFSd7B0lGMahvs1mefMcv aM4bMk4xOImDh4RqangGxF9bLKMSNY1VpsIdAYVTRSzKZJUF+Go3bm0TqOR8cWgRTNlo 670nWpCtmN0C5ejFlf81XQuaMiX3KaTKltfbC55nCj5RoGEOsN0K3tpXA1Xx/plPvKgk y1Zd97ik0Mfc96iKabsYGma2ngOb+z8USA11xLgQnx6ReQDPdU6eUPLU8e6Yk+c3tb9b BF2g== X-Gm-Message-State: AOAM531hVuzj+ZGHvZoDZHYgxId8m1u8PrIY8qQrbIFUG0SGHq0khJLw 9d+zwLvzzrZNvULp6iIHK7f2ba3vW7o4 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 <irogers@google.com> To: Andi Kleen <ak@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>, John Garry <john.garry@huawei.com>, Kajol Jain <kjain@linux.ibm.com>, "Paul A . Clarke" <pc@us.ibm.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Riccardo Mancini <rickyman7@gmail.com>, Kan Liang <kan.liang@linux.intel.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Singh <vineet.singh@intel.com>, James Clark <james.clark@arm.com>, Mathieu Poirier <mathieu.poirier@linaro.org>, Suzuki K Poulose <suzuki.poulose@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: eranian@google.com, Ian Rogers <irogers@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_234723_529417_F73C78FF X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Refactor perf cpumap
|
expand
|
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);
Try to reduce confusion in particular when the cpu map doesn't contain an entry for every CPU. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/counts.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)