Skip to contentSkip to conversation

perf hists: Initialize all of he-> stat with zeroes

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Dec 8, 2012 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  30193d78d82a68247aa628a2414dc0f76c5b8093
Gitweb:     http://git.kernel.org/tip/30193d78d82a68247aa628a2414dc0f76c5b8093
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 12 Nov 2012 13:20:03 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 14 Nov 2012 16:50:47 -0300

perf hists: Initialize all of he->stat with zeroes

Not just nr_events and period.

Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/util/hist.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
tools/perf/util/hist.c +2 -3
index 7c6e73b..cb17e2a 100644
@@ -742,9 +742,8 @@ static struct hist_entry *hists__add_dummy_entry(struct hists *hists,
 
 	he = hist_entry__new(pair);
 	if (he) {
-		he->stat.nr_events = 0;
-		he->stat.period    = 0;
-		he->hists	   = hists;
+		memset(&he->stat, 0, sizeof(he->stat));
+		he->hists = hists;
 		rb_link_node(&he->rb_node, parent, p);
 		rb_insert_color(&he->rb_node, &hists->entries);
 		hists__inc_nr_entries(hists, he);