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: Remove tracing_alloc_snapshot() when snapshot isn't defined

The function tracing_alloc_snapshot() is only used between trace.c and
trace_snapshot.c. When snapshot isn't configured, it's not used at all.
The stub function was defined as a global with no users and no prototype
causing build issues.

Remove the function when snapshot isn't configured as nothing is calling
it.

Also remove the EXPORT_SYMBOL_GPL() that was associated with it as it's
not used outside of the tracing subsystem which also includes any modules.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20260328101946.2c4ef4a5@robin
Reported-by: Mark Brown <broonie@kernel.org>
Closes: https://lore.kernel.org/all/acb-IuZ4vDkwwQLW@sirena.co.uk/
Fixes: bade44fe546212 (tracing: Move snapshot code out of trace.c and into trace_snapshot.c)
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-7
-7
kernel/trace/trace.c
··· 810 810 811 811 return ret; 812 812 } 813 - EXPORT_SYMBOL_GPL(tracing_alloc_snapshot); 814 813 #else 815 814 void tracing_snapshot(void) 816 815 { 817 816 WARN_ONCE(1, "Snapshot feature not enabled, but internal snapshot used"); 818 817 } 819 818 EXPORT_SYMBOL_GPL(tracing_snapshot); 820 - int tracing_alloc_snapshot(void) 821 - { 822 - WARN_ONCE(1, "Snapshot feature not enabled, but snapshot allocation used"); 823 - return -ENODEV; 824 - } 825 - EXPORT_SYMBOL_GPL(tracing_alloc_snapshot); 826 819 void tracing_snapshot_alloc(void) 827 820 { 828 821 /* Give warning */