btf2wit

Crates.iobtf2wit
lib.rsbtf2wit
version0.1.2
sourcesrc
created_at2023-02-11 08:06:12.705859
updated_at2023-03-10 04:45:54.454561
descriptionConvert btf info to wit info
homepage
repository
max_upload_size
id782384
size47,508
Officeyutong (Officeyutong)

documentation

README

btf2wit

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

Extract BTF info from DWARF

  • 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

Use btf2wit to emit WIT info from BTF

btf2wit simple.bpf.o -o simple.wit

Use wit-bindgen to emit bindings for C and Rust

wit-bindgen c simple.wit
wit-bindgen rust simple.wit

For examples, please refer to examples/simple.

License

MIT

Commit count: 0

cargo fmt