From: Namhyung Kim Date: Thu, 26 Nov 2015 07:08:18 +0000 (+0900) Subject: perf top: Fix freeze on --call-graph flat/folded X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0356218a68551f051998f4fb5074a1eed7a346fe;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git perf top: Fix freeze on --call-graph flat/folded 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 Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1448521700-32062-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index fc3b1e0d09ee..564377d2bebf 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -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); }