Skip to contentSkip to conversation

tracing: Remove tracing_alloc_snapshot() when snapshot isn't defined

PATCH New Steven Rostedt 1 participant 1 message Mar 28 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

PATCH 1/1 tracing: Remove tracing_alloc_snapshot() when snapshot isn't defined

From: Steven Rostedt <[email protected]>

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.

Fixes bade44fe546212 (tracing: Move snapshot code out of trace.c and into trace_snapshot.c)
---
 kernel/trace/trace.c | 7 -------
 1 file changed, 7 deletions(-)
kernel/trace/trace.c +0 -7
index ec2b926436a7..7f2fbf9c36df 100644
@@ -810,19 +810,12 @@ int tracing_alloc_snapshot(void)
 
 	return ret;
 }
-EXPORT_SYMBOL_GPL(tracing_alloc_snapshot);
 #else
 void tracing_snapshot(void)
 {
 	WARN_ONCE(1, "Snapshot feature not enabled, but internal snapshot used");
 }
 EXPORT_SYMBOL_GPL(tracing_snapshot);
-int tracing_alloc_snapshot(void)
-{
-	WARN_ONCE(1, "Snapshot feature not enabled, but snapshot allocation used");
-	return -ENODEV;
-}
-EXPORT_SYMBOL_GPL(tracing_alloc_snapshot);
 void tracing_snapshot_alloc(void)
 {
 	/* Give warning */
Signature · 1 line
2.51.0