Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The BTFGen's goal is to produce a BTF file that contains **only** the information that is needed by an eBPF program. This algorithm does a first step collecting the types involved for each relocation present on the object and "marking" them as needed. Types are collected in different ways according to the type relocation, for field based relocations only the union and structures members involved are considered, for type based relocations the whole types are added, enum field relocations are not supported in this iteration yet. A second step generates a BTF file from the "marked" types. This step accesses the original BTF file extracting the types and their members that were "marked" as needed in the first step. This command is implemented under the "gen" command in bpftool and the syntax is the following: $ bpftool gen btf INPUT OUTPUT OBJECT(S) INPUT can be either a single BTF file or a folder containing BTF files, when it's a folder, a BTF file is generated for each BTF file contained in this folder. OUTPUT is the file (or folder) where generated files are stored and OBJECT(S) is the list of bpf objects we want to generate the BTF file(s) for (each generated BTF file contains all the types needed by all the objects). Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io> Signed-off-by: Rafael David Tinoco <rafael.tinoco@aquasec.com> Signed-off-by: Lorenzo Fontana <lorenzo.fontana@elastic.co> Signed-off-by: Leonardo Di Donato <leonardo.didonato@elastic.co>
- Loading branch information