The tracing_alloc_snapshot() symbol is always exported even with
!CONFIG_TRACER_SNAPSHOT so the prototype too must be always visible or
we'll see the following warning:

kernel/trace/trace.c:820:5: warning: no previous prototype for 
‘tracing_alloc_snapshot’ [-Wmissing-prototypes]
  820 | int tracing_alloc_snapshot(void)
      |     ^~~~~~~~~~~~~~~~~~~~~~

Fixes: bade44fe5462 ("tracing: Move snapshot code out of trace.c and into 
trace_snapshot.c")
Signed-off-by: Bartosz Golaszewski <[email protected]>
---
 kernel/trace/trace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 6abd9e16ef21..e8612b8b0a34 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -2275,6 +2275,8 @@ static inline void __init trace_event_init(void) { }
 static inline void trace_event_update_all(struct trace_eval_map **map, int 
len) { }
 #endif
 
+int tracing_alloc_snapshot(void);
+
 #ifdef CONFIG_TRACER_SNAPSHOT
 extern const struct file_operations snapshot_fops;
 extern const struct file_operations snapshot_raw_fops;
@@ -2282,7 +2284,6 @@ extern const struct file_operations snapshot_raw_fops;
 /* Used when creating instances */
 int trace_allocate_snapshot(struct trace_array *tr, int size);
 
-int tracing_alloc_snapshot(void);
 void tracing_snapshot_cond(struct trace_array *tr, void *cond_data);
 int tracing_snapshot_cond_enable(struct trace_array *tr, void *cond_data, 
cond_update_fn_t update);
 int tracing_snapshot_cond_disable(struct trace_array *tr);
-- 
2.47.3


Reply via email to