aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/bpf_tracing.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2020-08-18 21:33:55 +0000
committerAlexei Starovoitov <[email protected]>2020-08-19 00:16:15 +0000
commit70785cfb19287b4b075a266887be5e024bf1206a (patch)
tree99ac4b66ad36dabb4c06daef3703720854da25f9 /tools/lib/bpf/bpf_tracing.h
parentselftests/bpf: Fix test_vmlinux test to use bpf_probe_read_user() (diff)
downloadkernel-70785cfb19287b4b075a266887be5e024bf1206a.tar.gz
kernel-70785cfb19287b4b075a266887be5e024bf1206a.zip
libbpf: Switch tracing and CO-RE helper macros to bpf_probe_read_kernel()
Now that libbpf can automatically fallback to bpf_probe_read() on old kernels not yet supporting bpf_probe_read_kernel(), switch libbpf BPF-side helper macros to use appropriate BPF helper for reading kernel data. Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Cc: Ilya Leoshkevich <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf_tracing.h')
-rw-r--r--tools/lib/bpf/bpf_tracing.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index eebf020cbe3e..f9ef37707888 100644
--- a/tools/lib/bpf/bpf_tracing.h
+++ b/tools/lib/bpf/bpf_tracing.h
@@ -289,9 +289,9 @@ struct pt_regs;
#define BPF_KRETPROBE_READ_RET_IP BPF_KPROBE_READ_RET_IP
#else
#define BPF_KPROBE_READ_RET_IP(ip, ctx) \
- ({ bpf_probe_read(&(ip), sizeof(ip), (void *)PT_REGS_RET(ctx)); })
+ ({ bpf_probe_read_kernel(&(ip), sizeof(ip), (void *)PT_REGS_RET(ctx)); })
#define BPF_KRETPROBE_READ_RET_IP(ip, ctx) \
- ({ bpf_probe_read(&(ip), sizeof(ip), \
+ ({ bpf_probe_read_kernel(&(ip), sizeof(ip), \
(void *)(PT_REGS_FP(ctx) + sizeof(ip))); })
#endif