Skip to content

Commit 580df49

Browse files
author
Ingo Molnar
committed
Merge tag 'perf-urgent-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fix from Arnaldo Carvalho de Melo: - Fix 'perf stat' interval output values (Jiri Olsa) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 9a96940 + 51fd2df commit 580df49

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/perf/util/stat.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,16 @@ int perf_stat_process_counter(struct perf_stat_config *config,
311311

312312
aggr->val = aggr->ena = aggr->run = 0;
313313

314+
/*
315+
* We calculate counter's data every interval,
316+
* and the display code shows ps->res_stats
317+
* avg value. We need to zero the stats for
318+
* interval mode, otherwise overall avg running
319+
* averages will be shown for each interval.
320+
*/
321+
if (config->interval)
322+
init_stats(ps->res_stats);
323+
314324
if (counter->per_pkg)
315325
zero_per_pkg(counter);
316326

0 commit comments

Comments
 (0)