testing_helpers.h 850 B

123456789101112131415161718192021222324
  1. /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
  2. /* Copyright (C) 2020 Facebook, Inc. */
  3. #include <stdbool.h>
  4. #include <bpf/bpf.h>
  5. #include <bpf/libbpf.h>
  6. int parse_num_list(const char *s, bool **set, int *set_len);
  7. __u32 link_info_prog_id(const struct bpf_link *link, struct bpf_link_info *info);
  8. int bpf_prog_test_load(const char *file, enum bpf_prog_type type,
  9. struct bpf_object **pobj, int *prog_fd);
  10. int bpf_test_load_program(enum bpf_prog_type type, const struct bpf_insn *insns,
  11. size_t insns_cnt, const char *license,
  12. __u32 kern_version, char *log_buf,
  13. size_t log_buf_sz);
  14. /*
  15. * below function is exported for testing in prog_test test
  16. */
  17. struct test_filter_set;
  18. int parse_test_list(const char *s,
  19. struct test_filter_set *test_set,
  20. bool is_glob_pattern);
  21. __u64 read_perf_max_sample_freq(void);