diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-09-02 22:53:07 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-08 12:19:55 -0400 |
commit | 9ffad987ff565999d91fc2783dd77f08094a743b (patch) | |
tree | d257da6adbc2d099fe1b224d2432d3c1f8e94e21 /tools/perf/ui/stdio | |
parent | ea251d51d2c7d7233790123227f787c477f567f5 (diff) |
perf hists: Handle field separator properly
When a field separator is given, the output format doesn't need to be
fancy like aligning to column length, coloring the percent value and so
on. And since there's a slight difference to normal format, fix it not
to break backward compatibility.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1346640790-17197-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/stdio')
-rw-r--r-- | tools/perf/ui/stdio/hist.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 4228b4c6b72d..882461a42830 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -319,11 +319,12 @@ static int hist_entry__fprintf(struct hist_entry *he, size_t size, | |||
319 | .displacement = displacement, | 319 | .displacement = displacement, |
320 | .ptr = pair_hists, | 320 | .ptr = pair_hists, |
321 | }; | 321 | }; |
322 | bool color = !symbol_conf.field_sep; | ||
322 | 323 | ||
323 | if (size == 0 || size > sizeof(bf)) | 324 | if (size == 0 || size > sizeof(bf)) |
324 | size = hpp.size = sizeof(bf); | 325 | size = hpp.size = sizeof(bf); |
325 | 326 | ||
326 | ret = hist_entry__period_snprintf(&hpp, he, true); | 327 | ret = hist_entry__period_snprintf(&hpp, he, color); |
327 | hist_entry__sort_snprintf(he, bf + ret, size - ret, hists); | 328 | hist_entry__sort_snprintf(he, bf + ret, size - ret, hists); |
328 | 329 | ||
329 | ret = fprintf(fp, "%s\n", bf); | 330 | ret = fprintf(fp, "%s\n", bf); |