diff options
Diffstat (limited to 'tools/lib/bpf/btf.h')
-rw-r--r-- | tools/lib/bpf/btf.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h index c7b399e81fce..ba4ffa831aa4 100644 --- a/tools/lib/bpf/btf.h +++ b/tools/lib/bpf/btf.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifndef __LIBBPF_BTF_H | 4 | #ifndef __LIBBPF_BTF_H |
5 | #define __LIBBPF_BTF_H | 5 | #define __LIBBPF_BTF_H |
6 | 6 | ||
7 | #include <stdarg.h> | ||
7 | #include <linux/types.h> | 8 | #include <linux/types.h> |
8 | 9 | ||
9 | #ifdef __cplusplus | 10 | #ifdef __cplusplus |
@@ -59,6 +60,8 @@ struct btf_ext_header { | |||
59 | 60 | ||
60 | LIBBPF_API void btf__free(struct btf *btf); | 61 | LIBBPF_API void btf__free(struct btf *btf); |
61 | LIBBPF_API struct btf *btf__new(__u8 *data, __u32 size); | 62 | LIBBPF_API struct btf *btf__new(__u8 *data, __u32 size); |
63 | LIBBPF_API struct btf *btf__parse_elf(const char *path, | ||
64 | struct btf_ext **btf_ext); | ||
62 | LIBBPF_API int btf__finalize_data(struct bpf_object *obj, struct btf *btf); | 65 | LIBBPF_API int btf__finalize_data(struct bpf_object *obj, struct btf *btf); |
63 | LIBBPF_API int btf__load(struct btf *btf); | 66 | LIBBPF_API int btf__load(struct btf *btf); |
64 | LIBBPF_API __s32 btf__find_by_name(const struct btf *btf, | 67 | LIBBPF_API __s32 btf__find_by_name(const struct btf *btf, |
@@ -100,6 +103,22 @@ struct btf_dedup_opts { | |||
100 | LIBBPF_API int btf__dedup(struct btf *btf, struct btf_ext *btf_ext, | 103 | LIBBPF_API int btf__dedup(struct btf *btf, struct btf_ext *btf_ext, |
101 | const struct btf_dedup_opts *opts); | 104 | const struct btf_dedup_opts *opts); |
102 | 105 | ||
106 | struct btf_dump; | ||
107 | |||
108 | struct btf_dump_opts { | ||
109 | void *ctx; | ||
110 | }; | ||
111 | |||
112 | typedef void (*btf_dump_printf_fn_t)(void *ctx, const char *fmt, va_list args); | ||
113 | |||
114 | LIBBPF_API struct btf_dump *btf_dump__new(const struct btf *btf, | ||
115 | const struct btf_ext *btf_ext, | ||
116 | const struct btf_dump_opts *opts, | ||
117 | btf_dump_printf_fn_t printf_fn); | ||
118 | LIBBPF_API void btf_dump__free(struct btf_dump *d); | ||
119 | |||
120 | LIBBPF_API int btf_dump__dump_type(struct btf_dump *d, __u32 id); | ||
121 | |||
103 | #ifdef __cplusplus | 122 | #ifdef __cplusplus |
104 | } /* extern "C" */ | 123 | } /* extern "C" */ |
105 | #endif | 124 | #endif |