Skip to content

Commit

Permalink
perf hists: Move he->stat.nr_events initialization to a template
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Oct 4, 2012
1 parent b24c28f commit c4b3535
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand Down

0 comments on commit c4b3535

Please sign in to comment.