]> Gentwo Git Trees - linux/.git/commit
tracing: Add a config and syscall_user_buf_size file to limit amount written
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 28 Oct 2025 23:11:22 +0000 (19:11 -0400)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 29 Oct 2025 00:10:59 +0000 (20:10 -0400)
commit299ea67e6a2b3d0d4b707f45b8c66d8b4bbbf2c6
treee6c6997f778e3ca6909175a1aca5f30bf130c199
parentbaa031b7bd2ce7502339174a42974321859ecd6a
tracing: Add a config and syscall_user_buf_size file to limit amount written

When a system call that can copy user space addresses into the ring
buffer, it can copy up to 511 bytes of data. This can waste precious ring
buffer space if the user isn't interested in the output. Add a new file
"syscall_user_buf_size" that gets initialized to a new config
CONFIG_SYSCALL_BUF_SIZE_DEFAULT that defaults to 63.

The config also is used to limit how much perf can read from user space.

Also lower the max down to 165, as this isn't to record everything that a
system call may be passing through to the kernel. 165 is more than enough.

The reason for 165 is because adding one for the nul terminating byte, as
well as possibly needing to append the "..." string turns it into 170
bytes. As this needs to save up to 3 arguments and 3 * 170 is 510 which
fits nicely in 512 bytes (a power of 2).

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Takaya Saeki <takayas@google.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ian Rogers <irogers@google.com>
Cc: Douglas Raillard <douglas.raillard@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Link: https://lore.kernel.org/20251028231148.260068913@kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Documentation/trace/ftrace.rst
kernel/trace/Kconfig
kernel/trace/trace.c
kernel/trace/trace.h
kernel/trace/trace_syscalls.c