]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tracing: Fix a compilation error without CONFIG_MODULES
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Tue, 18 Mar 2025 13:39:13 +0000 (22:39 +0900)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 28 Mar 2025 12:39:56 +0000 (08:39 -0400)
There are some code which depends on CONFIG_MODULES. #ifdef
to enclose it.

Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/174230515367.2909896.8132122175220657625.stgit@mhiramat.tok.corp.google.com
Fixes: dca91c1c5468 ("tracing: Have persistent trace instances save module addresses")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace.c

index e7a14bb7d7aae83c4af8d0f33239689ca084fb53..7f8b0c43d2a5063cfc0d7778ef2f4df148f1e0aa 100644 (file)
@@ -6001,6 +6001,7 @@ struct trace_scratch {
 
 static DEFINE_MUTEX(scratch_mutex);
 
+#ifdef CONFIG_MODULES
 static int save_mod(struct module *mod, void *data)
 {
        struct trace_array *tr = data;
@@ -6025,6 +6026,12 @@ static int save_mod(struct module *mod, void *data)
 
        return 0;
 }
+#else
+static int save_mod(struct module *mod, void *data)
+{
+       return 0;
+}
+#endif
 
 static void update_last_data(struct trace_array *tr)
 {