Skip to content

Commit a4f77ff

Browse files
committed
tracing: Make tracing_selftest_running global to the tracing subsystem
The file trace.c has become a catchall for most things tracing. Start making it smaller by breaking out various aspects into their own files. Make the variable tracing_selftest_running global so that it can be used by other files in the tracing subsystem and trace.c can be split up. 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/20260208032449.648932796@kernel.org Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 64dee86 commit a4f77ff

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

kernel/trace/trace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* insertions into the ring-buffer such as trace_printk could occurred
6868
* at the same time, giving false positive or negative results.
6969
*/
70-
static bool __read_mostly tracing_selftest_running;
70+
bool __read_mostly tracing_selftest_running;
7171

7272
/*
7373
* If boot-time tracing including tracers/events via kernel cmdline
@@ -83,7 +83,6 @@ void __init disable_tracing_selftest(const char *reason)
8383
}
8484
}
8585
#else
86-
#define tracing_selftest_running 0
8786
#define tracing_selftest_disabled 0
8887
#endif
8988

kernel/trace/trace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,7 @@ extern int trace_selftest_startup_nop(struct tracer *trace,
863863
struct trace_array *tr);
864864
extern int trace_selftest_startup_branch(struct tracer *trace,
865865
struct trace_array *tr);
866+
extern bool __read_mostly tracing_selftest_running;
866867
/*
867868
* Tracer data references selftest functions that only occur
868869
* on boot up. These can be __init functions. Thus, when selftests
@@ -875,6 +876,7 @@ static inline void __init disable_tracing_selftest(const char *reason)
875876
}
876877
/* Tracers are seldom changed. Optimize when selftests are disabled. */
877878
#define __tracer_data __read_mostly
879+
#define tracing_selftest_running 0
878880
#endif /* CONFIG_FTRACE_STARTUP_TEST */
879881

880882
extern void *head_page(struct trace_array_cpu *data);

0 commit comments

Comments
 (0)