Re: [PATCH 2/4] tracing/eprobes: Do not hardcode $comm as a string

From: Steven Rostedt
Date: Fri Aug 19 2022 - 21:56:54 EST


On Fri, 19 Aug 2022 21:40:37 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> +++ b/kernel/trace/trace_probe.c
> @@ -622,9 +622,10 @@ static int traceprobe_parse_probe_arg_body(const char *argv, ssize_t *size,
>
> /*
> * Since $comm and immediate string can not be dereferenced,
> - * we can find those by strcmp.
> + * we can find those by strcmp. But ignore for eprobes.
> */
> - if (strcmp(arg, "$comm") == 0 || strncmp(arg, "\\\"", 2) == 0) {
> + if (!(flags & TPARG_FL_TPOINT) &&
> + strcmp(arg, "$comm") == 0 || strncmp(arg, "\\\"", 2) == 0) {

And my tests fail shortly after I send this. It complains about a new
warning. The above needs parenthesis around it.

Will send a v2 after my tests pass, in case it finds something else I
missed.

-- Steve



> /* The type of $comm must be "string", and not an array. */
> if (parg->count || (t && strcmp(t, "string")))
> goto out;
> --