[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM9d7cjorFczG4_v7+dxZ=W-ZngVAiVNzuCLpmLkeO-_rGNmGg@mail.gmail.com>
Date: Wed, 28 Sep 2022 21:55:23 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>, Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-perf-users <linux-perf-users@...r.kernel.org>,
Andi Kleen <ak@...ux.intel.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Leo Yan <leo.yan@...aro.org>,
Zhengjun Xing <zhengjun.xing@...ux.intel.com>
Subject: Re: [PATCH 4/6] perf stat: Use thread map index for shadow stat
Hi Ian,
On Wed, Sep 28, 2022 at 7:10 PM Ian Rogers <irogers@...gle.com> wrote:
>
> On Mon, Sep 26, 2022 at 1:08 PM Namhyung Kim <namhyung@...nel.org> wrote:
> >
> > When AGGR_THREAD is active, it aggregates the values for each thread.
> > Previously it used cpu map index which is invalid for AGGR_THREAD so
> > it had to use separate runtime stats with index 0.
> >
> > But it can just use the rt_stat with thread_map_index. Rename the
> > first_shadow_map_idx() and make it return the thread index.
> >
> > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> > ---
> > tools/perf/util/stat-display.c | 20 +++++++++-----------
> > tools/perf/util/stat.c | 8 ++------
> > 2 files changed, 11 insertions(+), 17 deletions(-)
> >
> > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> > index 234491f43c36..570e2c04d47d 100644
> > --- a/tools/perf/util/stat-display.c
> > +++ b/tools/perf/util/stat-display.c
> > @@ -442,7 +442,7 @@ static void print_metric_header(struct perf_stat_config *config,
> > fprintf(os->fh, "%*s ", config->metric_only_len, unit);
> > }
> >
> > -static int first_shadow_cpu_map_idx(struct perf_stat_config *config,
> > +static int first_shadow_map_idx(struct perf_stat_config *config,
> > struct evsel *evsel, const struct aggr_cpu_id *id)
> > {
> > struct perf_cpu_map *cpus = evsel__cpus(evsel);
> > @@ -452,6 +452,9 @@ static int first_shadow_cpu_map_idx(struct perf_stat_config *config,
> > if (config->aggr_mode == AGGR_NONE)
> > return perf_cpu_map__idx(cpus, id->cpu);
> >
> > + if (config->aggr_mode == AGGR_THREAD)
> > + return id->thread;
>
> The function's name implies returning an index but that isn't clear
> here. Can we change the aggr_cpu_id's thread to be called thread_idx?
Right, I'll do that in a separate commit.
Thanks,
Namhyung
Powered by blists - more mailing lists