Skip to content

Commit 12707b9

Browse files
chengshuyianakryiko
authored andcommitted
libbpf: Fixed getting wrong return address on arm64 architecture
ARM64 has a separate lr register to store the return address, so here you only need to read the lr register to get the return address, no need to dereference it again. Signed-off-by: Shuyi Cheng <chengshuyi@linux.alibaba.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/1725787433-77262-1-git-send-email-chengshuyi@linux.alibaba.com
1 parent 8a3f14b commit 12707b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/lib/bpf/bpf_tracing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ struct pt_regs;
522522
#define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = (ctx)->link; })
523523
#define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP
524524

525-
#elif defined(bpf_target_sparc)
525+
#elif defined(bpf_target_sparc) || defined(bpf_target_arm64)
526526

527527
#define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = PT_REGS_RET(ctx); })
528528
#define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP

0 commit comments

Comments
 (0)