perf tools: No need for three rb_trees for sorting hist entries

All hist entries are in only one of them, so use just one and a
temporary rb_root while sorting/collapsing.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1260797831-11220-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Arnaldo Carvalho de Melo
2009-12-14 11:37:11 -02:00
committed by Ingo Molnar
parent 4aa6563641
commit b9bf089212
4 changed files with 22 additions and 28 deletions

View File

@@ -567,7 +567,7 @@ static size_t output__fprintf(FILE *fp, u64 total_samples)
fprintf(fp, "#\n");
print_entries:
for (nd = rb_first(&output_hists); nd; nd = rb_next(nd)) {
for (nd = rb_first(&hist); nd; nd = rb_next(nd)) {
pos = rb_entry(nd, struct hist_entry, rb_node);
ret += hist_entry__fprintf(fp, pos, total_samples);
}