tools/testing/selftests/bpf/veristat.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/veristat.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/veristat.c- Extension
.c- Size
- 84192 bytes
- Lines
- 3375
- 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
argp.hlibgen.hctype.hstring.hstdlib.hsched.hpthread.hdirent.hsignal.hfcntl.hunistd.hsys/time.hsys/sysinfo.hsys/stat.hbpf/libbpf.hbpf/btf.hbpf/bpf.hlibelf.hgelf.hfloat.hmath.hlimits.hassert.h
Detected Declarations
struct verif_statsstruct verif_stats_joinstruct stat_specsstruct filterstruct rvaluestruct field_accessstruct var_presetstruct line_cntenum stat_idenum stat_variantenum resfmtenum filter_kindenum operator_kindenum dump_modefunction libbpf_print_fnfunction log_errno_auxfunction parse_argfunction glob_matchesfunction is_bpf_obj_filefunction should_process_file_progfunction append_filterfunction strcasecmpfunction append_filter_filefunction append_filefunction append_file_from_filefunction parse_stat_id_varfunction is_asc_symfunction is_desc_symfunction parse_statfunction parse_statsfunction free_verif_statsfunction parse_verif_logfunction str_cmpfunction line_cnt_cmpfunction print_top_src_linesfunction guess_prog_type_by_ctx_namefunction mask_unrelated_struct_ops_progsfunction fixup_obj_mapsfunction bpf_object__for_each_mapfunction fixup_objfunction bpf_object__for_each_mapfunction max_verifier_log_sizefunction output_stat_enabledfunction write_one_linefunction scanf_one_linefunction destroy_stat_cgroupfunction create_stat_cgroupfunction cgroup_memory_peak
Annotated Snippet
struct verif_stats {
char *file_name;
char *prog_name;
long stats[NUM_STATS_CNT];
};
/* joined comparison mode stats */
struct verif_stats_join {
char *file_name;
char *prog_name;
const struct verif_stats *stats_a;
const struct verif_stats *stats_b;
};
struct stat_specs {
int spec_cnt;
enum stat_id ids[ALL_STATS_CNT];
enum stat_variant variants[ALL_STATS_CNT];
bool asc[ALL_STATS_CNT];
bool abs[ALL_STATS_CNT];
int lens[ALL_STATS_CNT * 3]; /* 3x for comparison mode */
};
enum resfmt {
RESFMT_TABLE,
RESFMT_TABLE_CALCLEN, /* fake format to pre-calculate table's column widths */
RESFMT_CSV,
};
enum filter_kind {
FILTER_NAME,
FILTER_STAT,
};
enum operator_kind {
OP_EQ, /* == or = */
OP_NEQ, /* != or <> */
OP_LT, /* < */
OP_LE, /* <= */
OP_GT, /* > */
OP_GE, /* >= */
};
struct filter {
enum filter_kind kind;
/* FILTER_NAME */
char *any_glob;
char *file_glob;
char *prog_glob;
/* FILTER_STAT */
enum operator_kind op;
int stat_id;
enum stat_variant stat_var;
long value;
bool abs;
};
struct rvalue {
enum { INTEGRAL, ENUMERATOR } type;
union {
long long ivalue;
char *svalue;
};
};
struct field_access {
enum { FIELD_NAME, ARRAY_INDEX } type;
union {
char *name;
struct rvalue index;
};
};
struct var_preset {
struct field_access *atoms;
int atom_count;
char *full_name;
struct rvalue value;
bool applied;
};
enum dump_mode {
DUMP_NONE = 0,
DUMP_XLATED = 1,
DUMP_JITED = 2,
};
static struct env {
Annotation
- Immediate include surface: `argp.h`, `libgen.h`, `ctype.h`, `string.h`, `stdlib.h`, `sched.h`, `pthread.h`, `dirent.h`.
- Detected declarations: `struct verif_stats`, `struct verif_stats_join`, `struct stat_specs`, `struct filter`, `struct rvalue`, `struct field_access`, `struct var_preset`, `struct line_cnt`, `enum stat_id`, `enum stat_variant`.
- 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.