btf_helpers.h 608 B

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