4 个版本
0.0.4 | 2023年10月5日 |
---|---|
0.0.3 | 2023年10月3日 |
0.0.2 | 2023年3月10日 |
0.0.1 | 2022年12月17日 |
#615 in Unix APIs
60 每月下载次数
在 4 个包(2 个直接) 中使用
125KB
3.5K SLoC
btfdump
BTF 检查工具
编译
btfdump
使用 Rust 编写并依赖于标准的 Cargo 包管理器。
编译 btfdump
- 获取 Rust 工具链。请参阅 https://rust-lang.net.cn/tools/install 以获取说明。a. 使用 rustup 是最简单的方法:只需运行
curl https://sh.rustup.rs -sSf | sh
。b. 如果您位于 HTTP/HTTPS 代理后面,您可以使用http_proxy
和https_proxy
环境变量来指定它。$ export http_proxy=http://fwdproxy:8080 $ export https_proxy=http://fwdproxy:8080 $ curl https://sh.rustup.rs -sSf | sh
- 一旦安装了 Cargo 和 rustc,运行
cargo build
或cargo build --release
来编译它。这将构建btf
二进制文件在target/{debug,release}/
目录中。 - 或者,您可以使用
cargo run -- <args>
通过 Cargo 编译并运行。
支持的命令
转储
- 以各种格式转储 BTF 类型
btf dump --format [human|c] <elf-file>
- 您可以使用
--type
、--name
和--id
选项来过滤要打印的类型。有关更多信息,请参阅btf dump --help
。 - 同时检查
--dataset
选项,用于将 .BTF.ext 数据导出。
统计
输出关于 .BTF 和 .BTF.ext 数据的高级统计数据。
btf stat <elf-file>
依赖关系
~8–18MB
~238K SLoC