diff options
author | Julia Kartseva <hex@fb.com> | 2020-11-14 02:02:50 +0100 |
---|---|---|
committer | Julia Kartseva <hex@fb.com> | 2021-04-27 01:07:41 +0200 |
commit | cf4f9a57f20f1b21d59574e1f0cb6504506f1728 (patch) | |
tree | 116a082bae3934858d3610f8e638c37fc1b41d52 /tools/check-directives.sh | |
parent | bpf: add socket-bind BPF program code sources (diff) | |
download | systemd-cf4f9a57f20f1b21d59574e1f0cb6504506f1728.tar.xz systemd-cf4f9a57f20f1b21d59574e1f0cb6504506f1728.zip |
bpf: add build script for bpf programs
Add a build script to compile bpf source code. A program in restricted
C is compiled into an object file. Object file is converted to BPF
skeleton [0] header file.
If build with custom meson build rule, the target header will reside in
build/ directory (not in source tree), e.g the path for socket_bind:
`build/src/core/bpf/socket_bind/socket-bind.skel.h`
Script runs the phases:
* clang to generate *.o from restricted C
* llvm-strip to remove useless DWARF info
* bpf skeleton generation with bpftool
These phases are logged to stderr for debug purposes.
To include BTF debug information, -g option is passed to clang.
[0] https://lwn.net/Articles/806911/
Diffstat (limited to 'tools/check-directives.sh')
0 files changed, 0 insertions, 0 deletions