diff options
author | Namhyung Kim <namhyung@kernel.org> | 2023-06-16 09:32:11 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-06-16 15:17:45 +0200 |
commit | dada1a1f5fbccc74e9e6754fc586b1e8b82ac0af (patch) | |
tree | 0045ac43ee351d992ad9a98dc1d2c7765e7cb31c /tools/perf/util/stat.h | |
parent | perf stat: Reset aggr stats for each run (diff) | |
download | linux-dada1a1f5fbccc74e9e6754fc586b1e8b82ac0af.tar.xz linux-dada1a1f5fbccc74e9e6754fc586b1e8b82ac0af.zip |
perf stat: Show average value on multiple runs
When -r option is used, perf stat runs the command multiple times and
update stats in the evsel->stats.res_stats for global aggregation. But
the value is never used and the value it prints at the end is just the
value from the last run. I think we should print the average number of
multiple runs.
Add evlist__copy_res_stats() to update the aggr counter (for display)
using the values in the evsel->stats.res_stats.
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: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230616073211.1057936-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat.h')
-rw-r--r-- | tools/perf/util/stat.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 934f79778cea..325d0fad1842 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -197,6 +197,7 @@ void evlist__save_aggr_prev_raw_counts(struct evlist *evlist); int evlist__alloc_aggr_stats(struct evlist *evlist, int nr_aggr); void evlist__reset_aggr_stats(struct evlist *evlist); +void evlist__copy_res_stats(struct perf_stat_config *config, struct evlist *evlist); int perf_stat_process_counter(struct perf_stat_config *config, struct evsel *counter); |