lkml.org 
[lkml]   [2022]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] tracing/eprobes: Do not hardcode $comm as a string
On Fri, 19 Aug 2022 21:40:37 -0400
Steven Rostedt <rostedt@goodmis.org> 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;
> --

\
 
 \ /
  Last update: 2022-08-20 03:57    [W:0.071 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site