#ebpf #linux #parser

btf

A library for parsing the BPF type format (BTF)

9 releases (4 breaking)

0.5.1 Nov 5, 2022
0.5.0 Nov 3, 2022
0.4.0 Nov 2, 2022
0.3.2 Oct 29, 2022
0.1.1 Sep 17, 2022

#1890 in Parser implementations


Used in 4 crates (3 directly)

MIT license

40KB
817 lines

btf

Build Status crates.io mio Lines of Code

Parsing library for the eBPF type format.

Usage

For usage examples, see code located in examples/ :

Examples Description
print-type Prints a type given a path to a BTF file and a type name

TODO

  • Write more thorough tests.

License


lib.rs:

Build Status crates.io mio Lines of Code

Parsing library for the eBPF type format.

Usage

use btf::Btf;

let btf = Btf::from_file("/sys/kernel/btf/vmlinux").expect("Failed to parse vmlinux");
let pt_regs = btf.get_type_by_name("pt_regs").expect("Can't find type.");
println!("{:?}", pt_regs);

License

Dependencies

~0.3–0.8MB
~19K SLoC