Skip to content

Commit

Permalink
perf hists: Return correct number of characters printed in callchain
Browse files Browse the repository at this point in the history
Include the omitted number of characters printed for the first entry.

Not that it really matters because nobody seem to care about the number
of printed characters for now. But just in case.

Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
fweisbec authored and acmel committed Jul 25, 2012
1 parent 78b961f commit 8760db7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
bool printed = false;
struct rb_node *node;
int i = 0;
int ret;
int ret = 0;

/*
* If have one single callchain root, don't bother printing
Expand Down Expand Up @@ -747,8 +747,9 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
root = &cnode->rb_root;
}

return __callchain__fprintf_graph(fp, root, total_samples,
ret += __callchain__fprintf_graph(fp, root, total_samples,
1, 1, left_margin);
return ret;
}

static size_t __callchain__fprintf_flat(FILE *fp,
Expand Down

0 comments on commit 8760db7

Please sign in to comment.