aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-04-14 16:45:39 +0200
committerIngo Molnar <mingo@kernel.org>2014-04-14 16:45:39 +0200
commitfbdd17ec5ce2e5e4027356fcfde769b88d15702f (patch)
treed655577d9bb40b7c9a03d35b513fd9a1bbfe431d /tools/perf/builtin-stat.c
parentMerge tag 'v3.15-rc1' into perf/urgent (diff)
parentperf stat: Initialize statistics correctly (diff)
downloadlinux-dev-fbdd17ec5ce2e5e4027356fcfde769b88d15702f.tar.xz
linux-dev-fbdd17ec5ce2e5e4027356fcfde769b88d15702f.zip
Merge branch 'perf-core-for-mingo' into perf/urgent
Conflicts: tools/perf/bench/numa.c Pull perf fixes from Jiri Olsa. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 8b0e1c9234d9..65a151e36067 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -174,13 +174,20 @@ static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel)
static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel)
{
- memset(evsel->priv, 0, sizeof(struct perf_stat));
+ int i;
+ struct perf_stat *ps = evsel->priv;
+
+ for (i = 0; i < 3; i++)
+ init_stats(&ps->res_stats[i]);
}
static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel)
{
evsel->priv = zalloc(sizeof(struct perf_stat));
- return evsel->priv == NULL ? -ENOMEM : 0;
+ if (evsel == NULL)
+ return -ENOMEM;
+ perf_evsel__reset_stat_priv(evsel);
+ return 0;
}
static void perf_evsel__free_stat_priv(struct perf_evsel *evsel)