~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/bpf/testing_helpers.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 #include <time.h>
 11 
 12 #define __TO_STR(x) #x
 13 #define TO_STR(x) __TO_STR(x)
 14 
 15 int parse_num_list(const char *s, bool **set, int *set_len);
 16 __u32 link_info_prog_id(const struct bpf_link *link, struct bpf_link_info *info);
 17 int bpf_prog_test_load(const char *file, enum bpf_prog_type type,
 18                        struct bpf_object **pobj, int *prog_fd);
 19 int bpf_test_load_program(enum bpf_prog_type type, const struct bpf_insn *insns,
 20                           size_t insns_cnt, const char *license,
 21                           __u32 kern_version, char *log_buf,
 22                           size_t log_buf_sz);
 23 
 24 /*
 25  * below function is exported for testing in prog_test test
 26  */
 27 struct test_filter_set;
 28 int parse_test_list(const char *s,
 29                     struct test_filter_set *test_set,
 30                     bool is_glob_pattern);
 31 int parse_test_list_file(const char *path,
 32                          struct test_filter_set *test_set,
 33                          bool is_glob_pattern);
 34 
 35 __u64 read_perf_max_sample_freq(void);
 36 int load_bpf_testmod(bool verbose);
 37 int unload_bpf_testmod(bool verbose);
 38 int kern_sync_rcu(void);
 39 int finit_module(int fd, const char *param_values, int flags);
 40 int delete_module(const char *name, int flags);
 41 
 42 static inline __u64 get_time_ns(void)
 43 {
 44         struct timespec t;
 45 
 46         clock_gettime(CLOCK_MONOTONIC, &t);
 47 
 48         return (u64)t.tv_sec * 1000000000 + t.tv_nsec;
 49 }
 50 
 51 struct bpf_insn;
 52 /* Request BPF program instructions after all rewrites are applied,
 53  * e.g. verifier.c:convert_ctx_access() is done.
 54  */
 55 int get_xlated_program(int fd_prog, struct bpf_insn **buf, __u32 *cnt);
 56 int testing_prog_flags(void);
 57 bool is_jit_enabled(void);
 58 
 59 #endif /* __TESTING_HELPERS_H */
 60 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php