libbpf-bootstrap
libbpf-bootstrap copied to clipboard
ksyscall example
Libbpf v1 introduced ksyscall option to trace syscalls, an example for the feature would be helpful
There are a lot of test cases under tools/testing/selftests/bpf directory of Linux. You may want to check there for examples that you don't find here.
FYI https://github.com/torvalds/linux/blob/master/tools/testing/selftests/bpf/progs/test_probe_user.c
@ThinkerYzu1 yes, selftests can serve as an example, but having minimal self-contained and simple examples in libbpf-bootstrap is extremely helpful. I do agree that we should either add a separate ksyscall example or extend kprobe one to also show ksyscall one. So let's keep this issue for now until someone finds time to contribute such an example.
we have ksyscall example now: https://github.com/libbpf/libbpf-bootstrap/blob/master/examples/c/ksyscall.bpf.c