Commit 5fb8e565 authored by Benjamin Peterson's avatar Benjamin Peterson Committed by Namhyung Kim
Browse files

perf trace: avoid garbage when not printing a trace event's arguments



trace__fprintf_tp_fields may not print any tracepoint arguments. E.g., if the
argument values are all zero. Previously, this would result in a totally
uninitialized buffer being passed to fprintf, which could lead to garbage on the
console. Fix the problem by passing the number of initialized bytes fprintf.

Fixes: f11b2803 ("perf trace: Allow choosing how to augment the tracepoint arguments")
Signed-off-by: default avatarBenjamin Peterson <benjamin@engflow.com>
Tested-by: default avatarHoward Chu <howardchu95@gmail.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/20241103204816.7834-1-benjamin@engflow.com


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 29bf07bc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment