aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-10-04 08:49:42 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-04 12:35:14 -0400
commitc4b35351ef3145c9abad64999d1de0de1b8361ab (patch)
tree2510b23e0f49450baa654a1eb49317a22af7c428 /tools/perf
parentb24c28f794e1821c1bba3ef7e9e948ab77ee00ac (diff)
perf hists: Move he->stat.nr_events initialization to a template
Since it is set to 1 for a new hist entry, no need to set to separately. Move it to a template entry. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Arun Sharma <asharma@fb.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1349354994-17853-9-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/hist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 3197f3f50018..02476cb3167d 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -223,7 +223,7 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template)
223 223
224 if (he != NULL) { 224 if (he != NULL) {
225 *he = *template; 225 *he = *template;
226 he->stat.nr_events = 1; 226
227 if (he->ms.map) 227 if (he->ms.map)
228 he->ms.map->referenced = true; 228 he->ms.map->referenced = true;
229 if (symbol_conf.use_callchain) 229 if (symbol_conf.use_callchain)
@@ -323,6 +323,7 @@ struct hist_entry *__hists__add_branch_entry(struct hists *self,
323 .level = al->level, 323 .level = al->level,
324 .stat = { 324 .stat = {
325 .period = period, 325 .period = period,
326 .nr_events = 1,
326 }, 327 },
327 .parent = sym_parent, 328 .parent = sym_parent,
328 .filtered = symbol__parent_filter(sym_parent), 329 .filtered = symbol__parent_filter(sym_parent),
@@ -348,6 +349,7 @@ struct hist_entry *__hists__add_entry(struct hists *self,
348 .level = al->level, 349 .level = al->level,
349 .stat = { 350 .stat = {
350 .period = period, 351 .period = period,
352 .nr_events = 1,
351 }, 353 },
352 .parent = sym_parent, 354 .parent = sym_parent,
353 .filtered = symbol__parent_filter(sym_parent), 355 .filtered = symbol__parent_filter(sym_parent),