Message ID | 20211230072030.302559-32-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 E27D9C433F5 for <linux-arm-kernel@archiver.kernel.org>; Thu, 30 Dec 2021 07:45:25 +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=fS+8qBiEnMcV4CCtH9m9FD8oC8U4nfVs5H7hbrAPKXw=; b=rlrtYu1HBo2BWzREIDZJHaVg1q PVYURRyfMB+3ZAg13zVc/AjOTRhQuAZUEn9BdkdDCZHUN2Bc9ukCSv4DFD/uKsoPJ7n2MC90fBiqt 6q7XBaMQLWauV/6gEvAqYJ2+xzqUOBc39QATqvOOOk2+kBQyWL5w7Um8SKAgmzG8VShTr3jg32Ll9 nKiyVHmZGF774SUcvgvHCqmqyilHZhBxHeXAtgSMLqpeSRJSlJcwgoBzyKbYoIlec9z3fLyquEXim PWDk0LNBQ17YkY+3WY5nfKvvAYXfQQw6uRov6a3kHQsPtvB/V2OTSVVrNcx9n+22rcULGyaGJd/BV n+BZ4qNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2q6S-003rxh-1u; Thu, 30 Dec 2021 07:44:01 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2pl5-003k1W-HD for linux-arm-kernel@lists.infradead.org; Thu, 30 Dec 2021 07:21:56 +0000 Received: by mail-pj1-x1049.google.com with SMTP id y13-20020a17090a134d00b001b10368d9dcso15238482pjf.7 for <linux-arm-kernel@lists.infradead.org>; Wed, 29 Dec 2021 23:21:54 -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=ewN6TgeYhi7NNspT4fCbrjPDfPPrcTRTO0RxDMRaTEI=; b=INzSbn3pkxSj2o5rY/D2ZDHKiMG80XuFQV1LdJh951/si0ZNvb2AQ/U8J01hhPUcip O4YIgbs5JOUpysdzNjoTE+e1bYWE0QhhGSrmhekuQLSyeuXFeLNHRXgLI6z5rORfe5rL /JvOaK/8/+nxPMe0QcNX43yTndBbtabg8tnrfCR/xKmAEjc7/ntldHYPidBQCpYhqt9W eVMXK0k8df5ymmhFgydv9CnHZlVm96sEswqhFAkTfdlbT0ZrUgJjDaNfKoGWhUEMcjDK KNPzlUm1D0bTZFwRjNxXU4vt3u9OIFi+YN5QgSJFbl/uEQRFxIH4JUviryG9zXNqoalp /1BA== 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=ewN6TgeYhi7NNspT4fCbrjPDfPPrcTRTO0RxDMRaTEI=; b=NzcJRXhuXjm7ZZ9bEdGF4RPvQ16i/4KWs6gJHOCvNUFDiYXKhAAN49RT9tk23k0OKI UDp6WQ/NLqkrEgYBFHgD0Z+On89Z7HJ42WjjLaCtNpDIIVwhiU9PG2IkOKAEhe3pAMPg jCHoU5GJdzjyYRsqnWSRfh4v9Ol4wW42DGaLYTfGdNwmtd3pjLDZdiUh8thyogA9D3dD n7V3o9tpfE+DVWeH1iDgi9d7WDWtAArSAkYCYIWCQc9XXJv9aaGxW2YRCBQSQdgbCEm9 tUioZgqVCAs8M9MBvDaGtVGm7bnnoTD8Y3Zs/5n1fqolTaiQxg66RtOGzeyN0VlSmbyM ERyg== X-Gm-Message-State: AOAM531nITL4JrSOfM0ExKoPyuuuaNb7LQ3FPUMdCvAfDTOESqWWGuGC VkF7CNk0YQ29bQM/w8OIwPUqCtVr2ZJl X-Google-Smtp-Source: ABdhPJxwC04VkqtH3R7KdDCbDUTQi3SLQnP/SiPOIZUMZfH2icNrN1mdP2zY7pRXNCkZkVNGG4IDRp1xSH3H X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:31c4:9539:dba1:a82b]) (user=irogers job=sendgmr) by 2002:a17:90a:638a:: with SMTP id f10mr36302623pjj.187.1640848913549; Wed, 29 Dec 2021 23:21:53 -0800 (PST) Date: Wed, 29 Dec 2021 23:20:12 -0800 In-Reply-To: <20211230072030.302559-1-irogers@google.com> Message-Id: <20211230072030.302559-32-irogers@google.com> Mime-Version: 1.0 References: <20211230072030.302559-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog Subject: [PATCH v3 30/48] perf stat: Rename aggr_data cpu to imply it's an index 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, zhengjun.xing@intel.com 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-20211229_232155_612521_1F812683 X-CRM114-Status: GOOD ( 12.94 ) 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/stat-display.c b/tools/perf/util/stat-display.c index f48d1678861c..7e933a8fee68 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -626,7 +626,7 @@ struct aggr_data { u64 ena, run, val; struct aggr_cpu_id id; int nr; - int cpu; + int cpu_map_idx; }; static void aggr_cb(struct perf_stat_config *config, @@ -878,9 +878,9 @@ static void counter_cb(struct perf_stat_config *config __maybe_unused, { struct aggr_data *ad = data; - ad->val += perf_counts(counter->counts, ad->cpu, 0)->val; - ad->ena += perf_counts(counter->counts, ad->cpu, 0)->ena; - ad->run += perf_counts(counter->counts, ad->cpu, 0)->run; + ad->val += perf_counts(counter->counts, ad->cpu_map_idx, 0)->val; + ad->ena += perf_counts(counter->counts, ad->cpu_map_idx, 0)->ena; + ad->run += perf_counts(counter->counts, ad->cpu_map_idx, 0)->run; } /* @@ -897,7 +897,7 @@ static void print_counter(struct perf_stat_config *config, struct aggr_cpu_id id; for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { - struct aggr_data ad = { .cpu = cpu }; + struct aggr_data ad = { .cpu_map_idx = cpu }; if (!collect_data(config, counter, counter_cb, &ad)) return;
Trying to make cpu maps less error prone. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/stat-display.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)