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 41A06C433EF for ; Wed, 29 Dec 2021 00:37:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbhL2AhK (ORCPT ); Tue, 28 Dec 2021 19:37:10 -0500 Received: from mail-lf1-f45.google.com ([209.85.167.45]:45013 "EHLO mail-lf1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231808AbhL2AhK (ORCPT ); Tue, 28 Dec 2021 19:37:10 -0500 Received: by mail-lf1-f45.google.com with SMTP id g26so44491678lfv.11; Tue, 28 Dec 2021 16:37:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BOWM3EEvD7fdWp9qIviuq0c9wOogAKxn4lEqLJfiCyg=; b=RIbT7ixQLdZMWcY6L4ZMT9CXM1r3kR/gSniD0ZOGww8hGvrbnKBHGYUPPqOEUAsJrO wjD+k2wmj93WFAJODP/RF+CCUbzJuj4sJHqtl+DdVjPCGRHSxYkIcTa0DOq3FySc5H8u IqqCgKMHer1Bh4u5yfOPxHV2vnWqfqzoQDdp/wI6sw1yf862ahEaMp2vfF1hdwYYs3u4 EhOwgxwY8xyAOpF8Yw1xcb1qSXBSFLkdl8bzTEiLxNHoV7kEu8Qj/5lHqs6CkHzMeZkl LPllnLuWkAQHL4JIocxLhvXZwYgT3nH1nArkBdCe/GFrxepGQSR2qJYMK6Ovycc9z76n Zvqg== X-Gm-Message-State: AOAM530ql5yv0j/+5AxLRNBbFtbRqUa/o/geXrwxRSv3K0yiHtoL1M0u jOD2a78rS7nH6gnnEwqO8zYgLjs3PlZYh2oXRdA= X-Google-Smtp-Source: ABdhPJzAcDXv+BOHRkP0nTH9e4aXMoaw93moV6RNNJeCGL+el0e0ByHxQhEdqL5gUV/HXfI8FLHIIuIJGlg+h9pcVSY= X-Received: by 2002:ac2:5e8b:: with SMTP id b11mr22415630lfq.47.1640738228836; Tue, 28 Dec 2021 16:37:08 -0800 (PST) MIME-Version: 1.0 References: <20211223074541.3318938-1-irogers@google.com> <20211223074541.3318938-31-irogers@google.com> In-Reply-To: <20211223074541.3318938-31-irogers@google.com> From: Namhyung Kim Date: Tue, 28 Dec 2021 16:36:57 -0800 Message-ID: Subject: Re: [PATCH v2 30/48] perf stat: Rename aggr_data cpu to imply it's an index To: Ian Rogers Cc: Andi Kleen , Jiri Olsa , 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 , linux-kernel , Vineet Singh , James Clark , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Stephane Eranian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org On Wed, Dec 22, 2021 at 11:47 PM Ian Rogers wrote: > > Trying to make cpu maps less error prone. > > Signed-off-by: Ian Rogers > --- > tools/perf/util/python.c | 2 +- > tools/perf/util/stat-display.c | 10 +++++----- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c > index 563a9ba8954f..4b510a1f27d4 100644 > --- a/tools/perf/util/python.c > +++ b/tools/perf/util/python.c > @@ -1057,7 +1057,7 @@ static struct mmap *get_md(struct evlist *evlist, int cpu) > for (i = 0; i < evlist->core.nr_mmaps; i++) { > struct mmap *md = &evlist->mmap[i]; > > - if (md->core.cpu == cpu) > + if (md->core.cpu_map_idx == cpu) It doesn't seem to belong to this change.. Thanks, Namhyung > return md; > } > > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c > index 821511ba22cc..4f93591aaa76 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; > -- > 2.34.1.307.g9b7440fafd-goog >