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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user