]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tracing: Make printk_trace global for tracing system
authorSteven Rostedt <rostedt@goodmis.org>
Sun, 8 Feb 2026 03:24:22 +0000 (22:24 -0500)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Mon, 9 Feb 2026 02:01:12 +0000 (21:01 -0500)
The printk_trace is used to determine which trace_array trace_printk()
writes to. By making it a global variable among the tracing subsystem it
will allow the trace_printk functions to be moved out of trace.c and still
have direct access to that variable.

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.144525891@kernel.org
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c
kernel/trace/trace.h

index a515b5241391eb2ec32a6239d9e0afcc3a1fc7b1..4a73822e2603c91b9ae6d17d7115dec915eeed44 100644 (file)
@@ -534,7 +534,7 @@ static struct trace_array global_trace = {
        .trace_flags = TRACE_DEFAULT_FLAGS,
 };
 
-static struct trace_array *printk_trace = &global_trace;
+struct trace_array *printk_trace = &global_trace;
 
 /* List of trace_arrays interested in the top level trace_marker */
 static LIST_HEAD(marker_copies);
index 605ee23f3262193ed9a4df1c4206ddd6ce458fff..921e4daa282527e712b8c414c6ad0fd5f3541146 100644 (file)
@@ -482,6 +482,8 @@ extern bool trace_clock_in_ns(struct trace_array *tr);
 
 extern unsigned long trace_adjust_address(struct trace_array *tr, unsigned long addr);
 
+extern struct trace_array *printk_trace;
+
 /*
  * The global tracer (top) should be the first trace array added,
  * but we check the flag anyway.