Commit 367c53c08f84bb554a3aae18b65e5419fe4b164a
Committed by
Arnaldo Carvalho de Melo
1 parent
eec574e6bc
Exists in
smarc-imx_3.14.28_1.0.0_ga
and in
1 other branch
perf diff: Use internal rb tree for hists__precompute
There's missing change for hists__precompute to iterate either entries_collapsed or entries_in tree. The change was initiated for hists_compute_resort function in commit: 66f97ed perf diff: Use internal rb tree for compute resort but was missing for hists__precompute function changes. 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@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1355404152-16523-2-git-send-email-jolsa@redhat.com [ committer note: Reduce patch size, no functional change ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Showing 1 changed file with 10 additions and 3 deletions Side-by-side Diff
tools/perf/builtin-diff.c
... | ... | @@ -323,13 +323,20 @@ |
323 | 323 | |
324 | 324 | static void hists__precompute(struct hists *hists) |
325 | 325 | { |
326 | - struct rb_node *next = rb_first(&hists->entries); | |
326 | + struct rb_root *root; | |
327 | + struct rb_node *next; | |
327 | 328 | |
329 | + if (sort__need_collapse) | |
330 | + root = &hists->entries_collapsed; | |
331 | + else | |
332 | + root = hists->entries_in; | |
333 | + | |
334 | + next = rb_first(root); | |
328 | 335 | while (next != NULL) { |
329 | - struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node); | |
336 | + struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node_in); | |
330 | 337 | struct hist_entry *pair = hist_entry__next_pair(he); |
331 | 338 | |
332 | - next = rb_next(&he->rb_node); | |
339 | + next = rb_next(&he->rb_node_in); | |
333 | 340 | if (!pair) |
334 | 341 | continue; |
335 | 342 |