summaryrefslogtreecommitdiff
path: root/tools/perf/util/stat-display.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-06-26 11:42:03 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-06-26 11:42:03 -0300
commit328584804edc950fb4608c9a38e396ac71ef22b6 (patch)
treeea398fb09a36ea3af7f213ccbb2179b1889985d5 /tools/perf/util/stat-display.c
parent526bbbdd442ce143b52cd6a8b4ee424f9930be0d (diff)
perf tools: Ditch rtrim(), use skip_spaces() to get closer to the kernel
No change in behaviour, just using the same kernel idiom for such operation. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: André Goddard Rosa <andre.goddard@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-a85lkptkt0ru40irpga8yf54@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/stat-display.c')
-rw-r--r--tools/perf/util/stat-display.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index ce993d29cca5..90df41169113 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -212,7 +212,7 @@ static void print_metric_csv(struct perf_stat_config *config __maybe_unused,
return;
}
snprintf(buf, sizeof(buf), fmt, val);
- ends = vals = ltrim(buf);
+ ends = vals = skip_spaces(buf);
while (isdigit(*ends) || *ends == '.')
ends++;
*ends = 0;
@@ -280,7 +280,7 @@ static void print_metric_only_csv(struct perf_stat_config *config __maybe_unused
return;
unit = fixunit(tbuf, os->evsel, unit);
snprintf(buf, sizeof buf, fmt, val);
- ends = vals = ltrim(buf);
+ ends = vals = skip_spaces(buf);
while (isdigit(*ends) || *ends == '.')
ends++;
*ends = 0;