diff options
Diffstat (limited to 'tools/lib/bpf/btf.h')
-rw-r--r-- | tools/lib/bpf/btf.h | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h index b0610dcdae6b..b393da90cc85 100644 --- a/tools/lib/bpf/btf.h +++ b/tools/lib/bpf/btf.h | |||
@@ -55,33 +55,44 @@ struct btf_ext_header { | |||
55 | __u32 line_info_len; | 55 | __u32 line_info_len; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | typedef int (*btf_print_fn_t)(const char *, ...) | ||
59 | __attribute__((format(printf, 1, 2))); | ||
60 | |||
61 | LIBBPF_API void btf__free(struct btf *btf); | 58 | LIBBPF_API void btf__free(struct btf *btf); |
62 | LIBBPF_API struct btf *btf__new(__u8 *data, __u32 size, btf_print_fn_t err_log); | 59 | LIBBPF_API struct btf *btf__new(__u8 *data, __u32 size); |
63 | LIBBPF_API __s32 btf__find_by_name(const struct btf *btf, | 60 | LIBBPF_API __s32 btf__find_by_name(const struct btf *btf, |
64 | const char *type_name); | 61 | const char *type_name); |
62 | LIBBPF_API __u32 btf__get_nr_types(const struct btf *btf); | ||
65 | LIBBPF_API const struct btf_type *btf__type_by_id(const struct btf *btf, | 63 | LIBBPF_API const struct btf_type *btf__type_by_id(const struct btf *btf, |
66 | __u32 id); | 64 | __u32 id); |
67 | LIBBPF_API __s64 btf__resolve_size(const struct btf *btf, __u32 type_id); | 65 | LIBBPF_API __s64 btf__resolve_size(const struct btf *btf, __u32 type_id); |
68 | LIBBPF_API int btf__resolve_type(const struct btf *btf, __u32 type_id); | 66 | LIBBPF_API int btf__resolve_type(const struct btf *btf, __u32 type_id); |
69 | LIBBPF_API int btf__fd(const struct btf *btf); | 67 | LIBBPF_API int btf__fd(const struct btf *btf); |
68 | LIBBPF_API void btf__get_strings(const struct btf *btf, const char **strings, | ||
69 | __u32 *str_len); | ||
70 | LIBBPF_API const char *btf__name_by_offset(const struct btf *btf, __u32 offset); | 70 | LIBBPF_API const char *btf__name_by_offset(const struct btf *btf, __u32 offset); |
71 | LIBBPF_API int btf__get_from_id(__u32 id, struct btf **btf); | 71 | LIBBPF_API int btf__get_from_id(__u32 id, struct btf **btf); |
72 | LIBBPF_API int btf__get_map_kv_tids(const struct btf *btf, const char *map_name, | ||
73 | __u32 expected_key_size, | ||
74 | __u32 expected_value_size, | ||
75 | __u32 *key_type_id, __u32 *value_type_id); | ||
76 | |||
77 | LIBBPF_API struct btf_ext *btf_ext__new(__u8 *data, __u32 size); | ||
78 | LIBBPF_API void btf_ext__free(struct btf_ext *btf_ext); | ||
79 | LIBBPF_API int btf_ext__reloc_func_info(const struct btf *btf, | ||
80 | const struct btf_ext *btf_ext, | ||
81 | const char *sec_name, __u32 insns_cnt, | ||
82 | void **func_info, __u32 *cnt); | ||
83 | LIBBPF_API int btf_ext__reloc_line_info(const struct btf *btf, | ||
84 | const struct btf_ext *btf_ext, | ||
85 | const char *sec_name, __u32 insns_cnt, | ||
86 | void **line_info, __u32 *cnt); | ||
87 | LIBBPF_API __u32 btf_ext__func_info_rec_size(const struct btf_ext *btf_ext); | ||
88 | LIBBPF_API __u32 btf_ext__line_info_rec_size(const struct btf_ext *btf_ext); | ||
89 | |||
90 | struct btf_dedup_opts { | ||
91 | bool dont_resolve_fwds; | ||
92 | }; | ||
72 | 93 | ||
73 | struct btf_ext *btf_ext__new(__u8 *data, __u32 size, btf_print_fn_t err_log); | 94 | LIBBPF_API int btf__dedup(struct btf *btf, struct btf_ext *btf_ext, |
74 | void btf_ext__free(struct btf_ext *btf_ext); | 95 | const struct btf_dedup_opts *opts); |
75 | int btf_ext__reloc_func_info(const struct btf *btf, | ||
76 | const struct btf_ext *btf_ext, | ||
77 | const char *sec_name, __u32 insns_cnt, | ||
78 | void **func_info, __u32 *func_info_len); | ||
79 | int btf_ext__reloc_line_info(const struct btf *btf, | ||
80 | const struct btf_ext *btf_ext, | ||
81 | const char *sec_name, __u32 insns_cnt, | ||
82 | void **line_info, __u32 *cnt); | ||
83 | __u32 btf_ext__func_info_rec_size(const struct btf_ext *btf_ext); | ||
84 | __u32 btf_ext__line_info_rec_size(const struct btf_ext *btf_ext); | ||
85 | 96 | ||
86 | #ifdef __cplusplus | 97 | #ifdef __cplusplus |
87 | } /* extern "C" */ | 98 | } /* extern "C" */ |