Skip to content

Commit 1c53d78

Browse files
committed
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 <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>
1 parent 3e6c8f8 commit 1c53d78

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

kernel/trace/trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static struct trace_array global_trace = {
534534
.trace_flags = TRACE_DEFAULT_FLAGS,
535535
};
536536

537-
static struct trace_array *printk_trace = &global_trace;
537+
struct trace_array *printk_trace = &global_trace;
538538

539539
/* List of trace_arrays interested in the top level trace_marker */
540540
static LIST_HEAD(marker_copies);

kernel/trace/trace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,8 @@ extern bool trace_clock_in_ns(struct trace_array *tr);
482482

483483
extern unsigned long trace_adjust_address(struct trace_array *tr, unsigned long addr);
484484

485+
extern struct trace_array *printk_trace;
486+
485487
/*
486488
* The global tracer (top) should be the first trace array added,
487489
* but we check the flag anyway.

0 commit comments

Comments
 (0)