diff options
Diffstat (limited to 'include/linux/btf.h')
-rw-r--r-- | include/linux/btf.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/btf.h b/include/linux/btf.h index e076c4697049..b98405a56383 100644 --- a/include/linux/btf.h +++ b/include/linux/btf.h @@ -46,5 +46,22 @@ void btf_type_seq_show(const struct btf *btf, u32 type_id, void *obj, struct seq_file *m); int btf_get_fd_by_id(u32 id); u32 btf_id(const struct btf *btf); +bool btf_name_offset_valid(const struct btf *btf, u32 offset); + +#ifdef CONFIG_BPF_SYSCALL +const struct btf_type *btf_type_by_id(const struct btf *btf, u32 type_id); +const char *btf_name_by_offset(const struct btf *btf, u32 offset); +#else +static inline const struct btf_type *btf_type_by_id(const struct btf *btf, + u32 type_id) +{ + return NULL; +} +static inline const char *btf_name_by_offset(const struct btf *btf, + u32 offset) +{ + return NULL; +} +#endif #endif |