#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

#34 in #bpf

Download history 54/week @ 2025-08-20 24/week @ 2025-09-03 21/week @ 2025-09-10 7/week @ 2025-09-17 19/week @ 2025-09-24 54/week @ 2025-10-01 32/week @ 2025-10-08 16/week @ 2025-10-15 25/week @ 2025-10-22 50/week @ 2025-10-29 145/week @ 2025-11-05 94/week @ 2025-11-12 59/week @ 2025-11-19 102/week @ 2025-11-26

437 downloads per month
Used in 4 crates (3 directly)

MIT license

40KB
817 lines

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


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

Dependencies

~260–700KB
~16K SLoC