Include btf object id (btf_obj_id) in bpf_map_info so that tools (ex: bpftools struct_ops dump) know the correct btf from the kernel to look up type information of struct_ops types. Since struct_ops types can be defined and registered in a module. The type information of a struct_ops type are defined in the btf of the module defining it. The userspace tools need to know which btf is for the module defining a struct_ops type.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -6487,7 +6487,7 @@ struct bpf_map_info { · 6486 unmodified lines | ||
| 6487 | 6487 | __u32 btf_id; |
| 6488 | 6488 | __u32 btf_key_type_id; |
| 6489 | 6489 | __u32 btf_value_type_id; |
| 6490 | − __u32 :32; /* alignment pad */ | |
| 6490 | + __u32 btf_vmlinux_id; | |
| 6491 | 6491 | __u64 map_extra; |
| 6492 | 6492 | } __attribute__((aligned(8))); |
| 6493 | 6493 | |