tracing: Make printk_trace global for tracing system

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 <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Andrew Morton <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Steven Rostedt (Google) <[email protected]>
This commit is contained in:
Steven Rostedt
2026-02-08 21:01:12 -05:00
committed by Steven Rostedt (Google)
parent 3e6c8f80e5
commit 1c53d781d4
2 changed files with 3 additions and 1 deletions
+1 -1
View 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);
+2
View 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.