mbox series

[bpf-next,v3,0/2] libbpf: Add syscall-specific variant of BPF_KPROBE

Message ID 20220207143134.2977852-1-hengqi.chen@gmail.com (mailing list archive)
Headers show
Series libbpf: Add syscall-specific variant of BPF_KPROBE | expand

Message

Hengqi Chen Feb. 7, 2022, 2:31 p.m. UTC
Add new macro BPF_KPROBE_SYSCALL, which provides easy access to syscall
input arguments. See [0] and [1] for background.

  [0]: https://github.com/libbpf/libbpf-bootstrap/issues/57
  [1]: https://github.com/libbpf/libbpf/issues/425

v2->v3:
  - Use PT_REGS_SYSCALL_REGS
  - Move selftest to progs/bpf_syscall_macro.c

v1->v2:
  - Use PT_REGS_PARM2_CORE_SYSCALL instead

Hengqi Chen (2):
  libbpf: Add BPF_KPROBE_SYSCALL macro
  selftests/bpf: Test BPF_KPROBE_SYSCALL macro

 tools/lib/bpf/bpf_tracing.h                   | 33 +++++++++++++++++++
 .../bpf/prog_tests/test_bpf_syscall_macro.c   |  6 ++++
 .../selftests/bpf/progs/bpf_syscall_macro.c   | 23 +++++++++++++
 3 files changed, 62 insertions(+)

--
2.30.2