Expand description
Unified TRACE category gate (0.7.39+).
Before 0.7.39 each subsystem checked its own env var:
SUPERMACHINE_BAKE_TRACE, SUPERMACHINE_VFS_TRACE,
SUPERMACHINE_BALLOON_TRACE, … — fourteen separate knobs.
Discoverability was poor and the env-var surface area was
sprawling.
The new shape is one variable, comma-separated categories:
SUPERMACHINE_TRACE=bake,vfs # those two categories
SUPERMACHINE_TRACE=all # everything
SUPERMACHINE_TRACE=* # synonym for "all"
SUPERMACHINE_TRACE=1 # legacy: also "all"Legacy SUPERMACHINE_<CAT>_TRACE (and the
SUPERMACHINE_TIMINGS/SUPERMACHINE_REMAP_TIMINGS variants)
still work for one release as a deprecation runway.
Categories (lowercase):
bake— bake pipeline stagesvfs— drop_vfs_caches RPC + per-restore VFS hooksballoon— virtio-balloon inflate / deflatefuse— per-FUSE-op log (virtio-fs daemon)tls— router TLS handshakevq— virtio queue eventsvsock— virtio-vsock muxerrouter— router worker-selectionremap— KVM memory remap timings during restorerosetta— amd64-on-arm64 Rosetta ioctl eventstimeout— exec timeout firing + kill latencytimings— spawn_one / acquire / coord timingsrun—supermachine runCLI lifecycle
Cost: one OnceLock-cached HashSet lookup per call. Sub-µs.
Safe to call from hot paths gated behind if trace::enabled("x").
Functions§
- enabled
- True iff the category (or “all”) is currently enabled. Use at
every site that previously checked
std::env::var_os(...). - fuse_
target - FUSE trace’s existing shape is
SUPERMACHINE_FUSE_TRACE=PATHwhere the value is a target file path (not just a boolean). This helper preserves that — returns the path when set OR returns the unified-var equivalent whenfuseis in the category set (falling back to a sentinel path the caller resolves).