diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-06-03 22:02:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-04 03:27:21 -0400 |
commit | a4c43beaff0fe6c83aa2505dce8ffe65db8e0a33 (patch) | |
tree | fbfaedbcfdbcfaa774cf7d079e0284b28deb8ac1 | |
parent | d11444dfa78cdd887d8dfd2fab3883132aff2c2d (diff) |
perf report: Fix rbtree bug
Ingo Molnar reported:
> FYI, i just got this crash (segfault) in perf report after
> collecting a long profile from Xorg:
>
> Starting program: /home/mingo/tip/Documentation/perf_counter/perf report
> [Thread debugging using libthread_db enabled]
> Detaching after fork from child process 20008.
> [New Thread 0x7f92fd62a6f0 (LWP 20005)]
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000041031a in __rb_erase_color (node=0x142c090, parent=0x0,
> root=0x881918)
> at util/rbtree.c:143
> 143 if (parent->rb_left == node)
It was a problem introduced in this cset:
perf report: Fix comm sorting - 8229289b607682f90b946ad2c319526303c17700
This patch should fix it.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephane Eranian <eranian@googlemail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | Documentation/perf_counter/builtin-report.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c index 6003cc3b188d..86f23f0991f1 100644 --- a/Documentation/perf_counter/builtin-report.c +++ b/Documentation/perf_counter/builtin-report.c | |||
@@ -699,17 +699,18 @@ static void output__resort(void) | |||
699 | { | 699 | { |
700 | struct rb_node *next; | 700 | struct rb_node *next; |
701 | struct hist_entry *n; | 701 | struct hist_entry *n; |
702 | struct rb_root *tree = &hist; | ||
702 | 703 | ||
703 | if (sort__need_collapse) | 704 | if (sort__need_collapse) |
704 | next = rb_first(&collapse_hists); | 705 | tree = &collapse_hists; |
705 | else | 706 | |
706 | next = rb_first(&hist); | 707 | next = rb_first(tree); |
707 | 708 | ||
708 | while (next) { | 709 | while (next) { |
709 | n = rb_entry(next, struct hist_entry, rb_node); | 710 | n = rb_entry(next, struct hist_entry, rb_node); |
710 | next = rb_next(&n->rb_node); | 711 | next = rb_next(&n->rb_node); |
711 | 712 | ||
712 | rb_erase(&n->rb_node, &hist); | 713 | rb_erase(&n->rb_node, tree); |
713 | output__insert_entry(n); | 714 | output__insert_entry(n); |
714 | } | 715 | } |
715 | } | 716 | } |