Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Make tracing_update_buffers() take NULL for global_trace

The trace.c file has become a dumping ground for all tracing code and has
become quite large. In order to move the trace_printk functions out of it
these functions can not access global_trace directly, as that is something
that needs to stay static in trace.c.

Have tracing_update_buffers() take NULL for its trace_array to denote it
should work on the global_trace top level trace_array allows that function
to be used outside of trace.c and still update the global_trace
trace_array.

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>
Link: https://patch.msgid.link/20260208032450.318864210@kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+4 -1
+4 -1
kernel/trace/trace.c
··· 3234 3234 pr_warn("**********************************************************\n"); 3235 3235 3236 3236 /* Expand the buffers to set size */ 3237 - if (tracing_update_buffers(&global_trace) < 0) 3237 + if (tracing_update_buffers(NULL) < 0) 3238 3238 pr_err("Failed to expand tracing buffers for trace_printk() calls\n"); 3239 3239 else 3240 3240 buffers_allocated = 1; ··· 6185 6185 int tracing_update_buffers(struct trace_array *tr) 6186 6186 { 6187 6187 int ret = 0; 6188 + 6189 + if (!tr) 6190 + tr = &global_trace; 6188 6191 6189 6192 guard(mutex)(&trace_types_lock); 6190 6193