Recipes
Task-oriented walkthroughs. Each recipe is self-contained: pick the one that matches your problem and follow it top to bottom. For the model behind the commands, read Core Concepts; for flag-by-flag detail, the Running Tests chapters.
Note
Two binaries appear below.
cargo ktstr <subcommand>is the host-side cargo wrapper for test workflows; barektstris the guest-init binary that doubles as a host CLI for a few tools (ctprof,topo,locks). Both install withcargo install ktstr. See cargo ktstr and ktstr (standalone).
Which recipe do I want?
| Symptom | Recipe |
|---|---|
| I have a scheduler binary and no tests | Test a New Scheduler |
| A test failed and the scheduler died | Investigate a Crash |
| Default checks don’t fit my scheduler — or nothing is checked at all | Customize Checking |
| I want gates that catch performance regressions — and proof they fire | Benchmark Gates and Negative Tests |
| Is my scheduler at least as good as the kernel default? | Compare a Scheduler vs EEVDF |
Three recipes compare two runs. They answer different questions:
| Two runs differ because… | Recipe |
|---|---|
| …the scheduler source changed (branch vs baseline commit) | A/B Compare Branches |
| …a workload got slower even though tests still pass | Diagnose a Slow Scheduler with ctprof |
| …the host changed (machine, reboot, sysctl drift) | Capture and Compare Host State |
All recipes
In rough lifecycle order:
- Test a New Scheduler — define the scheduler, write tests, sweep the BPF verifier, host the tests in your own crate
- Investigate a Crash — read the crash report, use auto-repro, pin the bug as a regression test
- A/B Compare Branches —
cargo ktstr perf-deltabetween HEAD and a baseline commit - Capture and Compare Host State —
cargo ktstr show-hostsnapshots and the perf-delta host-delta section - Diagnose a Slow Scheduler with ctprof —
per-thread off-CPU diff between two
ktstr ctprofsnapshots - Customize Checking — scheduler-level thresholds, per-test overrides, merge order
- Benchmark Gates and Negative Tests — performance gates plus the negative tests that prove they fire
- Compare a Scheduler vs EEVDF — detach the scheduler mid-run and compare phases within one test