Re: [PATCH v19 04/11] tracing/wprobe: Add wprobe (watchpoint probe) trace event support
From: Masami Hiramatsu (Google)
Date: Sun Nov 15 2026 - 21:15:39 EST
On Sat, 3 Oct 2026 16:53:01 +0900, Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:
> diff --git a/kernel/trace/trace_wprobe.c b/kernel/trace/trace_wprobe.c
> --- a/kernel/trace/trace_wprobe.c
> +++ b/kernel/trace/trace_wprobe.c
> @@ -0,0 +1,775 @@
> + if (system && strcmp(trace_probe_group_name(&tw->tp), system))
> + return false;
> +
> + return trace_probe_match_command_args(&tw->tp, argc, argv);
Oops, this wrongly checks the command argument and targets.
The argv[] is originally something like this:
argv[] = {"w:[system/event]","<target>","<arg0>","<arg1>" ...}
Since the dyn_event_release() passes `argv+1` to .match() function
(original argv[0] is already parsed as @system and @event),
@argv[0] = "<target>" here, and trace_probe_match_command_args()
only for comparing {<arg0>,...} parts.
So wprobe need check "<target>" part by itself, and pass the
@argv+1, @argc-1 to trace_probe_match_command_args().
> +}
> +
> +/*
> [...]
> +
> + for (i = 0; i < tw->tp.nr_args; i++)
> + seq_printf(m, " %s=%s", tw->tp.args[i].name, tw->tp.args[i].comm);
> + seq_putc(m, '\n');
This patch adds `FETCH_OP(BADDR, none)` to `trace_probe.c` for
`CONFIG_PROBE_EVENTS_DUMP_FETCHARG`, but `trace_wprobe_show()` is missing
`trace_probe_dump_args(m, &tw->tp);` before `seq_putc(m, '\n');`.
(Yeah, this debug dump was introduced recently. I missed it.)
Thanks,
> +
> + return 0;
> +}
--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>