perf hists: Move he->stat.nr_events initialization to a template
[deliverable/linux.git] / tools / perf / util / hist.c
index 3197f3f50018218f24e2868a576f0cb4f7f85a94..02476cb3167d27d5807d39ad4e382173d1174b5a 100644 (file)
@@ -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),
This page took 0.025489 seconds and 5 git commands to generate.