diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-08-18 14:33:55 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-18 17:16:15 -0700 |
commit | 70785cfb19287b4b075a266887be5e024bf1206a (patch) | |
tree | 99ac4b66ad36dabb4c06daef3703720854da25f9 /tools/lib/bpf/bpf_tracing.h | |
parent | 02f47faa25db134f6043fb6b12a68b5d4c980bb6 (diff) | |
download | linux-70785cfb19287b4b075a266887be5e024bf1206a.tar.gz linux-70785cfb19287b4b075a266887be5e024bf1206a.tar.bz2 linux-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 <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/bpf/20200818213356.2629020-7-andriin@fb.com
Diffstat (limited to 'tools/lib/bpf/bpf_tracing.h')
-rw-r--r-- | tools/lib/bpf/bpf_tracing.h | 4 |
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 |