Re: [PATCH] tracing/eprobe: Install the trigger for every instance that enables the eprobe

From: Masami Hiramatsu (Google)

Date: Fri Nov 06 2026 - 06:07:07 EST


On Sat, 31 Oct 2026 20:39:15 +0000, David Carlier <devnexen@xxxxxxxxx> wrote:

> diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c
> --- a/kernel/trace/trace_eprobe.c
> +++ b/kernel/trace/trace_eprobe.c
> @@ -661,20 +661,20 @@ static int enable_trace_eprobe(struct trace_event_call *call,
> trace_probe_set_flag(tp, TP_FLAG_PROFILE);
>
> + /* The trigger lives in the instance of the file, add it for each file */
> + if (!file && enabled)

Hmm, when reviewing this patch, I found file should not be NULL
because enable/disable_trace_eprobe() are only ever called via
eprobe_register() with `TRACE_REG_REGISTER/UNREGISTER` where `file` is
always non-NULL.

So we should expect !file case is a bug. So at the entry of these functions
we can add:

if (WARN_ON_ONCE(!file))
return -EINVAL;

and remove !file blocks.

Thanks!

> return 0;
>
> for_each_trace_eprobe_tp(ep, tp) {

--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>