tools/testing/selftests/bpf/test_progs.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/test_progs.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/test_progs.h- Extension
.h- Size
- 15135 bytes
- Lines
- 571
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hunistd.herrno.hstring.hassert.hregex.hstdlib.hstdarg.htime.hsignal.hlinux/types.harpa/inet.hlinux/if_ether.hlinux/if_packet.hlinux/ip.hlinux/ipv6.hlinux/filter.hlinux/perf_event.hlinux/socket.hlinux/unistd.hsys/ioctl.hsys/wait.hsys/types.hsys/time.hsys/param.hfcntl.hpthread.hlinux/bpf.hlinux/err.hbpf/bpf.hbpf/libbpf.htest_iptunnel_common.h
Detected Declarations
struct test_filterstruct test_filter_setstruct test_selectorstruct subtest_statestruct test_statestruct test_envstruct msgstruct netns_objstruct test_loaderstruct expect_msgstruct expected_msgsenum verbosityenum msg_typefunction ptr_to_u64function id_from_prog_fdfunction id_from_link_fdfunction test_loader__set_pre_execution_cb
Annotated Snippet
struct test_filter {
char *name;
char **subtests;
int subtest_cnt;
};
struct test_filter_set {
struct test_filter *tests;
int cnt;
};
struct test_selector {
struct test_filter_set whitelist;
struct test_filter_set blacklist;
bool *num_set;
int num_set_len;
};
struct subtest_state {
char *name;
size_t log_cnt;
char *log_buf;
int error_cnt;
bool skipped;
bool filtered;
bool should_tmon;
FILE *stdout_saved;
};
struct test_state {
bool tested;
bool force_log;
int error_cnt;
int skip_cnt;
int sub_succ_cnt;
struct subtest_state *subtest_states;
int subtest_num;
size_t log_cnt;
char *log_buf;
FILE *stdout_saved;
};
extern int env_verbosity;
struct test_env {
struct test_selector test_selector;
struct test_selector subtest_selector;
struct test_selector tmon_selector;
bool verifier_stats;
bool debug;
enum verbosity verbosity;
bool jit_enabled;
bool has_testmod;
bool get_test_cnt;
bool list_test_names;
struct prog_test_def *test; /* current running test */
struct test_state *test_state; /* current running test state */
struct subtest_state *subtest_state; /* current running subtest state */
FILE *stdout_saved;
FILE *stderr_saved;
int nr_cpus;
FILE *json;
int succ_cnt; /* successful tests */
int sub_succ_cnt; /* successful sub-tests */
int fail_cnt; /* total failed tests + sub-tests */
int skip_cnt; /* skipped tests */
int not_built_cnt; /* tests not built */
int saved_netns_fd;
int workers; /* number of worker process */
int worker_id; /* id number of current worker, main process is -1 */
pid_t *worker_pids; /* array of worker pids */
int *worker_socks; /* array of worker socks */
int *worker_current_test; /* array of current running test for each worker */
pthread_t main_thread;
int secs_till_notify;
int secs_till_kill;
timer_t watchdog; /* watch for stalled tests/subtests */
enum { WD_NOTIFY, WD_KILL } watchdog_state;
};
Annotation
- Immediate include surface: `stdio.h`, `unistd.h`, `errno.h`, `string.h`, `assert.h`, `regex.h`, `stdlib.h`, `stdarg.h`.
- Detected declarations: `struct test_filter`, `struct test_filter_set`, `struct test_selector`, `struct subtest_state`, `struct test_state`, `struct test_env`, `struct msg`, `struct netns_obj`, `struct test_loader`, `struct expect_msg`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.