diff options
author | Jiri Olsa <jolsa@kernel.org> | 2018-06-06 18:15:07 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-06-07 14:58:13 -0400 |
commit | b37d33edbf41b532ddd156707c037c6f4784e40b (patch) | |
tree | 24c80cc9a2f9ed7e838a81bfb203e7b22f8d6705 /tools/perf | |
parent | 9660e08ee8cbc94ac835f2c30576c6e51fbece8f (diff) |
perf stat: Use only color_fprintf call in print_metric_only
We can call color_fprintf also for non color case, it's handled
properly. This change simplifies following patch.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20180606221513.11302-5-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-stat.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index f1532e3ac7d7..9e7b6f108956 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -1008,10 +1008,7 @@ static void print_metric_only(void *ctx, const char *color, const char *fmt, | |||
1008 | if (!valid_only_metric(unit)) | 1008 | if (!valid_only_metric(unit)) |
1009 | return; | 1009 | return; |
1010 | unit = fixunit(buf, os->evsel, unit); | 1010 | unit = fixunit(buf, os->evsel, unit); |
1011 | if (color) | 1011 | n = color_fprintf(out, color ?: "", fmt, val); |
1012 | n = color_fprintf(out, color, fmt, val); | ||
1013 | else | ||
1014 | n = fprintf(out, fmt, val); | ||
1015 | if (n > METRIC_ONLY_LEN) | 1012 | if (n > METRIC_ONLY_LEN) |
1016 | n = METRIC_ONLY_LEN; | 1013 | n = METRIC_ONLY_LEN; |
1017 | if (mlen < strlen(unit)) | 1014 | if (mlen < strlen(unit)) |