#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

#33 in #bpf

Download history 20/week @ 2025-10-13 25/week @ 2025-10-20 12/week @ 2025-10-27 142/week @ 2025-11-03 123/week @ 2025-11-10 51/week @ 2025-11-17 98/week @ 2025-11-24 33/week @ 2025-12-01 26/week @ 2025-12-08 3/week @ 2025-12-15 24/week @ 2025-12-22 13/week @ 2025-12-29 14/week @ 2026-01-05 15/week @ 2026-01-12 17/week @ 2026-01-19 11/week @ 2026-01-26

57 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

~245–670KB
~15K SLoC