tools/sched_ext/scx_sdt.c
Source file repositories/reference/linux-study-clean/tools/sched_ext/scx_sdt.c
File Facts
- System
- Linux kernel
- Corpus path
tools/sched_ext/scx_sdt.c- Extension
.c- Size
- 2644 bytes
- Lines
- 103
- 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.hlibgen.hbpf/bpf.hscx/common.hscx_sdt.hscx_sdt.bpf.skel.h
Detected Declarations
function libbpf_print_fnfunction sigint_handlerfunction 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, sdt_ops, scx_sdt, uei);
link = SCX_OPS_ATTACH(skel, sdt_ops, scx_sdt);
while (!exit_req && !UEI_EXITED(skel, uei)) {
printf("====SCHEDULING STATS====\n");
printf("enqueues=%llu\t", skel->bss->stat_enqueue);
printf("inits=%llu\t", skel->bss->stat_init);
printf("exits=%llu\t", skel->bss->stat_exit);
printf("\n");
printf("select_idle_cpu=%llu\t", skel->bss->stat_select_idle_cpu);
printf("select_busy_cpu=%llu\t", skel->bss->stat_select_busy_cpu);
printf("\n");
printf("====ALLOCATION STATS====\n");
printf("chunk allocs=%llu\t", skel->bss->alloc_stats.chunk_allocs);
printf("data_allocs=%llu\n", skel->bss->alloc_stats.data_allocs);
printf("alloc_ops=%llu\t", skel->bss->alloc_stats.alloc_ops);
printf("free_ops=%llu\t", skel->bss->alloc_stats.free_ops);
printf("active_allocs=%llu\t", skel->bss->alloc_stats.active_allocs);
printf("arena_pages_used=%llu\t", skel->bss->alloc_stats.arena_pages_used);
printf("\n\n");
fflush(stdout);
sleep(1);
}
bpf_link__destroy(link);
ecode = UEI_REPORT(skel, uei);
scx_sdt__destroy(skel);
if (UEI_ECODE_RESTART(ecode))
goto restart;
return 0;
}
Annotation
- Immediate include surface: `stdio.h`, `unistd.h`, `signal.h`, `libgen.h`, `bpf/bpf.h`, `scx/common.h`, `scx_sdt.h`, `scx_sdt.bpf.skel.h`.
- Detected declarations: `function libbpf_print_fn`, `function sigint_handler`, `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.