perf hists browser: Init the has_children fields just once

Not everytime we show the callchains, removing duplicated initialization
of this field.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 293db47f
...@@ -298,15 +298,10 @@ static int hist_browser__show_callchain_node_rb_tree(struct hist_browser *self, ...@@ -298,15 +298,10 @@ static int hist_browser__show_callchain_node_rb_tree(struct hist_browser *self,
int color; int color;
bool was_first = first; bool was_first = first;
if (first) { if (first)
first = false; first = false;
chain->ms.has_children = chain->list.next != &child->val || else
!RB_EMPTY_ROOT(&child->rb_root);
} else {
extra_offset = LEVEL_OFFSET_STEP; extra_offset = LEVEL_OFFSET_STEP;
chain->ms.has_children = chain->list.next == &child->val &&
!RB_EMPTY_ROOT(&child->rb_root);
}
folded_sign = callchain_list__folded(chain); folded_sign = callchain_list__folded(chain);
if (*row_offset != 0) { if (*row_offset != 0) {
...@@ -376,12 +371,7 @@ static int hist_browser__show_callchain_node(struct hist_browser *self, ...@@ -376,12 +371,7 @@ static int hist_browser__show_callchain_node(struct hist_browser *self,
list_for_each_entry(chain, &node->val, list) { list_for_each_entry(chain, &node->val, list) {
char ipstr[BITS_PER_LONG / 4 + 1], *s; char ipstr[BITS_PER_LONG / 4 + 1], *s;
int color; int color;
/*
* FIXME: This should be moved to somewhere else,
* probably when the callchain is created, so as not to
* traverse it all over again
*/
chain->ms.has_children = !RB_EMPTY_ROOT(&node->rb_root);
folded_sign = callchain_list__folded(chain); folded_sign = callchain_list__folded(chain);
if (*row_offset != 0) { if (*row_offset != 0) {
...@@ -457,7 +447,7 @@ static int hist_browser__show_entry(struct hist_browser *self, ...@@ -457,7 +447,7 @@ static int hist_browser__show_entry(struct hist_browser *self,
} }
if (symbol_conf.use_callchain) { if (symbol_conf.use_callchain) {
entry->ms.has_children = !RB_EMPTY_ROOT(&entry->sorted_chain); hist_entry__init_have_children(entry);
folded_sign = hist_entry__folded(entry); folded_sign = hist_entry__folded(entry);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册