tracing: Fix a compilation error without CONFIG_MODULES

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>
This commit is contained in:
Masami Hiramatsu (Google) 2025-03-18 22:39:13 +09:00 committed by Steven Rostedt (Google)
parent fb6d03238e
commit f00c9201f9

View 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)
{