pub const WPROF_MIN_MEMORY_MIB: u32 = crate::test_support::runtime::WPROF_MIN_MEMORY_MIB; // 16u32Expand description
Minimum guest memory (MiB) for test entries that enable wprof.
Derivation: WprofConfig::default_args requests a single 16 MiB
BPF ring buffer (--ringbuf-size=16384 --ringbuf-cnt=1). wprof
faults the whole arena in on capture, so guest RAM must cover it.
The floor is computed from the default ringbuf constants at
crate::test_support::runtime::WPROF_MIN_MEMORY_MIB (16 MiB), so
editing --ringbuf-size/--ringbuf-cnt moves the floor with them.
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 it AND
entry.wprof is true. At the minimal default the 16 MiB arena
sits below the universal 256 MiB memory floor, so this floor is
subsumed and never bumps a real VM — the point is that the
default no longer oversizes; it re-engages only if the default
ringbuf sizing grows the arena past the universal floor. A test
that overrides to a larger arena via
#[ktstr_test(wprof_args = "...")] must raise its own
memory_mib if that arena exceeds the guest’s normal memory. An
operator-supplied crate::test_support::topo::TopoOverride with
explicit memory_mib is honored verbatim per the
override-is-verbatim contract. Shell-mode VMs
(cargo ktstr shell --kernel ...) bypass this floor entirely;
the operator sets memory size via shell-mode CLI args.