Skip to content

Commit

Permalink
tracing: Fix a compilation error without CONFIG_MODULES
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masami Hiramatsu (Google) authored and Steven Rostedt (Google) committed Mar 28, 2025
1 parent fb6d032 commit f00c920
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down

0 comments on commit f00c920

Please sign in to comment.