Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755516AbcCaGeH (ORCPT ); Thu, 31 Mar 2016 02:34:07 -0400 Received: from terminus.zytor.com ([198.137.202.10]:34314 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504AbcCaGeG (ORCPT ); Thu, 31 Mar 2016 02:34:06 -0400 Date: Wed, 30 Mar 2016 23:33:37 -0700 From: tip-bot for Andres Freund Message-ID: Cc: hpa@zytor.com, mingo@kernel.org, acme@redhat.com, tglx@linutronix.de, namhyung@kernel.org, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, andres@anarazel.de Reply-To: tglx@linutronix.de, a.p.zijlstra@chello.nl, namhyung@kernel.org, linux-kernel@vger.kernel.org, andres@anarazel.de, hpa@zytor.com, mingo@kernel.org, acme@redhat.com In-Reply-To: <20160330190245.GB13305@awork2.anarazel.de> References: <20160330190245.GB13305@awork2.anarazel.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf hists: Fix determination of a callchain node's childlessness Git-Commit-ID: 909890355507e92bdaf648e73870f6b5df606da8 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1887 Lines: 43 Commit-ID: 909890355507e92bdaf648e73870f6b5df606da8 Gitweb: http://git.kernel.org/tip/909890355507e92bdaf648e73870f6b5df606da8 Author: Andres Freund AuthorDate: Wed, 30 Mar 2016 21:02:45 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 30 Mar 2016 18:08:39 -0300 perf hists: Fix determination of a callchain node's childlessness The 4b3a3212233a ("perf hists browser: Support flat callchains") commit over-aggressively tried to optimize callchain_node__init_have_children(). That lead to --tui mode not allowing to expand call chain elements if a call chain element had only one parent. That's why --inverted callgraphs looked halfway sane, but plain ones didn't. Revert that individual optimization, it wasn't really related to the rest of the commit. Signed-off-by: Andres Freund Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Peter Zijlstra Fixes: 4b3a3212233a ("perf hists browser: Support flat callchains") Link: http://lkml.kernel.org/r/20160330190245.GB13305@awork2.anarazel.de Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/ui/browsers/hists.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 4b98165..2a83414 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -337,7 +337,7 @@ static void callchain_node__init_have_children(struct callchain_node *node, chain = list_entry(node->val.next, struct callchain_list, list); chain->has_children = has_sibling; - if (node->val.next != node->val.prev) { + if (!list_empty(&node->val)) { chain = list_entry(node->val.prev, struct callchain_list, list); chain->has_children = !RB_EMPTY_ROOT(&node->rb_root); }