tools/testing/selftests/cgroup/test_freezer.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/cgroup/test_freezer.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/cgroup/test_freezer.c- Extension
.c- Size
- 29424 bytes
- Lines
- 1513
- 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
stdbool.hlinux/limits.hsys/ptrace.hsys/types.hsys/mman.hunistd.hstdio.herrno.hstdlib.hstring.hsys/wait.hkselftest.hcgroup_util.h
Detected Declarations
struct cgfreezer_testfunction cg_check_frozenfunction cg_freeze_nowaitfunction eventsfunction cg_freeze_waitfunction child_fnfunction test_cgfreezer_simplefunction test_cgfreezer_treefunction forkbomb_fnfunction test_cgfreezer_forkbombfunction test_cgfreezer_mkdirfunction test_cgfreezer_rmdirfunction test_cgfreezer_migratefunction test_cgfreezer_ptracefunction proc_check_stoppedfunction test_cgfreezer_stoppedfunction test_cgfreezer_ptracedfunction vfork_fnfunction vforkfunction cg_check_freezetimefunction test_cgfreezer_time_emptyfunction test_cgfreezer_time_simplefunction test_cgfreezer_time_populatefunction test_cgfreezer_time_migratefunction test_cgfreezer_time_parentfunction test_cgfreezer_time_childfunction test_cgfreezer_time_nestedfunction main
Annotated Snippet
struct cgfreezer_test {
int (*fn)(const char *root);
const char *name;
} tests[] = {
T(test_cgfreezer_simple),
T(test_cgfreezer_tree),
T(test_cgfreezer_forkbomb),
T(test_cgfreezer_mkdir),
T(test_cgfreezer_rmdir),
T(test_cgfreezer_migrate),
T(test_cgfreezer_ptrace),
T(test_cgfreezer_stopped),
T(test_cgfreezer_ptraced),
T(test_cgfreezer_vfork),
T(test_cgfreezer_time_empty),
T(test_cgfreezer_time_simple),
T(test_cgfreezer_time_populate),
T(test_cgfreezer_time_migrate),
T(test_cgfreezer_time_parent),
T(test_cgfreezer_time_child),
T(test_cgfreezer_time_nested),
};
#undef T
int main(int argc, char *argv[])
{
char root[PATH_MAX];
int i;
ksft_print_header();
ksft_set_plan(ARRAY_SIZE(tests));
if (cg_find_unified_root(root, sizeof(root), NULL))
ksft_exit_skip("cgroup v2 isn't mounted\n");
for (i = 0; i < ARRAY_SIZE(tests); i++) {
switch (tests[i].fn(root)) {
case KSFT_PASS:
ksft_test_result_pass("%s\n", tests[i].name);
break;
case KSFT_SKIP:
ksft_test_result_skip("%s\n", tests[i].name);
break;
default:
ksft_test_result_fail("%s\n", tests[i].name);
break;
}
}
ksft_finished();
}
Annotation
- Immediate include surface: `stdbool.h`, `linux/limits.h`, `sys/ptrace.h`, `sys/types.h`, `sys/mman.h`, `unistd.h`, `stdio.h`, `errno.h`.
- Detected declarations: `struct cgfreezer_test`, `function cg_check_frozen`, `function cg_freeze_nowait`, `function events`, `function cg_freeze_wait`, `function child_fn`, `function test_cgfreezer_simple`, `function test_cgfreezer_tree`, `function forkbomb_fn`, `function test_cgfreezer_forkbomb`.
- 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.