[PATCH 0/2] perf trace: Improve augmented buf output formatting, fix test output

From: Marek Pazur

Date: Wed Dec 02 2026 - 07:16:45 EST


Currently, perf trace prints augmented buf arguments without delimiters
or backslash escaping. When buffer payloads contain commas, quotes,
or escape-like sequences, the output becomes ambiguous to parse
reliably in automated tests. Additionally, the buffer augmentation
shell test passes captured perf trace output directly into printf's
format string, causing non-printable decimal escapes (such as "\10")
to be misinterpreted and corrupt failure logs.

This series addresses both issues:

- Patch 1 fixes printf format-string expansion in the buffer
augmentation shell test by passing trace output via "%s".
- Patch 2 encloses augmented buf output in double quotes and escapes
'"' and '\' and updates the buffer augmentation shell tests
accordingly.

Marek Pazur (2):
perf test trace_btf_general: Use %s format specifier when printing
test output
perf trace: Quote and escape augmented buffer contents

tools/perf/builtin-trace.c | 14 ++++++++++++--
tools/perf/tests/shell/trace_btf_general.sh | 8 ++++----
2 files changed, 16 insertions(+), 6 deletions(-)

--
2.55.0