aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2016-01-28 12:24:54 +0000
committerArnaldo Carvalho de Melo <[email protected]>2016-02-01 20:51:09 +0000
commit3848c23b19e07188bfa15e3d9a2ac27692f2ff3c (patch)
treed1574887114562c508c484be5ecfdf4be81b0325
parentperf hists browser: Fix percent display in callchains (diff)
downloadkernel-3848c23b19e07188bfa15e3d9a2ac27692f2ff3c.tar.gz
kernel-3848c23b19e07188bfa15e3d9a2ac27692f2ff3c.zip
perf report: Don't show blank lines if entry has no callchain
When all callchains of a hist entry is percent-limited, do not add a blank line at the end. It makes the entry look like it doesn't have callchains. Reported-and-Tested-by: Jiri Olsa <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Cc: Andi Kleen <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wang Nan <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/ui/stdio/hist.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 76ff46becac8..691e52ce7510 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -233,7 +233,10 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
ret += __callchain__fprintf_graph(fp, root, total_samples,
1, 1, left_margin);
- ret += fprintf(fp, "\n");
+ if (ret) {
+ /* do not add a blank line if it printed nothing */
+ ret += fprintf(fp, "\n");
+ }
return ret;
}