lkml.org 
[lkml]   [2016]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/12] perf hists browser: Fix callchain_node__count_rows()
Date
Like other functions, it should stop counting if there's any folded
callchain. Because of this it occasionally lose the cursor at the end.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/ui/browsers/hists.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 349c5de73287..c7ca36dae89f 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -215,7 +215,7 @@ static int callchain_node__count_folded_rows(struct callchain_node *node __maybe
static int callchain_node__count_rows(struct callchain_node *node)
{
struct callchain_list *chain;
- bool unfolded = false;
+ char folded_sign = ' ';
int n = 0;

if (callchain_param.mode == CHAIN_FLAT)
@@ -225,10 +225,13 @@ static int callchain_node__count_rows(struct callchain_node *node)

list_for_each_entry(chain, &node->val, list) {
++n;
- unfolded = chain->unfolded;
+
+ folded_sign = callchain_list__folded(chain);
+ if (folded_sign == '+')
+ break;
}

- if (unfolded)
+ if (folded_sign == '-')
n += callchain_node__count_rows_rb_tree(node);

return n;
--
2.6.4
\
 
 \ /
  Last update: 2016-01-24 15:21    [W:0.200 / U:1.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site