From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753024AbbKZPW2 (ORCPT ); Thu, 26 Nov 2015 10:22:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50564 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbbKZPWR (ORCPT ); Thu, 26 Nov 2015 10:22:17 -0500 Date: Thu, 26 Nov 2015 16:22:12 +0100 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , LKML , David Ahern , Kan Liang , Frederic Weisbecker , Andi Kleen , Wang Nan Subject: Re: [PATCH 1/3] perf top: Fix freeze on --call-graph flat/folded Message-ID: <20151126152212.GA31756@krava.brq.redhat.com> References: <1448521700-32062-1-git-send-email-namhyung@kernel.org> <20151126083853.GA8822@krava.brq.redhat.com> <20151126135256.GA18551@danjae.kornet> <20151126140034.GA29453@krava.brq.redhat.com> <20151126151031.GB21474@danjae.kornet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151126151031.GB21474@danjae.kornet> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 27, 2015 at 12:10:31AM +0900, Namhyung Kim wrote: > On Thu, Nov 26, 2015 at 03:00:34PM +0100, Jiri Olsa wrote: > > On Thu, Nov 26, 2015 at 10:52:56PM +0900, Namhyung Kim wrote: > > > Hi Jiri, > > > > > > On Thu, Nov 26, 2015 at 09:38:53AM +0100, Jiri Olsa wrote: > > > > On Thu, Nov 26, 2015 at 04:08:18PM +0900, Namhyung Kim wrote: > > > > > 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 > > > > > --- > > > > > tools/perf/util/callchain.c | 1 + > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > 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; > > > > > > > > it seems ok, but I did not find how this could be called twice? > > > > > > > > the only sort I can see is done within: > > > > __hists__insert_output_entry > > > > > > > > do we allow resorting of the callchains? > > > > > > No, but I think it's possible though. > > > > > > It's called from perf top's display thread. > > > > ah right.. top ;-) ok > > > > isn't there analogical issue with the other sorts? > > graph_abs, graph_rel... I dont see that code doing this > > The sort_chain_graph_abs/rel() already do this. Unlike flat/folded > callchains, they put child into each callchain_node's rbtree. So they > reinitialize node->rb_root in __sort_chain_graph_abs/rel() and reset > rb_root after finishing sort. ook, thanks for explanation Acked-by: Jiri Olsa jirka