]> git.ipfire.org Git - thirdparty/linux.git/commit
btf: Verify BTF sorting
authorDonglin Peng <pengdonglin@xiaomi.com>
Fri, 9 Jan 2026 12:59:59 +0000 (20:59 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 14 Jan 2026 00:21:30 +0000 (16:21 -0800)
commit342bf525ba0d83374f318e19186d50b1e7160d0e
tree7f7c4a0ac43f58958aa8a319fd5331cf12b6a418
parent8c3070e159ba00424f0389ead694cacd85af260e
btf: Verify BTF sorting

This patch checks whether the BTF is sorted by name in ascending order.
If sorted, binary search will be used when looking up types.

Specifically, vmlinux and kernel module BTFs are always sorted during
the build phase with anonymous types placed before named types, so we
only need to identify the starting ID of named types.

Signed-off-by: Donglin Peng <pengdonglin@xiaomi.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260109130003.3313716-8-dolinux.peng@gmail.com
kernel/bpf/btf.c