From 23d192085465af85a24bc014999ce580ef42a18b Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Mon, 6 Dec 2021 17:21:35 +0000 Subject: [PATCH] codegen: add bindings for btf structs This adds `bpf_btf_info` which can be used to get BPF information via a syscall. It also adds `btf_line_info` and `btf_func_info` which are required to parse the line and func info sections of BTF Signed-off-by: Dave Tucker --- xtask/src/codegen/aya.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xtask/src/codegen/aya.rs b/xtask/src/codegen/aya.rs index 6214fb1f..a2597461 100644 --- a/xtask/src/codegen/aya.rs +++ b/xtask/src/codegen/aya.rs @@ -65,6 +65,9 @@ fn codegen_bindings(opts: &Options) -> Result<(), anyhow::Error> { "bpf_prog_type", "bpf_attach_type", "bpf_prog_info", + "bpf_btf_info", + "bpf_func_info", + "bpf_line_info", // BTF "btf_header", "btf_ext_info", @@ -76,6 +79,7 @@ fn codegen_bindings(opts: &Options) -> Result<(), anyhow::Error> { "btf_param", "btf_var", "btf_var_secinfo", + "btf_func_linkage", // PERF "perf_event_attr", "perf_sw_ids", @@ -114,6 +118,7 @@ fn codegen_bindings(opts: &Options) -> Result<(), anyhow::Error> { // BTF "BTF_INT_.*", "BTF_KIND_.*", + "BTF_VAR_.*", // PERF "PERF_FLAG_.*", "PERF_EVENT_.*", @@ -179,7 +184,10 @@ fn codegen_bindings(opts: &Options) -> Result<(), anyhow::Error> { bindgen = bindgen.allowlist_type(x); } for x in &vars { - bindgen = bindgen.allowlist_var(x).constified_enum("BTF_KIND_.*"); + bindgen = bindgen + .allowlist_var(x) + .constified_enum("BTF_KIND_.*") + .constified_enum("BTF_VAR_.*"); } for x in &types {