Re: [PATCH v4 1/2] tracing: Fix a compilation error without CONFIG_MODULES
From: Steven Rostedt
Date: Fri Mar 14 2025 - 05:43:10 EST
On Fri, 14 Mar 2025 01:26:51 +0900
"Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> 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