Merge branch 'annotate-kfuncs-in-btf_ids-section'
authorAlexei Starovoitov <ast@kernel.org>
Wed, 31 Jan 2024 20:05:24 +0000 (12:05 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 1 Feb 2024 04:40:56 +0000 (20:40 -0800)
commitb3d3e29376a3f898bc90063a1e8c36c76cea1901
treefd932c0339367596adb67fd652849506971fda3f
parent2ef61296d2844c6a4211e07ab70ef2fb412b2c30
parent6f3189f38a3e995232e028a4c341164c4aca1b20
Merge branch 'annotate-kfuncs-in-btf_ids-section'

Daniel Xu says:

====================
Annotate kfuncs in .BTF_ids section

=== Description ===

This is a bpf-treewide change that annotates all kfuncs as such inside
.BTF_ids. This annotation eventually allows us to automatically generate
kfunc prototypes from bpftool.

We store this metadata inside a yet-unused flags field inside struct
btf_id_set8 (thanks Kumar!). pahole will be taught where to look.

More details about the full chain of events are available in commit 3's
description.

The accompanying pahole and bpftool changes can be viewed
here on these "frozen" branches [0][1].

[0]: https://github.com/danobi/pahole/tree/kfunc_btf-v3-mailed
[1]: https://github.com/danobi/linux/tree/kfunc_bpftool-mailed

=== Changelog ===

Changes from v3:
* Rebase to bpf-next and add missing annotation on new kfunc

Changes from v2:
* Only WARN() for vmlinux kfuncs

Changes from v1:
* Move WARN_ON() up a call level
* Also return error when kfunc set is not properly tagged
* Use BTF_KFUNCS_START/END instead of flags
* Rename BTF_SET8_KFUNC to BTF_SET8_KFUNCS
====================

Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/cover.1706491398.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>