btf_helpers.h (608B)
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* Copyright (c) 2020 Facebook */ 3#ifndef __BTF_HELPERS_H 4#define __BTF_HELPERS_H 5 6#include <stdio.h> 7#include <bpf/btf.h> 8 9int fprintf_btf_type_raw(FILE *out, const struct btf *btf, __u32 id); 10const char *btf_type_raw_dump(const struct btf *btf, int type_id); 11int btf_validate_raw(struct btf *btf, int nr_types, const char *exp_types[]); 12 13#define VALIDATE_RAW_BTF(btf, raw_types...) \ 14 btf_validate_raw(btf, \ 15 sizeof((const char *[]){raw_types})/sizeof(void *),\ 16 (const char *[]){raw_types}) 17 18const char *btf_type_c_dump(const struct btf *btf); 19#endif