Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b37d33ed authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

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: default avatarJiri 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 9660e08e
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -1008,10 +1008,7 @@ static void print_metric_only(void *ctx, const char *color, const char *fmt,
	if (!valid_only_metric(unit))
		return;
	unit = fixunit(buf, os->evsel, unit);
	if (color)
		n = color_fprintf(out, color, fmt, val);
	else
		n = fprintf(out, fmt, val);
	n = color_fprintf(out, color ?: "", fmt, val);
	if (n > METRIC_ONLY_LEN)
		n = METRIC_ONLY_LEN;
	if (mlen < strlen(unit))