Skip to contentSkip to conversation

bpf: Fix ___bpf_kretprobe_args1(x) macro definition.

PATCH In review Wenbo Zhang 3 participants 3 messages Mar 15, 2020 – Mar 17, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf: Fix ___bpf_kretprobe_args1(x) macro definition.

Use PT_REGS_RC instead of PT_REGS_RET to get ret currectly.

---
 tools/lib/bpf/bpf_tracing.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/bpf_tracing.h +1 -1
index b0c9ae5c73b5..f3f3c3fb98cb 100644
@@ -390,7 +390,7 @@ ____##name(struct pt_regs *ctx, ##args)
 
 #define ___bpf_kretprobe_args0() ctx
 #define ___bpf_kretprobe_args1(x) \
-	___bpf_kretprobe_args0(), (void *)PT_REGS_RET(ctx)
+	___bpf_kretprobe_args0(), (void *)PT_REGS_RC(ctx)
 #define ___bpf_kretprobe_args(args...) \
 	___bpf_apply(___bpf_kretprobe_args, ___bpf_narg(args))(args)
 
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Wenbo Zhang

Use PT_REGS_RC instead of PT_REGS_RET to get ret currectly.

---

Thanks!

Fixes df8ff35311c8 ("libbpf: Merge selftests' bpf_trace_helpers.h

into libbpf's bpf_tracing.h")

Quoted 19 lines
 tools/lib/bpf/bpf_tracing.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/bpf_tracing.h +1 -2
index b0c9ae5c73b5..f3f3c3fb98cb 100644
@@ -390,7 +390,7 @@ ____##name(struct pt_regs *ctx, ##args)
 
 #define ___bpf_kretprobe_args0() ctx
 #define ___bpf_kretprobe_args1(x) \
-       ___bpf_kretprobe_args0(), (void *)PT_REGS_RET(ctx)
+       ___bpf_kretprobe_args0(), (void *)PT_REGS_RC(ctx)
 #define ___bpf_kretprobe_args(args...) \
        ___bpf_apply(___bpf_kretprobe_args, ___bpf_narg(args))(args)
 
--

2.17.1