Conversion from BTF to WIT.
Usage: btf2wit [OPTIONS] <INPUT_FILE>
Arguments:
<INPUT_FILE>
Options:
-o, --output-file <OUT_FILE>
-h, --help Print help
-V, --version Print version
- Install
pahole
sudo apt install pahole
- Use clang or gcc to compile program with
-g
argument
clang simple.c -c -o simple.bpf.o -g
- Use pahole to emit BTF info from DWARF and store it in the origin ELF file
pahole -J simple.bpf.o
btf2wit simple.bpf.o -o simple.wit
wit-bindgen c simple.wit
wit-bindgen rust simple.wit
For examples, please refer to examples/simple.
MIT