2018-10-06 07:40:00 +08:00
|
|
|
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
|
2018-04-19 06:56:05 +08:00
|
|
|
/* Copyright (c) 2018 Facebook */
|
|
|
|
|
2018-10-04 06:26:42 +08:00
|
|
|
#ifndef __LIBBPF_BTF_H
|
|
|
|
#define __LIBBPF_BTF_H
|
2018-04-19 06:56:05 +08:00
|
|
|
|
2018-07-24 23:40:21 +08:00
|
|
|
#include <linux/types.h>
|
2018-04-19 06:56:05 +08:00
|
|
|
|
|
|
|
#define BTF_ELF_SEC ".BTF"
|
|
|
|
|
|
|
|
struct btf;
|
2018-07-24 23:40:22 +08:00
|
|
|
struct btf_type;
|
2018-04-19 06:56:05 +08:00
|
|
|
|
|
|
|
typedef int (*btf_print_fn_t)(const char *, ...)
|
|
|
|
__attribute__((format(printf, 1, 2)));
|
|
|
|
|
|
|
|
void btf__free(struct btf *btf);
|
2018-07-24 23:40:21 +08:00
|
|
|
struct btf *btf__new(__u8 *data, __u32 size, btf_print_fn_t err_log);
|
|
|
|
__s32 btf__find_by_name(const struct btf *btf, const char *type_name);
|
2018-07-24 23:40:22 +08:00
|
|
|
const struct btf_type *btf__type_by_id(const struct btf *btf, __u32 id);
|
2018-07-24 23:40:21 +08:00
|
|
|
__s64 btf__resolve_size(const struct btf *btf, __u32 type_id);
|
2018-07-14 12:57:02 +08:00
|
|
|
int btf__resolve_type(const struct btf *btf, __u32 type_id);
|
2018-04-19 06:56:05 +08:00
|
|
|
int btf__fd(const struct btf *btf);
|
2018-07-14 12:57:02 +08:00
|
|
|
const char *btf__name_by_offset(const struct btf *btf, __u32 offset);
|
2018-04-19 06:56:05 +08:00
|
|
|
|
2018-10-04 06:26:42 +08:00
|
|
|
#endif /* __LIBBPF_BTF_H */
|