perf top: Fix freeze on --call-graph flat/folded
authorNamhyung Kim <[email protected]>
Thu, 26 Nov 2015 07:08:18 +0000 (16:08 +0900)
committerArnaldo Carvalho de Melo <[email protected]>
Thu, 26 Nov 2015 16:32:08 +0000 (13:32 -0300)
The callchain rbtree is rebuilt periodically, so it needs to
reinitialize the root everytime.  Otherwise it can be stuck in the
rbtree insertion with stale pointers.

Signed-off-by: Namhyung Kim <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Wang Nan <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/callchain.c

index fc3b1e0d09eec2b318cfabaa84e952d1f9843355..564377d2bebf3ee1c11d26839f68e42d7ad6b62f 100644 (file)
@@ -290,6 +290,7 @@ static void
 sort_chain_flat(struct rb_root *rb_root, struct callchain_root *root,
                u64 min_hit, struct callchain_param *param __maybe_unused)
 {
+       *rb_root = RB_ROOT;
        __sort_chain_flat(rb_root, &root->node, min_hit);
 }