diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-08-25 15:30:03 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-08-25 15:30:03 -0400 |
commit | 163caed90203a7cab66326ce2be138715dc7c5da (patch) | |
tree | 9a9234ad0f89a880678be567185756a0ca677c54 /tools | |
parent | 293db47f4753f5746e5aaa998ceb24dff662cf7e (diff) |
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: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/ui/browsers/hists.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c index e61355e6b2c5..c17611fb5c0b 100644 --- a/tools/perf/util/ui/browsers/hists.c +++ b/tools/perf/util/ui/browsers/hists.c | |||
@@ -298,15 +298,10 @@ static int hist_browser__show_callchain_node_rb_tree(struct hist_browser *self, | |||
298 | int color; | 298 | int color; |
299 | bool was_first = first; | 299 | bool was_first = first; |
300 | 300 | ||
301 | if (first) { | 301 | if (first) |
302 | first = false; | 302 | first = false; |
303 | chain->ms.has_children = chain->list.next != &child->val || | 303 | else |
304 | !RB_EMPTY_ROOT(&child->rb_root); | ||
305 | } else { | ||
306 | extra_offset = LEVEL_OFFSET_STEP; | 304 | extra_offset = LEVEL_OFFSET_STEP; |
307 | chain->ms.has_children = chain->list.next == &child->val && | ||
308 | !RB_EMPTY_ROOT(&child->rb_root); | ||
309 | } | ||
310 | 305 | ||
311 | folded_sign = callchain_list__folded(chain); | 306 | folded_sign = callchain_list__folded(chain); |
312 | if (*row_offset != 0) { | 307 | if (*row_offset != 0) { |
@@ -376,12 +371,7 @@ static int hist_browser__show_callchain_node(struct hist_browser *self, | |||
376 | list_for_each_entry(chain, &node->val, list) { | 371 | list_for_each_entry(chain, &node->val, list) { |
377 | char ipstr[BITS_PER_LONG / 4 + 1], *s; | 372 | char ipstr[BITS_PER_LONG / 4 + 1], *s; |
378 | int color; | 373 | int color; |
379 | /* | 374 | |
380 | * FIXME: This should be moved to somewhere else, | ||
381 | * probably when the callchain is created, so as not to | ||
382 | * traverse it all over again | ||
383 | */ | ||
384 | chain->ms.has_children = !RB_EMPTY_ROOT(&node->rb_root); | ||
385 | folded_sign = callchain_list__folded(chain); | 375 | folded_sign = callchain_list__folded(chain); |
386 | 376 | ||
387 | if (*row_offset != 0) { | 377 | if (*row_offset != 0) { |
@@ -457,7 +447,7 @@ static int hist_browser__show_entry(struct hist_browser *self, | |||
457 | } | 447 | } |
458 | 448 | ||
459 | if (symbol_conf.use_callchain) { | 449 | if (symbol_conf.use_callchain) { |
460 | entry->ms.has_children = !RB_EMPTY_ROOT(&entry->sorted_chain); | 450 | hist_entry__init_have_children(entry); |
461 | folded_sign = hist_entry__folded(entry); | 451 | folded_sign = hist_entry__folded(entry); |
462 | } | 452 | } |
463 | 453 | ||