Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
ktstr
Early stage. APIs, CLI, and internals are actively evolving. Expect breaking changes between releases.
Test harness for Linux process schedulers, with a focus on sched_ext. Boots kernels in KVM VMs with synthetic CPU topologies, runs workloads, and verifies scheduling correctness. Also tests under the kernel's default EEVDF scheduler.
- Real isolation -- each test boots its own kernel. No host interference, no shared state.
- Any topology -- 1 to 252 CPUs with arbitrary LLC structure via synthetic ACPI tables.
- Data-driven -- scenarios declare cgroups, cpusets, workloads, and verification as data.
- Gauntlet -- all scenarios across 19 topology presets in parallel VMs. Baseline save/compare for A/B testing.
#[ktstr_test]-- proc macro for integration tests that boot their own VMs.- Auto-repro -- reruns failures with BPF probes on the crash call chain.
See the full feature list.
Installation
ktstr is the host-side CLI for running scenarios and managing cached
kernel images (outside VMs). cargo-ktstr (included in the same crate)
automates kernel configuration, building, and test execution in one
command. scx-ktstr (the test fixture scheduler) is built automatically
by the workspace and does not need a separate install. Library consumers
should use default-features = false to avoid pulling in CLI
dependencies.
Setup
Prerequisites: Linux with /dev/kvm, Rust >= 1.88, clang, pkg-config.
# Ubuntu/Debian
Add to your crate:
[]
= { = "0.1", = false }
Test files go in tests/ as standard Rust integration tests. Use #[ktstr_test] from ktstr::prelude::*.
See the getting started guide for Fedora packages, kernel discovery, and building a test kernel.
Quick start
Define a scheduler
Use #[derive(Scheduler)] to declare the scheduler binary, default
topology, and feature flags:
use *;
This generates a const MY_SCHED: Scheduler and per-variant flag
constants. Tests referencing MY_SCHED inherit its topology and
flags. Without a scheduler, tests run under EEVDF.
Write a test
Declare cgroups and workloads as data with CgroupDef and
execute_defs:
use *;
For multi-step scenarios with dynamic topology changes, use
execute_steps with Step and HoldSpec:
use *;
Run
Requires /dev/kvm.
Dev workflow
cargo ktstr handles kernel config, build, and test execution:
Host-side CLI
ktstr runs scenarios on the host (outside VMs) under whatever
scheduler is already active, and manages cached kernel images:
Or via cargo run from the workspace:
Documentation
Guide -- getting started, concepts, writing tests, recipes, architecture.
API docs -- rustdoc for all workspace crates.
License
GPL-2.0-only