]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: Add distilled BTF test about marking BTF_IS_EMBEDDED
authorPu Lehui <pulehui@huawei.com>
Wed, 15 Jan 2025 10:02:41 +0000 (10:02 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 16 Jan 2025 23:34:18 +0000 (15:34 -0800)
commit556a399406635566413f9c71b134d5d287b25b29
tree93ad3111ab82ceca06974b35ed96c9c94a723598
parent5ca681a86ef93369685cb63f71994f4cf7303e7c
selftests/bpf: Add distilled BTF test about marking BTF_IS_EMBEDDED

When redirecting the split BTF to the vmlinux base BTF, we need to mark
the distilled base struct/union members of split BTF structs/unions in
id_map with BTF_IS_EMBEDDED. This indicates that these types must match
both name and size later. So if a needed composite type, which is the
member of composite type in the split BTF, has a different size in the
base BTF we wish to relocate with, btf__relocate() should error out.

Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250115100241.4171581-4-pulehui@huaweicloud.com
tools/testing/selftests/bpf/prog_tests/btf_distill.c