1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2 /* Copyright (c) 2018 Facebook */
7 #include <linux/types.h>
10 #define LIBBPF_API __attribute__((visibility("default")))
13 #define BTF_ELF_SEC ".BTF"
18 typedef int (*btf_print_fn_t)(const char *, ...)
19 __attribute__((format(printf, 1, 2)));
21 LIBBPF_API void btf__free(struct btf *btf);
22 LIBBPF_API struct btf *btf__new(__u8 *data, __u32 size, btf_print_fn_t err_log);
23 LIBBPF_API __s32 btf__find_by_name(const struct btf *btf,
24 const char *type_name);
25 LIBBPF_API const struct btf_type *btf__type_by_id(const struct btf *btf,
27 LIBBPF_API __s64 btf__resolve_size(const struct btf *btf, __u32 type_id);
28 LIBBPF_API int btf__resolve_type(const struct btf *btf, __u32 type_id);
29 LIBBPF_API int btf__fd(const struct btf *btf);
30 LIBBPF_API const char *btf__name_by_offset(const struct btf *btf, __u32 offset);
32 #endif /* __LIBBPF_BTF_H */