summaryrefslogtreecommitdiff
path: root/tools/perf/util/stat.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-04 10:57:44 +0300
committerIngo Molnar <mingo@kernel.org>2016-02-04 10:57:44 +0300
commitb83ea91f08f648460b08e8980560abdf96060a19 (patch)
tree1a6db205770ed7103afe0aa1234dec0b1227f380 /tools/perf/util/stat.c
parent8eb22c984eb9eeaed47130f5679acd367af69678 (diff)
parent580df49eed6639263348af3ff60941ff14aa72c0 (diff)
downloadlinux-b83ea91f08f648460b08e8980560abdf96060a19.tar.xz
Merge branch 'perf/urgent' into perf/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 beeed0bd3bee..4d9b481cf3b6 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);