perf session: Change add_hist_entry to take the tree root instead of session
[safe/jmp/linux-2.6] / tools / perf / util / hist.c
index e8daf5c..55dd911 100644 (file)
@@ -12,12 +12,12 @@ struct callchain_param      callchain_param = {
  * histogram, sorted on item, collects counts
  */
 
-struct hist_entry *__perf_session__add_hist_entry(struct perf_session *self,
+struct hist_entry *__perf_session__add_hist_entry(struct rb_root *hists,
                                                  struct addr_location *al,
                                                  struct symbol *sym_parent,
                                                  u64 count, bool *hit)
 {
-       struct rb_node **p = &self->hists.rb_node;
+       struct rb_node **p = &hists->rb_node;
        struct rb_node *parent = NULL;
        struct hist_entry *he;
        struct hist_entry entry = {
@@ -53,7 +53,7 @@ struct hist_entry *__perf_session__add_hist_entry(struct perf_session *self,
                return NULL;
        *he = entry;
        rb_link_node(&he->rb_node, parent, p);
-       rb_insert_color(&he->rb_node, &self->hists);
+       rb_insert_color(&he->rb_node, hists);
        *hit = false;
        return he;
 }