bpf, btf: Add check_btf_kconfigs helper
authorGeliang Tang <tanggeliang@kylinos.cn>
Thu, 8 Feb 2024 06:24:22 +0000 (14:24 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 8 Feb 2024 19:22:56 +0000 (11:22 -0800)
commit9e60b0e02550aaf5f2301e49353641a5e3701674
treeeb3073aaab7aa1ca63533f8e396fb487df354172
parentb9a395f0f7af66fe8224450481b99d4f83b57207
bpf, btf: Add check_btf_kconfigs helper

This patch extracts duplicate code on error path when btf_get_module_btf()
returns NULL from the functions __register_btf_kfunc_id_set() and
register_btf_id_dtor_kfuncs() into a new helper named check_btf_kconfigs()
to check CONFIG_DEBUG_INFO_BTF and CONFIG_DEBUG_INFO_BTF_MODULES in it.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/fa5537fc55f1e4d0bfd686598c81b7ab9dbd82b7.1707373307.git.tanggeliang@kylinos.cn
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
kernel/bpf/btf.c