diff options
author | Mauricio Vásquez <mauricio@kinvolk.io> | 2022-02-15 17:58:54 -0500 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2022-02-16 10:10:42 -0800 |
commit | dc695516b6f5cb322b95de7ef3a6ec1db707ff8b (patch) | |
tree | d06d94211dc7939318ea370d5ca7eefeb988d8e0 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | a9caaba399f9cff34c6bffa1b1fd673d3d6043a0 (diff) |
bpftool: Implement btfgen_get_btf()
The last part of the BTFGen algorithm is to create a new BTF object with
all the types that were recorded in the previous steps.
This function performs two different steps:
1. Add the types to the new BTF object by using btf__add_type(). Some
special logic around struct and unions is implemented to only add the
members that are really used in the field-based relocations. The type
ID on the new and old BTF objects is stored on a map.
2. Fix all the type IDs on the new BTF object by using the IDs saved in
the previous step.
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>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220215225856.671072-6-mauricio@kinvolk.io
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions