summaryrefslogtreecommitdiff
path: root/include/linux/btf_ids.h
diff options
context:
space:
mode:
authorDaniel Xu <dxu@dxuuu.xyz>2024-01-28 18:24:07 -0700
committerAlexei Starovoitov <ast@kernel.org>2024-01-31 20:40:52 -0800
commita05e90427ef6706f59188b379ad6366b9d298bc5 (patch)
tree5bafea12fa3f4e5bdf0d08a0db79cf73fc0c9de5 /include/linux/btf_ids.h
parent79b47344bbc5a693a92ed6b2b09dac59254bfac8 (diff)
bpf: btf: Add BTF_KFUNCS_START/END macro pair
This macro pair is functionally equivalent to BTF_SET8_START/END, except with BTF_SET8_KFUNCS flag set in the btf_id_set8 flags field. The next commit will codemod all kfunc set8s to this new variant such that all kfuncs are tagged as such in .BTF_ids section. Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> Link: https://lore.kernel.org/r/d536c57c7c2af428686853cc7396b7a44faa53b7.1706491398.git.dxu@dxuuu.xyz Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/btf_ids.h')
-rw-r--r--include/linux/btf_ids.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
index dca09b7f21dc..e24aabfe8ecc 100644
--- a/include/linux/btf_ids.h
+++ b/include/linux/btf_ids.h
@@ -8,6 +8,9 @@ struct btf_id_set {
u32 ids[];
};
+/* This flag implies BTF_SET8 holds kfunc(s) */
+#define BTF_SET8_KFUNCS (1 << 0)
+
struct btf_id_set8 {
u32 cnt;
u32 flags;
@@ -204,6 +207,12 @@ asm( \
".popsection; \n"); \
extern struct btf_id_set8 name;
+#define BTF_KFUNCS_START(name) \
+__BTF_SET8_START(name, local, BTF_SET8_KFUNCS)
+
+#define BTF_KFUNCS_END(name) \
+BTF_SET8_END(name)
+
#else
#define BTF_ID_LIST(name) static u32 __maybe_unused name[64];
@@ -218,6 +227,8 @@ extern struct btf_id_set8 name;
#define BTF_SET_END(name)
#define BTF_SET8_START(name) static struct btf_id_set8 __maybe_unused name = { 0 };
#define BTF_SET8_END(name)
+#define BTF_KFUNCS_START(name) static struct btf_id_set8 __maybe_unused name = { .flags = BTF_SET8_KFUNCS };
+#define BTF_KFUNCS_END(name)
#endif /* CONFIG_DEBUG_INFO_BTF */