diff options
| author | Donglin Peng <pengdonglin@xiaomi.com> | 2026-01-09 20:59:58 +0800 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2026-01-13 16:20:38 -0800 |
| commit | 8c3070e159ba00424f0389ead694cacd85af260e (patch) | |
| tree | 649d5e04e85f375cf87baef4c4fb9aee1810d9dd /include/linux | |
| parent | 33ecca574f1c27cbf560aee9c1b3045dcb9f8de5 (diff) | |
btf: Optimize type lookup with binary search
Improve btf_find_by_name_kind() performance by adding binary search
support for sorted types. Falls back to linear search for compatibility.
Signed-off-by: Donglin Peng <pengdonglin@xiaomi.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20260109130003.3313716-7-dolinux.peng@gmail.com
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/btf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/btf.h b/include/linux/btf.h index 691f09784933..78dc79810c7d 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -219,6 +219,7 @@ bool btf_is_module(const struct btf *btf); bool btf_is_vmlinux(const struct btf *btf); struct module *btf_try_get_module(const struct btf *btf); u32 btf_nr_types(const struct btf *btf); +u32 btf_named_start_id(const struct btf *btf, bool own); struct btf *btf_base_btf(const struct btf *btf); bool btf_type_is_i32(const struct btf_type *t); bool btf_type_is_i64(const struct btf_type *t); |
