diff options
author | Namhyung Kim <namhyung@kernel.org> | 2016-01-28 07:24:54 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-01 15:51:09 -0500 |
commit | 3848c23b19e07188bfa15e3d9a2ac27692f2ff3c (patch) | |
tree | d1574887114562c508c484be5ecfdf4be81b0325 /tools/perf/ui/stdio/hist.c | |
parent | 59c624e2391080fa6315a376a4ee74d0eb393d1d (diff) |
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 <jolsa@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20160128122454.GA27446@danjae.kornet
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/stdio/hist.c')
-rw-r--r-- | tools/perf/ui/stdio/hist.c | 5 |
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, | |||
233 | 233 | ||
234 | ret += __callchain__fprintf_graph(fp, root, total_samples, | 234 | ret += __callchain__fprintf_graph(fp, root, total_samples, |
235 | 1, 1, left_margin); | 235 | 1, 1, left_margin); |
236 | ret += fprintf(fp, "\n"); | 236 | if (ret) { |
237 | /* do not add a blank line if it printed nothing */ | ||
238 | ret += fprintf(fp, "\n"); | ||
239 | } | ||
237 | 240 | ||
238 | return ret; | 241 | return ret; |
239 | } | 242 | } |