summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/stat.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-03-04 12:12:08 +0100
committerIngo Molnar <mingo@kernel.org>2016-03-04 12:12:08 +0100
commitbc94b99636dc7bcccce439a9fb9c00065e2e2627 (patch)
treebddbd29a5fd7b2d270d039efc1d6858791a2c98f /tools/perf/util/stat.c
parentACPI/EINJ: Allow memory error injection to NVDIMM (diff)
parentLinux 4.5-rc6 (diff)
downloadlinux-bc94b99636dc7bcccce439a9fb9c00065e2e2627.tar.xz
linux-bc94b99636dc7bcccce439a9fb9c00065e2e2627.zip
Merge tag 'v4.5-rc6' into core/resources, to resolve conflict
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/stat.c')
-rw-r--r--tools/perf/util/stat.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 2f901d15e063..afb0c45eba34 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -310,7 +310,16 @@ int perf_stat_process_counter(struct perf_stat_config *config,
int i, ret;
aggr->val = aggr->ena = aggr->run = 0;
- init_stats(ps->res_stats);
+
+ /*
+ * 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);