tracing: Limit trace_marker writes to just 4K
authorSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 5 Mar 2024 03:34:33 +0000 (22:34 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 6 Mar 2024 18:27:26 +0000 (13:27 -0500)
commit095fe4891282be510af0db1b03587b512c0de31d
treee1acce266710a4ae05b849543af2ca4e0c8dd56e
parent6f42249fecb94dfb6514ed241475f748c03d62fb
tracing: Limit trace_marker writes to just 4K

Limit the max print event of trace_marker to just 4K string size. This must
also be less than the amount that can be held by a trace_seq along with
the text that is before the output (like the task name, PID, CPU, state,
etc). As trace_seq is made to handle large events (some greater than 4K).
Make the max size of a trace_marker write event be 4K which is guaranteed
to fit in the trace_seq buffer.

Link: https://lore.kernel.org/linux-trace-kernel/20240304223433.4ba47dff@gandalf.local.home
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c