2018-08-06 02:19:13 +02:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1 */
|
2018-04-19 00:56:05 +02:00
|
|
|
/* Copyright (c) 2018 Facebook */
|
|
|
|
|
|
|
|
#ifndef __BPF_BTF_H
|
|
|
|
#define __BPF_BTF_H
|
|
|
|
|
2018-07-24 17:40:21 +02:00
|
|
|
#include <linux/types.h>
|
2018-04-19 00:56:05 +02:00
|
|
|
|
|
|
|
#define BTF_ELF_SEC ".BTF"
|
|
|
|
|
|
|
|
struct btf;
|
2018-07-24 17:40:22 +02:00
|
|
|
struct btf_type;
|
2018-04-19 00:56:05 +02:00
|
|
|
|
|
|
|
typedef int (*btf_print_fn_t)(const char *, ...)
|
|
|
|
__attribute__((format(printf, 1, 2)));
|
|
|
|
|
|
|
|
void btf__free(struct btf *btf);
|
2018-07-24 17:40:21 +02: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 17:40:22 +02:00
|
|
|
const struct btf_type *btf__type_by_id(const struct btf *btf, __u32 id);
|
2018-07-24 17:40:21 +02:00
|
|
|
__s64 btf__resolve_size(const struct btf *btf, __u32 type_id);
|
2018-07-14 06:57:02 +02:00
|
|
|
int btf__resolve_type(const struct btf *btf, __u32 type_id);
|
2018-04-19 00:56:05 +02:00
|
|
|
int btf__fd(const struct btf *btf);
|
2018-07-14 06:57:02 +02:00
|
|
|
const char *btf__name_by_offset(const struct btf *btf, __u32 offset);
|
2018-04-19 00:56:05 +02:00
|
|
|
|
|
|
|
#endif
|