perf expr: Add '\n' in literal parse errors

Add a trailing newline for logs.

Before:

  perf stat -C 5
  Failure to read '#slots'Cannot find metric or group `Default'

After:

  perf stat -C 5
  Failure to read '#slots'
  Cannot find metric or group `Default'

Signed-off-by: Leo Yan <leo.yan@arm.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
Leo Yan
2026-04-02 17:04:48 +01:00
committed by Namhyung Kim
parent 3a61fd866e
commit d148934bee

View File

@@ -407,9 +407,9 @@ double expr__get_literal(const char *literal, const struct expr_scanner_ctx *ctx
&count))
result = count;
else
pr_err("Failure to read '%s'", literal);
pr_err("Failure to read '%s'\n", literal);
} else {
pr_err("Unrecognized literal '%s'", literal);
pr_err("Unrecognized literal '%s'\n", literal);
}
pr_debug2("literal: %s = %f\n", literal, result);