Message ID | 174188321162.3845006.12665585959241736399.stgit@mhiramat.tok.corp.google.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | tracing: Show last boot module symbols | expand |
On Fri, 14 Mar 2025 01:26:51 +0900 "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote: > @@ -6040,9 +6042,10 @@ static void update_last_data(struct trace_array *tr) > memset(tscratch->entries, 0, > flex_array_size(tscratch, entries, tscratch->nr_entries)); > tscratch->nr_entries = 0; > - > +#ifdef CONFIG_MODULES > guard(mutex)(&scratch_mutex); > module_for_each_mod(save_mod, tr); > +#endif > } Hmm, I think the real fix for this would be to make module_for_each_mod() a nop when modules are not configured. -- Steve
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index c3c79908766e..c70b2e709987 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -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,7 @@ static int save_mod(struct module *mod, void *data) return 0; } +#endif static void update_last_data(struct trace_array *tr) { @@ -6040,9 +6042,10 @@ static void update_last_data(struct trace_array *tr) memset(tscratch->entries, 0, flex_array_size(tscratch, entries, tscratch->nr_entries)); tscratch->nr_entries = 0; - +#ifdef CONFIG_MODULES guard(mutex)(&scratch_mutex); module_for_each_mod(save_mod, tr); +#endif } if (!(tr->flags & TRACE_ARRAY_FL_LAST_BOOT))