libbpf.h 673 B

1234567891011121314151617181920212223
  1. /*
  2. * Common eBPF ELF object loading operations.
  3. *
  4. * Copyright (C) 2013-2015 Alexei Starovoitov <ast@kernel.org>
  5. * Copyright (C) 2015 Wang Nan <wangnan0@huawei.com>
  6. * Copyright (C) 2015 Huawei Inc.
  7. */
  8. #ifndef __BPF_LIBBPF_H
  9. #define __BPF_LIBBPF_H
  10. /*
  11. * In include/linux/compiler-gcc.h, __printf is defined. However
  12. * it should be better if libbpf.h doesn't depend on Linux header file.
  13. * So instead of __printf, here we use gcc attribute directly.
  14. */
  15. typedef int (*libbpf_print_fn_t)(const char *, ...)
  16. __attribute__((format(printf, 1, 2)));
  17. void libbpf_set_print(libbpf_print_fn_t warn,
  18. libbpf_print_fn_t info,
  19. libbpf_print_fn_t debug);
  20. #endif