4 releases

0.0.4 Oct 5, 2023
0.0.3 Oct 3, 2023
0.0.2 Mar 10, 2023
0.0.1 Dec 17, 2022

#910 in Unix APIs

Download history 141/week @ 2025-08-26 146/week @ 2025-09-02 130/week @ 2025-09-09 135/week @ 2025-09-16 185/week @ 2025-09-23 137/week @ 2025-09-30 165/week @ 2025-10-07 174/week @ 2025-10-14 417/week @ 2025-10-21 144/week @ 2025-10-28 219/week @ 2025-11-04 876/week @ 2025-11-11 3677/week @ 2025-11-18 1773/week @ 2025-11-25 3331/week @ 2025-12-02 897/week @ 2025-12-09

10,233 downloads per month
Used in 4 crates (2 directly)

BSD-2-Clause

125KB
3.5K SLoC

btfdump

BTF introspection tool

Compiling

btfdump is written in Rust and relies on standard Cargo package manager.

To compile btfdump:

  1. Get rust toolchain. See https://www.rust-lang.org/tools/install for instructions. a. Using rustup is the simplest option: just run curl https://sh.rustup.rs -sSf | sh. b. If you are behind HTTP/HTTPS proxy, you can specify it using http_proxy and https_proxy envvars:
    $ export http_proxy=http://fwdproxy:8080
    $ export https_proxy=http://fwdproxy:8080
    $ curl https://sh.rustup.rs -sSf | sh
    
  2. Once Cargo and rustc is installed, run cargo build or cargo build --release to compile it. This will build btf binary in target/{debug,release}/ directory.
  3. Alternatively, you can use cargo run -- <args> to compile and run through Cargo.

Supported commands

Dump

  1. Dump BTF types in various formats:
btf dump --format [human|c] <elf-file>
  1. You can filter out which types to print out using --type, --name, and --id options. See btf dump --help for more details.
  2. Check also --dataset option for dumping .BTF.ext data as well.

Stat

Output high-level stats about .BTF and .BTF.ext data.

btf stat <elf-file>

Dependencies

~8–23MB
~290K SLoC