[PATCH 24/43] perf stat: Use recently introduced skip_spaces()

From: Arnaldo Carvalho de Melo
Date: Mon Jul 01 2019 - 22:27:41 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

No change in behaviour.

Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Link: https://lkml.kernel.org/n/tip-ncpvp4eelf8fqhuy29uv56z9@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/stat-display.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 992e327bce85..ce993d29cca5 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <inttypes.h>
+#include <linux/string.h>
#include <linux/time64.h>
#include <math.h>
#include "color.h"
@@ -215,9 +216,7 @@ static void print_metric_csv(struct perf_stat_config *config __maybe_unused,
while (isdigit(*ends) || *ends == '.')
ends++;
*ends = 0;
- while (isspace(*unit))
- unit++;
- fprintf(out, "%s%s%s%s", config->csv_sep, vals, config->csv_sep, unit);
+ fprintf(out, "%s%s%s%s", config->csv_sep, vals, config->csv_sep, skip_spaces(unit));
}

/* Filter out some columns that don't work well in metrics only mode */
--
2.20.1