Linux Trace Kernel
 help / color / mirror / Atom feed
* [PATCH] tracing/probes: Point the error offset correctly for eprobe argument error
@ 2026-05-25  2:21 Masami Hiramatsu (Google)
  2026-05-29  2:29 ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Masami Hiramatsu (Google) @ 2026-05-25  2:21 UTC (permalink / raw)
  To: Steven Rostedt, Shuah Khan
  Cc: Masami Hiramatsu, Mathieu Desnoyers, linux-kernel,
	linux-trace-kernel, linux-kselftest

From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Fix to point the error offset correctly for eprobe argument error.
In the cleanup commit 1b8b0cd754cd ("tracing/probes: Move event parameter
fetching code to common parser"), due to incorrect backward compatibility
aimed at conforming to the test specifications, the error location was set
to 0 when a non-existent formal parameter was specified for Eprobe.
However, this should be corrected in both the test and the implementation
to point correct error position.

Fixes: 1b8b0cd754cd ("tracing/probes: Move event parameter fetching code to common parser")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 kernel/trace/trace_probe.c                         |    2 --
 .../test.d/dynevent/eprobes_syntax_errors.tc       |    2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 39f040c863e8..695310571b08 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -957,8 +957,6 @@ static int parse_probe_vars(char *orig_arg, const struct fetch_type *t,
 			code->op = FETCH_OP_COMM;
 			return 0;
 		}
-		/* backward compatibility */
-		ctx->offset = 0;
 		goto inval;
 	}
 
diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc
index 4f5e8c665156..2a680c086047 100644
--- a/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc
+++ b/tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc
@@ -20,7 +20,7 @@ check_error 'e:foo/^123456789012345678901234567890123456789012345678901234567890
 check_error 'e:foo/^bar.1 syscalls/sys_enter_openat'	# BAD_EVENT_NAME
 
 check_error 'e:foo/bar syscalls/sys_enter_openat arg=^dfd'	# BAD_FETCH_ARG
-check_error 'e:foo/bar syscalls/sys_enter_openat ^arg=$foo'	# BAD_ATTACH_ARG
+check_error 'e:foo/bar syscalls/sys_enter_openat arg=^$foo'	# BAD_ATTACH_ARG
 
 if grep -q '<attached-group>\.<attached-event>.*\[if <filter>\]' README; then
   check_error 'e:foo/bar syscalls/sys_enter_openat if ^'	# NO_EP_FILTER


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing/probes: Point the error offset correctly for eprobe argument error
  2026-05-25  2:21 [PATCH] tracing/probes: Point the error offset correctly for eprobe argument error Masami Hiramatsu (Google)
@ 2026-05-29  2:29 ` Steven Rostedt
  2026-05-30 13:46   ` Masami Hiramatsu
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2026-05-29  2:29 UTC (permalink / raw)
  To: Masami Hiramatsu (Google)
  Cc: Shuah Khan, Mathieu Desnoyers, linux-kernel, linux-trace-kernel,
	linux-kselftest

On Mon, 25 May 2026 11:21:14 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:

> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Fix to point the error offset correctly for eprobe argument error.
> In the cleanup commit 1b8b0cd754cd ("tracing/probes: Move event parameter
> fetching code to common parser"), due to incorrect backward compatibility
> aimed at conforming to the test specifications, the error location was set
> to 0 when a non-existent formal parameter was specified for Eprobe.
> However, this should be corrected in both the test and the implementation
> to point correct error position.
> 
> Fixes: 1b8b0cd754cd ("tracing/probes: Move event parameter fetching code to common parser")
> Cc: stable@vger.kernel.org
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

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

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tracing/probes: Point the error offset correctly for eprobe argument error
  2026-05-29  2:29 ` Steven Rostedt
@ 2026-05-30 13:46   ` Masami Hiramatsu
  0 siblings, 0 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2026-05-30 13:46 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Shuah Khan, Mathieu Desnoyers, linux-kernel, linux-trace-kernel,
	linux-kselftest

On Thu, 28 May 2026 22:29:34 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Mon, 25 May 2026 11:21:14 +0900
> "Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> 
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > 
> > Fix to point the error offset correctly for eprobe argument error.
> > In the cleanup commit 1b8b0cd754cd ("tracing/probes: Move event parameter
> > fetching code to common parser"), due to incorrect backward compatibility
> > aimed at conforming to the test specifications, the error location was set
> > to 0 when a non-existent formal parameter was specified for Eprobe.
> > However, this should be corrected in both the test and the implementation
> > to point correct error position.
> > 
> > Fixes: 1b8b0cd754cd ("tracing/probes: Move event parameter fetching code to common parser")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> 
> Reviewed-by: Steven Rostedt <rostedt@goodmis.org>
> 

Thanks! Let me pick this to probes/fixes branch.


> -- Steve


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-30 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25  2:21 [PATCH] tracing/probes: Point the error offset correctly for eprobe argument error Masami Hiramatsu (Google)
2026-05-29  2:29 ` Steven Rostedt
2026-05-30 13:46   ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox