BTF introspection tool.
btfdump
is written in Rust and relies on standard Cargo package manager.
To compile btfdump:
- 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 usinghttp_proxy
andhttps_proxy
envvars:$ export http_proxy=http://fwdproxy:8080 $ export https_proxy=http://fwdproxy:8080 $ curl https://sh.rustup.rs -sSf | sh
- Once Cargo and rustc is installed, run
cargo build
orcargo build --release
to compile it. This will buildbtf
binary intarget/{debug,release}/
directory. - Alternatively, you can use
cargo run -- <args>
to compile and run through Cargo.
- Dump BTF types in various formats:
btf dump --format [human|c] <elf-file>
- You can filter out which types to print out using
--type
,--name
, and--id
options. Seebtf dump --help
for more details. - Check also
--dataset
option for dumping .BTF.ext data as well.
Output high-level stats about .BTF and .BTF.ext data.
btf stat <elf-file>