tools/sched_ext/scx_cpu0.c
Source file repositories/reference/linux-study-clean/tools/sched_ext/scx_cpu0.c
File Facts
- System
- Linux kernel
- Corpus path
tools/sched_ext/scx_cpu0.c- Extension
.c- Size
- 2217 bytes
- Lines
- 106
- 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.hsignal.hassert.hlibgen.hbpf/bpf.hscx/common.hscx_cpu0.bpf.skel.h
Detected Declarations
function libbpf_print_fnfunction sigint_handlerfunction read_statsfunction main
Annotated Snippet
switch (opt) {
case 'v':
verbose = true;
break;
default:
fprintf(stderr, help_fmt, basename(argv[0]));
return opt != 'h';
}
}
SCX_OPS_LOAD(skel, cpu0_ops, scx_cpu0, uei);
link = SCX_OPS_ATTACH(skel, cpu0_ops, scx_cpu0);
while (!exit_req && !UEI_EXITED(skel, uei)) {
__u64 stats[2];
read_stats(skel, stats);
printf("local=%llu cpu0=%llu\n", stats[0], stats[1]);
fflush(stdout);
sleep(1);
}
bpf_link__destroy(link);
ecode = UEI_REPORT(skel, uei);
scx_cpu0__destroy(skel);
if (UEI_ECODE_RESTART(ecode))
goto restart;
return 0;
}
Annotation
- Immediate include surface: `stdio.h`, `unistd.h`, `signal.h`, `assert.h`, `libgen.h`, `bpf/bpf.h`, `scx/common.h`, `scx_cpu0.bpf.skel.h`.
- Detected declarations: `function libbpf_print_fn`, `function sigint_handler`, `function read_stats`, `function main`.
- 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.