提交 82162b5a 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf hists browser: Fix a small callchain display bug

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
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Acked-by: NIngo Molnar <mingo@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1407909761-10822-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 0a7e6d1b
...@@ -228,8 +228,10 @@ static void callchain_node__init_have_children(struct callchain_node *node) ...@@ -228,8 +228,10 @@ static void callchain_node__init_have_children(struct callchain_node *node)
{ {
struct callchain_list *chain; 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); chain->ms.has_children = !RB_EMPTY_ROOT(&node->rb_root);
}
callchain_node__init_have_children_rb_tree(node); callchain_node__init_have_children_rb_tree(node);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册