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 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 60871C433F5 for ; Wed, 29 Dec 2021 00:38:32 +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:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NJ9i0W1JntAMV+Q3MtKfhAtwT2hA8IW+50XNh2K3/vo=; b=1B/QZheAsPgnmg HAza1NYXWtBcBGyFwS8c275OPrWrjLXj5uhtElTiIOrmQu3rIViOXgiU4IjC0breEA+lO1BDs3IES DxNWbcCY0x/JPVp83tRT3nacKMoxUAG6Cq20KsydsfLi30evF40FvB/P8k3bTv5W/59i41UGfOTuE glU+pO3QF0k0WQXsbOpBzdxb/I1GPQk4qki2uzu2BBegux6myldwMe8JD6MijQI7sa5wM449Rg4Fq 7DlJIKz/HCW1AvWLRp0KadzhEsNwePiHueD+v8geVOtPD0/IYek1XUHnAmbKjgdLz3PeD8orAy22B R6Cqh1cLcnbVlvXQmq9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2Mxu-00225a-JR; Wed, 29 Dec 2021 00:37:14 +0000 Received: from mail-lf1-f53.google.com ([209.85.167.53]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2Mxq-00224m-Pm for linux-arm-kernel@lists.infradead.org; Wed, 29 Dec 2021 00:37:12 +0000 Received: by mail-lf1-f53.google.com with SMTP id g11so44620707lfu.2 for ; Tue, 28 Dec 2021 16:37:10 -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=Q01Rf+E+7QjV3loBXIQY6tBtrZuBJZ735wIkgYD+KNYbpaZXyuswV7nq7xNXiAVDB6 xby0a3t/m58HFcKgPJI5SPs44CyFfAmIuPrYE6TCF2+T5Urw6sph+f2jcXdUKmSnzot1 wxCEtfC4LMVSSj7TcWWuiITjjG2g0ehz8Yt7Pr0lj1dLGslkym/RO28H79BC0j95F4ZW evYSFkv2vfcwjjMcrzYIQVTjZmXmvCow7moDvqwGDHDi4xlAWt3M4vTtADdKCH4dC7Qs 61v4+4PENQu03+ASiF+a1gXEl3o9TZoxV0AEWI34e6GvtfOqSFWhkxBYRseu4LsPRHXa mNng== X-Gm-Message-State: AOAM531gLr3zHINA1T+lFjWio2addTl5Zw1uA9HmRXEnJFfUf/O+HNcx BFckkaJLAjPvF9bVYo1y8+TsSDuuTgumTxA/aZg= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_163710_888650_C01BF7BE X-CRM114-Status: GOOD ( 20.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel