[PATCH v2 2/3] perf expr: Add '\n' in literal parse errors
From: Leo Yan
Date: Thu Apr 02 2026 - 12:11:14 EST
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@xxxxxxx>
---
tools/perf/util/expr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
index b7664cb68554b284c2b64ca750bdfb114fa5515e..644769e927089ea1dd2f9252078c35a69fa48dce 100644
--- a/tools/perf/util/expr.c
+++ b/tools/perf/util/expr.c
@@ -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);
--
2.34.1