]> www.infradead.org Git - users/dwmw2/linux.git/commit
selftests/bpf: Test distilled base, split BTF generation
authorAlan Maguire <alan.maguire@oracle.com>
Thu, 13 Jun 2024 09:50:07 +0000 (10:50 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 17 Jun 2024 21:38:31 +0000 (14:38 -0700)
commiteb20e727c4343ad591cff2bef243590c77f62cf1
tree3c4518971b73f7cdf688f0e5a0d3476df233c964
parent58e185a0dc359a6c1c9eff348d7badfc9f722159
selftests/bpf: Test distilled base, split BTF generation

Test generation of split+distilled base BTF, ensuring that

- named base BTF STRUCTs and UNIONs are represented as 0-vlen sized
  STRUCT/UNIONs
- named ENUM[64]s are represented as 0-vlen named ENUM[64]s
- anonymous struct/unions are represented in full in split BTF
- anonymous enums are represented in full in split BTF
- types unreferenced from split BTF are not present in distilled
  base BTF

Also test that with vmlinux BTF and split BTF based upon it,
we only represent needed base types referenced from split BTF
in distilled base.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20240613095014.357981-3-alan.maguire@oracle.com
tools/testing/selftests/bpf/prog_tests/btf_distill.c [new file with mode: 0644]