lkml.org 
[lkml]   [2014]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf ui/tui: Fix a small callchain display bug
Date
The currently when perf TUI report shows callchain, the first level
chains have bogus '+' sign even though only the last one has children.

Since they are on a single line of the chain, toggling intermediate
entries has no effect. Fix it to show '+' sign at the last entry
only. Note that non-first level callchain entries don't have this
problem.

Before:

Children Self Command Shared Object Symbols
---------------------------------------------------------------------------
- 40.70% 0.00% swapper [kernel.kallsyms] [k] cpuidle_wrap_enter
+ cpuidle_wrap_enter
+ cpuidle_enter_tk
+ cpuidle_idle_call
+ cpu_idle

After:

Children Self Command Shared Object Symbols
---------------------------------------------------------------------------
- 40.70% 0.00% swapper [kernel.kallsyms] [k] cpuidle_wrap_enter
cpuidle_wrap_enter
cpuidle_enter_tk
cpuidle_idle_call
+ cpu_idle

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/ui/browsers/hists.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 045c1e16ac59..1818d1275d02 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -228,8 +228,10 @@ static void callchain_node__init_have_children(struct callchain_node *node)
{
struct callchain_list *chain;

- list_for_each_entry(chain, &node->val, list)
+ if (!list_empty(&node->val)) {
+ chain = list_entry(node->val.prev, struct callchain_list, list);
chain->ms.has_children = !RB_EMPTY_ROOT(&node->rb_root);
+ }

callchain_node__init_have_children_rb_tree(node);
}
--
2.0.0


\
 
 \ /
  Last update: 2014-08-13 08:21    [W:0.078 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site