summaryrefslogtreecommitdiff
path: root/tools/perf/util/stat.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-18 09:03:57 +0100
committerIngo Molnar <mingo@kernel.org>2016-02-18 09:03:57 +0100
commit061f817eb6a6f97a7e34b73e5e80baa3a20b7663 (patch)
tree412332269985de14d5e1ae9eedbfcd73bc635e97 /tools/perf/util/stat.c
parente6c8f1873be8a14c7e44202df1f7e6ea61bf3352 (diff)
parent18558cae0272f8fd9647e69d3fec1565a7949865 (diff)
Merge tag 'v4.5-rc4' into ras/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/stat.c')
-rw-r--r--tools/perf/util/stat.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 2b58edccd56f..afb0c45eba34 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -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);