Message ID | 20220105061351.120843-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 A62A1C433EF for <linux-arm-kernel@archiver.kernel.org>; Wed, 5 Jan 2022 06:40:44 +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=70GdaOTsZt/oEHIKE2K7vtDRHtP93GPT3hqy7yFpGuQ=; b=4BCIHCJc2VEishANOhkfcBnAro o14biSvpSmP8v5FsLg/ah1e4ZQvbsROvGXEcUlQmgiQP9Otk+LJBDUX4+ftWPhjaNX+PUapoAOICf cn1KKdu+Jgg/9FsRN4XnvB4oQ9JIbufHz+Lgj+VSwzaY/I214AJ05iwOoTVxd9+xiHc8GOedUgtAN 6unWXu3Tr+UpIe1XGFzqUJrXJ1xrIogDPt0/r8akRYKzCA7D0HJytKlGHf3CsLUFpkyEJ3ECV4+Hn PrufDxdKFaYOtfhbuUJpUmsu1dL4HPrpR8c8C4a/P5zxCluCo6QZwb9VcLUur316EFYhvMYEIroXY hG+4cmLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n4zwz-00Dph8-6k; Wed, 05 Jan 2022 06:39:11 +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 1n4zZs-00DgF5-AW for linux-arm-kernel@lists.infradead.org; Wed, 05 Jan 2022 06:15:17 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id s127-20020a252c85000000b0060be2b7b8e9so53249793ybs.8 for <linux-arm-kernel@lists.infradead.org>; Tue, 04 Jan 2022 22:15:15 -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=cJxFT+Wieuw1JhmOKv6vMYAg7VBOnu+0BYOqRINi2fw=; b=GY4V9f2WtfCAOmHqpJBCqaE/DJ4FJtSTe+IVPCFmccXWe49Vv0FjqmefOnmUwI23+W jq3PcHHD6BViFF3wUo+pGethaE9NU3tyo+Rnf9lMyIhXZblYiEu5txW2DngMfAqoBPb8 W2R2n/KYV+jkKtzaxPIPs4RLpYBE9KgOLZ/gS311i/+YCLZwZT95M4M1Ff811MZJ6exW ux+EflSLc6zan/QxZAJ0AZt+gcDD5ofVL+kzUjhXTaw4tPjiLx+ZYwChn0F+Bpd28eaB NnTbohPifYf7x7C6W6LqrboGsVyq+f2Ssm2vPiq5ZDU1OCpVRMHr+aP0iKZeE8qls+Cv LnBA== 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=cJxFT+Wieuw1JhmOKv6vMYAg7VBOnu+0BYOqRINi2fw=; b=R+hBEc+9nNJJ9JMrvolshVekjpcxp2n72boBvWLqilAlVjDb2YK/jM0KWddaHYCXnL tqGc3jRzhUGEeAIjSLB5M9y3ulC4YT8DfdZDsIFrJ0GDx5QGgB5K2n8BdKeJljSrXBpx xUvCFNIxtKM4qbOa8wSSarJJt8wbdaKoZPM5wNlWdKti3+M9BJjOQvNaLVh6jzhh34Or tlNy+RKkSm5nxHjTwzTLeoiZ8IFUqdTMnbstEOJ2tSxT2KZm5Y3Sj16UItND8h8tTiul vFF4YsczSGiFSvEyvL1MAChrlxP4Z2AWhraw34rCsP9seN9/LlYsioGaxq2sveVk1iep mJmQ== X-Gm-Message-State: AOAM530O/hsEhztQlgsc1za1ucKCAsT3banTDEhiRYr9yxTiV0wbnSoH KNg7+M7fmyt5EOeLl5K57/0w7jRemRpJ X-Google-Smtp-Source: ABdhPJz6BllTP+8MyBqztKvpwQ5+7lh8jn7/LAXMClEP1dR7F0dfNkdd6z0dxvFXLKRs8hhzihx5lUCGaFjr X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3af1:caef:2937:5d2b]) (user=irogers job=sendgmr) by 2002:a25:dbc8:: with SMTP id g191mr22901094ybf.623.1641363314707; Tue, 04 Jan 2022 22:15:14 -0800 (PST) Date: Tue, 4 Jan 2022 22:13:34 -0800 In-Reply-To: <20220105061351.120843-1-irogers@google.com> Message-Id: <20220105061351.120843-32-irogers@google.com> Mime-Version: 1.0 References: <20220105061351.120843-1-irogers@google.com> X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog Subject: [PATCH v4 31/48] perf stat: Use perf_cpu_map__for_each_cpu 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-20220104_221516_393569_2A2B37B7 X-CRM114-Status: GOOD ( 13.18 ) 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 7e933a8fee68..0f192360b6c6 100644 --- a/tools/perf/util/stat-display.c +++ b/tools/perf/util/stat-display.c @@ -4,6 +4,7 @@ #include <linux/string.h> #include <linux/time64.h> #include <math.h> +#include <perf/cpumap.h> #include "color.h" #include "counts.h" #include "evlist.h" @@ -732,7 +733,7 @@ static void print_aggr(struct perf_stat_config *config, evlist__for_each_entry(evlist, counter) { print_counter_aggrdata(config, counter, s, prefix, metric_only, - &first, -1); + &first, /*cpu=*/-1); } if (metric_only) fputc('\n', output); @@ -893,11 +894,11 @@ static void print_counter(struct perf_stat_config *config, FILE *output = config->output; u64 ena, run, val; double uval; - int cpu; + int idx, cpu; struct aggr_cpu_id id; - for (cpu = 0; cpu < evsel__nr_cpus(counter); cpu++) { - struct aggr_data ad = { .cpu_map_idx = cpu }; + perf_cpu_map__for_each_cpu(cpu, idx, evsel__cpus(counter)) { + struct aggr_data ad = { .cpu_map_idx = idx }; if (!collect_data(config, counter, counter_cb, &ad)) return; @@ -1248,7 +1249,7 @@ static void print_percore(struct perf_stat_config *config, print_counter_aggrdata(config, counter, s, prefix, metric_only, - &first, -1); + &first, /*cpu=*/-1); } if (metric_only)
Correct in print_counter where an index was being used as a cpu. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/stat-display.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)