summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-12-13 14:08:59 +0100
committerChanho Park <chanho61.park@samsung.com>2014-03-20 17:34:24 +0900
commit8fa3eb5a02e04cf61da79b6019549ae8c9036cc0 (patch)
treedf066a3ecbcd606f517b228235a0d00c270451a0 /tools
parent71f6fb951879cf51e990624b004dae50a20b5557 (diff)
downloadlinux-3.10-8fa3eb5a02e04cf61da79b6019549ae8c9036cc0.tar.gz
linux-3.10-8fa3eb5a02e04cf61da79b6019549ae8c9036cc0.tar.bz2
linux-3.10-8fa3eb5a02e04cf61da79b6019549ae8c9036cc0.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-diff.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index a9d63c1c64c..da8f8eb383a 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -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;