Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Shuyi Cheng and committed by
Andrii Nakryiko
12707b91 8a3f14bb

+1 -1
+1 -1
tools/lib/bpf/bpf_tracing.h
··· 522 522 #define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = (ctx)->link; }) 523 523 #define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP 524 524 525 - #elif defined(bpf_target_sparc) 525 + #elif defined(bpf_target_sparc) || defined(bpf_target_arm64) 526 526 527 527 #define BPF_KPROBE_READ_RET_IP(ip, ctx) ({ (ip) = PT_REGS_RET(ctx); }) 528 528 #define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP