From: Namhyung Kim Date: Thu, 4 Oct 2012 12:49:42 +0000 (+0900) Subject: perf hists: Move he->stat.nr_events initialization to a template X-Git-Tag: v3.7-rc1~29^2~3^2~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c4b35351ef3145c9abad64999d1de0de1b8361ab;p=~emulex%2Finfiniband.git 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 Cc: Arun Sharma Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1349354994-17853-9-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 3197f3f5001..02476cb3167 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) if (he != NULL) { *he = *template; - he->stat.nr_events = 1; + if (he->ms.map) he->ms.map->referenced = true; if (symbol_conf.use_callchain) @@ -323,6 +323,7 @@ struct hist_entry *__hists__add_branch_entry(struct hists *self, .level = al->level, .stat = { .period = period, + .nr_events = 1, }, .parent = sym_parent, .filtered = symbol__parent_filter(sym_parent), @@ -348,6 +349,7 @@ struct hist_entry *__hists__add_entry(struct hists *self, .level = al->level, .stat = { .period = period, + .nr_events = 1, }, .parent = sym_parent, .filtered = symbol__parent_filter(sym_parent),