WPROF_MIN_MEMORY_MIB

Constant WPROF_MIN_MEMORY_MIB 

Source
pub const WPROF_MIN_MEMORY_MIB: u32 = 2048;
Expand description

Minimum guest memory (MiB) for test entries that enable wprof.

Derivation: WprofConfig::default_args requests --ringbuf-size=256000 --ringbuf-cnt=8. wprof rounds the 256000 KB request up to the next power of two (262144 KB = 256 MiB) per ringbuf, times 8 ringbufs = 2048 MiB BPF arena. On guests below this, wprof OOM-kills mid-run before it can emit the Perfetto .pb trace, producing a truncated artifact and a confused test author.

Applied as a floor by crate::test_support::runtime::derive_test_memory_mib — the single derivation site shared by the entry-derived topology path AND every dispatch site that constructs a crate::test_support::topo::TopoOverride from CLI / preset topology (so e.g. cargo ktstr test --ktstr-topo NnNlNcNt and gauntlet preset runs honor the floor identically). Both primary and auto-repro VMs route through the same derivation so the floor propagates to both; identical topology between the two VMs is also required for stall reproducibility.

The floor applies when the derived memory max(cpus*64, 256, entry.memory_mib) falls below 2048 MiB AND entry.wprof is true. An operator-supplied crate::test_support::topo::TopoOverride with explicit memory_mib is honored verbatim per the override-is-verbatim contract — a warn-level log fires when the override conflicts with the floor, but the operator’s choice wins. Shell-mode VMs (cargo ktstr shell --kernel ...) bypass this floor entirely; the operator sets memory size via shell-mode CLI args.

Tracks WprofConfig::default_args: a future change to --ringbuf-size or --ringbuf-cnt invalidates the 2048 derivation and this const should move with the args.