aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/stat.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2022-09-30 13:21:07 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-10-06 08:03:53 -0300
commit87ae87fd6c61c93a93b79c6c6c8ec5f47e4839dd (patch)
tree134f680ea665ca79af369085de515e0ec4703679 /tools/perf/util/stat.c
parentperf stat: Rename saved_value->cpu_map_idx (diff)
downloadlinux-dev-87ae87fd6c61c93a93b79c6c6c8ec5f47e4839dd.tar.xz
linux-dev-87ae87fd6c61c93a93b79c6c6c8ec5f47e4839dd.zip
perf stat: Use thread map index for shadow stat
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. Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com> Link: https://lore.kernel.org/r/20220930202110.845199-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat.c')
-rw-r--r--tools/perf/util/stat.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 7e9543cff31c..8ec8bb4a9912 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -389,12 +389,8 @@ process_counter_values(struct perf_stat_config *config, struct evsel *evsel,
}
if (config->aggr_mode == AGGR_THREAD) {
- if (config->stats)
- perf_stat__update_shadow_stats(evsel,
- count->val, 0, &config->stats[thread]);
- else
- perf_stat__update_shadow_stats(evsel,
- count->val, 0, &rt_stat);
+ perf_stat__update_shadow_stats(evsel, count->val,
+ thread, &rt_stat);
}
break;
case AGGR_GLOBAL: