perf hists: Add struct hists pointer to struct hist_entry
authorJiri Olsa <jolsa@redhat.com>
Thu, 4 Oct 2012 12:49:35 +0000 (21:49 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 4 Oct 2012 16:27:00 +0000 (13:27 -0300)
Adding pointer back to the parent struct hists for struct hists_entry.

This will be useful in future for any hist_entry's data computation,
that depends on total data of its parent hists.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1349354994-17853-2-git-send-email-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/hist.c
tools/perf/util/sort.h

index 236bc9d98ff267ab598c1de35073a4bca39f3f8f..040f34c79a53e8707debbb71798b504e5115a58c 100644 (file)
@@ -325,6 +325,7 @@ struct hist_entry *__hists__add_branch_entry(struct hists *self,
                .parent = sym_parent,
                .filtered = symbol__parent_filter(sym_parent),
                .branch_info = bi,
+               .hists  = self,
        };
 
        return add_hist_entry(self, &entry, al, period);
@@ -346,6 +347,7 @@ struct hist_entry *__hists__add_entry(struct hists *self,
                .period = period,
                .parent = sym_parent,
                .filtered = symbol__parent_filter(sym_parent),
+               .hists  = self,
        };
 
        return add_hist_entry(self, &entry, al, period);
index 12d634792de511051decb3cfa7caf6458d60560c..eb3959b8e9d99e4803c9695244b9294f92ba637d 100644 (file)
@@ -79,6 +79,7 @@ struct hist_entry {
                struct rb_root    sorted_chain;
        };
        struct branch_info      *branch_info;
+       struct hists            *hists;
        struct callchain_root   callchain[0];
 };