path: root/tools
diff options
authorAndres Freund <>2016-03-30 21:02:45 +0200
committerArnaldo Carvalho de Melo <>2016-03-30 18:08:39 -0300
commit909890355507e92bdaf648e73870f6b5df606da8 (patch)
tree890ec9b1b6f9f9ad29adb46c39136230984fc3e2 /tools
parentf6343be96ebbae38a07e0878810f5bbc0c38cade (diff)
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: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools')
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 4b9816555946..2a83414159a6 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->, struct callchain_list, list);
chain->has_children = has_sibling;
- if (node-> != 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);