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

Download history 15/week @ 2024-04-08 21/week @ 2024-04-15 24/week @ 2024-04-22 9/week @ 2024-04-29 16/week @ 2024-05-06 18/week @ 2024-05-13 22/week @ 2024-05-20 10/week @ 2024-05-27 18/week @ 2024-06-03 18/week @ 2024-06-10 12/week @ 2024-06-17 22/week @ 2024-06-24 2/week @ 2024-07-01 8/week @ 2024-07-08 15/week @ 2024-07-15 33/week @ 2024-07-22

60 每月下载次数
4 个包(2 个直接) 中使用

BSD-2-Clause

125KB
3.5K SLoC

btfdump

BTF 检查工具

编译

btfdump 使用 Rust 编写并依赖于标准的 Cargo 包管理器。

编译 btfdump

  1. 获取 Rust 工具链。请参阅 https://rust-lang.net.cn/tools/install 以获取说明。a. 使用 rustup 是最简单的方法:只需运行 curl https://sh.rustup.rs -sSf | sh。b. 如果您位于 HTTP/HTTPS 代理后面,您可以使用 http_proxyhttps_proxy 环境变量来指定它。
    $ export http_proxy=http://fwdproxy:8080
    $ export https_proxy=http://fwdproxy:8080
    $ curl https://sh.rustup.rs -sSf | sh
    
  2. 一旦安装了 Cargo 和 rustc,运行 cargo buildcargo build --release 来编译它。这将构建 btf 二进制文件在 target/{debug,release}/ 目录中。
  3. 或者,您可以使用 cargo run -- <args> 通过 Cargo 编译并运行。

支持的命令

转储

  1. 以各种格式转储 BTF 类型
btf dump --format [human|c] <elf-file>
  1. 您可以使用 --type--name--id 选项来过滤要打印的类型。有关更多信息,请参阅 btf dump --help
  2. 同时检查 --dataset 选项,用于将 .BTF.ext 数据导出。

统计

输出关于 .BTF 和 .BTF.ext 数据的高级统计数据。

btf stat <elf-file>

依赖关系

~8–18MB
~238K SLoC