diff mbox series

[1/2] tracing/probes: Fix to return NULL and keep using current argc

Message ID 168584574094.2056209.2694238431743782342.stgit@mhiramat.roam.corp.google.com (mailing list archive)
State Accepted
Commit ed5f297802fca41d88fbfa6f9c13b218e7c6f5cb
Headers show
Series [1/2] tracing/probes: Fix to return NULL and keep using current argc | expand

Commit Message

Masami Hiramatsu (Google) June 4, 2023, 2:29 a.m. UTC
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Fix to return NULL and keep using current argc when there is
$argN and the BTF is not available.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306030940.Cej2JoUx-lkp@intel.com/
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 kernel/trace/trace_probe.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Steven Rostedt June 21, 2023, 4:44 p.m. UTC | #1
On Sun,  4 Jun 2023 11:29:00 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Fix to return NULL and keep using current argc when there is
> $argN and the BTF is not available.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202306030940.Cej2JoUx-lkp@intel.com/
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

> ---
>  kernel/trace/trace_probe.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index ba1c6e059b51..473e1c43bc57 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -1273,7 +1273,8 @@ const char **traceprobe_expand_meta_args(int argc, const char *argv[],
>  			trace_probe_log_err(0, NOSUP_BTFARG);
>  			return (const char **)params;
>  		}
> -		return 0;
> +		*new_argc = argc;
> +		return NULL;
>  	}
>  	ctx->params = params;
>  	ctx->nr_params = nr_params;
diff mbox series

Patch

diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index ba1c6e059b51..473e1c43bc57 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1273,7 +1273,8 @@  const char **traceprobe_expand_meta_args(int argc, const char *argv[],
 			trace_probe_log_err(0, NOSUP_BTFARG);
 			return (const char **)params;
 		}
-		return 0;
+		*new_argc = argc;
+		return NULL;
 	}
 	ctx->params = params;
 	ctx->nr_params = nr_params;