Skip to content

Commit

Permalink
Merge tag 'perf-urgent-for-mingo-2' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/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 <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Ingo Molnar committed Feb 4, 2016
2 parents 9a96940 + 51fd2df commit 580df49
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/perf/util/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,16 @@ int perf_stat_process_counter(struct perf_stat_config *config,

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

/*
* We calculate counter's data every interval,
* and the display code shows ps->res_stats
* avg value. We need to zero the stats for
* interval mode, otherwise overall avg running
* averages will be shown for each interval.
*/
if (config->interval)
init_stats(ps->res_stats);

if (counter->per_pkg)
zero_per_pkg(counter);

Expand Down

0 comments on commit 580df49

Please sign in to comment.