* [PATCH] tracing/probes: make file offset error message probe-agnostic
@ 2026-06-22 16:00 Yudistira Putra
2026-06-23 10:53 ` Masami Hiramatsu
0 siblings, 1 reply; 2+ messages in thread
From: Yudistira Putra @ 2026-06-22 16:00 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu
Cc: Mathieu Desnoyers, linux-trace-kernel, linux-kernel,
Yudistira Putra
The shared probe argument parser rejects file offsets for kernel probes.
This path is used outside the kprobe event parser too, but the diagnostic
currently says "with kprobe" even when emitted from another probe path.
Make the diagnostic probe-agnostic.
Signed-off-by: Yudistira Putra <pyudistira519@gmail.com>
---
kernel/trace/trace_probe.c | 2 +-
kernel/trace/trace_probe.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index fd1caa1f9723..fec0ad51cf61 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -1228,7 +1228,7 @@ parse_probe_arg(char *arg, const struct fetch_type *type,
code->op = FETCH_OP_IMM;
code->immediate = param;
} else if (arg[1] == '+') {
- /* kprobes don't support file offsets */
+ /* Kernel probes do not support file offsets */
if (ctx->flags & TPARG_FL_KERNEL) {
trace_probe_log_err(ctx->offset, FILE_ON_KPROBE);
return -EINVAL;
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index 15758cc11fc6..6162f066c2b8 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -516,7 +516,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,
C(BAD_MEM_ADDR, "Invalid memory address"), \
C(BAD_IMM, "Invalid immediate value"), \
C(IMMSTR_NO_CLOSE, "String is not closed with '\"'"), \
- C(FILE_ON_KPROBE, "File offset is not available with kprobe"), \
+ C(FILE_ON_KPROBE, "File offset is not available for kernel probes"), \
C(BAD_FILE_OFFS, "Invalid file offset value"), \
C(SYM_ON_UPROBE, "Symbol is not available with uprobe"), \
C(TOO_MANY_OPS, "Dereference is too much nested"), \
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] tracing/probes: make file offset error message probe-agnostic
2026-06-22 16:00 [PATCH] tracing/probes: make file offset error message probe-agnostic Yudistira Putra
@ 2026-06-23 10:53 ` Masami Hiramatsu
0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2026-06-23 10:53 UTC (permalink / raw)
To: Yudistira Putra
Cc: Steven Rostedt, Mathieu Desnoyers, linux-trace-kernel,
linux-kernel
On Mon, 22 Jun 2026 12:00:32 -0400
Yudistira Putra <pyudistira519@gmail.com> wrote:
> The shared probe argument parser rejects file offsets for kernel probes.
> This path is used outside the kprobe event parser too, but the diagnostic
> currently says "with kprobe" even when emitted from another probe path.
>
> Make the diagnostic probe-agnostic.
>
Looks good to me. Let me pick it.
Thanks!
> Signed-off-by: Yudistira Putra <pyudistira519@gmail.com>
> ---
> kernel/trace/trace_probe.c | 2 +-
> kernel/trace/trace_probe.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
> index fd1caa1f9723..fec0ad51cf61 100644
> --- a/kernel/trace/trace_probe.c
> +++ b/kernel/trace/trace_probe.c
> @@ -1228,7 +1228,7 @@ parse_probe_arg(char *arg, const struct fetch_type *type,
> code->op = FETCH_OP_IMM;
> code->immediate = param;
> } else if (arg[1] == '+') {
> - /* kprobes don't support file offsets */
> + /* Kernel probes do not support file offsets */
> if (ctx->flags & TPARG_FL_KERNEL) {
> trace_probe_log_err(ctx->offset, FILE_ON_KPROBE);
> return -EINVAL;
> diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
> index 15758cc11fc6..6162f066c2b8 100644
> --- a/kernel/trace/trace_probe.h
> +++ b/kernel/trace/trace_probe.h
> @@ -516,7 +516,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,
> C(BAD_MEM_ADDR, "Invalid memory address"), \
> C(BAD_IMM, "Invalid immediate value"), \
> C(IMMSTR_NO_CLOSE, "String is not closed with '\"'"), \
> - C(FILE_ON_KPROBE, "File offset is not available with kprobe"), \
> + C(FILE_ON_KPROBE, "File offset is not available for kernel probes"), \
> C(BAD_FILE_OFFS, "Invalid file offset value"), \
> C(SYM_ON_UPROBE, "Symbol is not available with uprobe"), \
> C(TOO_MANY_OPS, "Dereference is too much nested"), \
> --
> 2.43.0
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-23 10:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22 16:00 [PATCH] tracing/probes: make file offset error message probe-agnostic Yudistira Putra
2026-06-23 10:53 ` Masami Hiramatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox