at v6.5 36 lines 1.1 kB view raw
1/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 2/* Copyright (C) 2020 Facebook, Inc. */ 3 4#ifndef __TESTING_HELPERS_H 5#define __TESTING_HELPERS_H 6 7#include <stdbool.h> 8#include <bpf/bpf.h> 9#include <bpf/libbpf.h> 10 11int parse_num_list(const char *s, bool **set, int *set_len); 12__u32 link_info_prog_id(const struct bpf_link *link, struct bpf_link_info *info); 13int bpf_prog_test_load(const char *file, enum bpf_prog_type type, 14 struct bpf_object **pobj, int *prog_fd); 15int bpf_test_load_program(enum bpf_prog_type type, const struct bpf_insn *insns, 16 size_t insns_cnt, const char *license, 17 __u32 kern_version, char *log_buf, 18 size_t log_buf_sz); 19 20/* 21 * below function is exported for testing in prog_test test 22 */ 23struct test_filter_set; 24int parse_test_list(const char *s, 25 struct test_filter_set *test_set, 26 bool is_glob_pattern); 27int parse_test_list_file(const char *path, 28 struct test_filter_set *test_set, 29 bool is_glob_pattern); 30 31__u64 read_perf_max_sample_freq(void); 32int load_bpf_testmod(bool verbose); 33int unload_bpf_testmod(bool verbose); 34int kern_sync_rcu(void); 35 36#endif /* __TESTING_HELPERS_H */