mbox series

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

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

Message

Hengqi Chen Dec. 21, 2021, 5:53 a.m. UTC
Add new macros BPF_KPROBE_SYSCALL/BPF_KRETPROBE_SYSCALL, which provides
easy access to syscall input arguments and return values. See [0] and [1]
for background.

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

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

 tools/lib/bpf/bpf_tracing.h                   | 45 +++++++++++++++++++
 .../selftests/bpf/prog_tests/kprobe_syscall.c | 40 +++++++++++++++++
 .../selftests/bpf/progs/test_kprobe_syscall.c | 41 +++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/kprobe_syscall.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_kprobe_syscall.c

--
2.30.2