perf diff: Use internal rb tree for hists__precompute
[deliverable/linux.git] / tools / perf / builtin-diff.c
index a9d63c1c64c5ce217d7429aab50db52be6a3e319..da8f8eb383a0bea2b7ddefe923836969acbd65fe 100644 (file)
@@ -323,13 +323,20 @@ static void hists__baseline_only(struct hists *hists)
 
 static void hists__precompute(struct hists *hists)
 {
-       struct rb_node *next = rb_first(&hists->entries);
+       struct rb_root *root;
+       struct rb_node *next;
+
+       if (sort__need_collapse)
+               root = &hists->entries_collapsed;
+       else
+               root = hists->entries_in;
 
+       next = rb_first(root);
        while (next != NULL) {
-               struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node);
+               struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node_in);
                struct hist_entry *pair = hist_entry__next_pair(he);
 
-               next = rb_next(&he->rb_node);
+               next = rb_next(&he->rb_node_in);
                if (!pair)
                        continue;
 
This page took 0.024997 seconds and 5 git commands to generate.