Move BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE to libbpf
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | bpftool: add header guards to generated vmlinux.htools/ | +5 | 0 replies | |
| 2/4 | libbpf: fix use of PT_REGS_PARM macros with vmlinux.htools/ | +1 | 0 replies | |
| 3/4 | selftests/bpf: fix BPF_KRETPROBE macro and use it in attach_probe testtools/ tools/ tools/ | +11 | 0 replies | |
| 4/4 | libbpf: merge selftests' bpf_trace_helpers.h into libbpf's bpf_tracing.htools/ tools/ tools/ +13 more | +131 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH bpf-next 0/4] Move BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE to libbpf
Move BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE helper macros from private selftests helpers to public libbpf ones. These helpers are extremely helpful for writing tracing BPF applications and have been requested to be exposed for easy use (e.g., [0]).
As part of this move, fix up BPF_KRETPROBE to not allow for capturing input arguments (as it's unreliable and they will be often clobbered). Also, add vmlinux.h header guard to allow multi-time inclusion, if necessary; but also to let PT_REGS_PARM do proper detection of struct pt_regs field names on x86 arch. See relevant patches for more details.
[0] https://github.com/iovisor/bcc/pull/2778#issue-381642907
Andrii Nakryiko (4):
bpftool: add header guards to generated vmlinux.h
libbpf: fix use of PT_REGS_PARM macros with vmlinux.h selftests/bpf: fix BPF_KRETPROBE macro and use it in attach_probe test
libbpf: merge selftests' bpf_trace_helpers.h into libbpf's
bpf_tracing.h
tools/bpf/bpftool/btf.c | 5 + tools/lib/bpf/bpf_tracing.h | 120 +++++++++++++++++- tools/testing/selftests/bpf/bpf_tcp_helpers.h | 2 +- .../testing/selftests/bpf/bpf_trace_helpers.h | 120 ------------------ tools/testing/selftests/bpf/progs/bpf_dctcp.c | 2 +- .../testing/selftests/bpf/progs/fentry_test.c | 2 +- .../selftests/bpf/progs/fexit_bpf2bpf.c | 2 +- .../bpf/progs/fexit_bpf2bpf_simple.c | 2 +- .../testing/selftests/bpf/progs/fexit_test.c | 2 +- tools/testing/selftests/bpf/progs/kfree_skb.c | 2 +- .../selftests/bpf/progs/test_attach_probe.c | 3 +- .../selftests/bpf/progs/test_overhead.c | 7 +- .../selftests/bpf/progs/test_perf_branches.c | 2 +- .../selftests/bpf/progs/test_perf_buffer.c | 2 +- .../selftests/bpf/progs/test_probe_user.c | 1 - .../bpf/progs/test_trampoline_count.c | 3 +- .../selftests/bpf/progs/test_xdp_bpf2bpf.c | 2 +- 17 files changed, 140 insertions(+), 139 deletions(-) delete mode 100644 tools/testing/selftests/bpf/bpf_trace_helpers.h
Signature · 1 line
2.17.1