Skip to contentSkip to conversation

tracing/probes: Point the error offset correctly for eprobe argument error

PATCH In review Masami Hiramatsu (Google) 2 participants 3 messages May 25 – May 30

Subsystems (2)
lore
Share & tools
lore

Masami Hiramatsu (Google)

author maintainer
#0 lore raw

PATCH 1/1 tracing/probes: Point the error offset correctly for eprobe argument error

From: Masami Hiramatsu (Google) <[email protected]>

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")
---
 kernel/trace/trace_probe.c                         |    2 --
 .../test.d/dynevent/eprobes_syntax_errors.tc       |    2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
kernel/trace/trace_probe.c +0 -2
index 39f040c863e8..695310571b08 100644
@@ -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;
 	}
 
tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc +1 -1
index 4f5e8c665156..2a680c086047 100644
@@ -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
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Mon, 25 May 2026 11:21:14 +0900 "Masami Hiramatsu (Google)"…

From: Masami Hiramatsu (Google) <[email protected]>

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.

Quoted 3 lines
Fixes 1b8b0cd754cd ("tracing/probes: Move event parameter fetching code to common parser")

-- Steve

author maintainer
#2 lore raw
Quoted 13 lines · On Thu, 28 May 2026 22:29:34 -0400 Steven Rostedt <[email protected]> wrote:
Quoted 10 lines · On Mon, 25 May 2026 11:21:14 +0900 "Masami Hiramatsu (Google)"…

From: Masami Hiramatsu (Google) <[email protected]>

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.

Quoted 6 lines
Quoted 3 lines
Fixes 1b8b0cd754cd ("tracing/probes: Move event parameter fetching code to common parser")

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

Quoted 1 line

-- Steve

Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>