diff options
author | Andres Freund <andres@anarazel.de> | 2016-03-30 21:02:45 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-04 14:49:14 -0700 |
commit | 06b7ad2899f5d2ff0e15141d42456c08dadbcc33 (patch) | |
tree | 76a5d7a14d4be57b7c2fa9258a1b13022a1f00da | |
parent | 1f861d0348fddb9c063af9c13e0c4c463fb211aa (diff) | |
download | linux-stable-06b7ad2899f5d2ff0e15141d42456c08dadbcc33.tar.gz linux-stable-06b7ad2899f5d2ff0e15141d42456c08dadbcc33.tar.bz2 linux-stable-06b7ad2899f5d2ff0e15141d42456c08dadbcc33.zip |
perf hists: Fix determination of a callchain node's childlessness
commit 909890355507e92bdaf648e73870f6b5df606da8 upstream.
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 <andres@anarazel.de>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
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 <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 7c1fe6da3557..7bb47424bc49 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c @@ -302,7 +302,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); } |