Complete CLI commands, arguments, and environment variables for the xenia-rs tool — update this when CLI changes
project
08576735-74b4-4180-994a-2eb93dc60997
Update trigger: Whenever the xenia-rs CLI changes (new commands, flags, env vars), update this file and the MEMORY.md index entry. Last documented: 2026-04-22 (added exec --halt-on-deadlock + XENIA_HALT_ON_DEADLOCK env var for deadlock investigation — bypasses the force-wake recovery path so the ctx snapshot survives).
Binary
xenia-rs — Xbox 360 XEX/XISO reverse-engineering toolchain
Emit Chrome about:tracing JSON of all spans (uses tracing-chrome). Loadable in chrome://tracing / Perfetto
--profile <PATH>
path
Start pprof sampling profiler at 100 Hz. .svg → flamegraph; .pb → pprof protobuf. Requires profiling Cargo feature (on by default)
Cargo features on xenia-app:
profiling (default): pulls pprof = { features = ["flamegraph", "protobuf-codec"] }. Disable with --no-default-features for minimal release builds; --profile then fails at startup with a clear error.
Max instructions before stop (unlimited if omitted)
--ips-limit
Option<u64>
none
Throttle to N instructions per second (unlimited if omitted). Check runs once per scheduler round at run_execution's outer loop — anchor is Instant::now() at function entry
--db
Option<String>
none
SQLite DB path; includes full static analysis + opt-in trace tables
--trace-instructions
bool flag
false
Log each instruction to exec_trace table
--trace-imports
bool flag
false
Log kernel/import calls to import_calls table
--trace-branches
bool flag
false
Log taken branches to branch_trace table
--quiet
bool flag
false
Suppress banners, kernel logs, register dump
--ui
bool flag
false
Open winit+wgpu window for dynamic analysis; backs XamInputGetState with gilrs; presents guest frontbuffer on VdSwap; CPU runs on worker thread. HUD shows swap count + last frontbuffer addr + pad state. Phase 1: no PM4/shader execution, so the frontbuffer is typically black for real games — HUD remains live.
--halt-on-deadlock
bool flag
false
At the hard-deadlock branch in run_execution (all live HW threads Blocked on handle waits, no pending timer), emit a per-HW-slot warn! with tid/state/pc/lr/sp and break instead of force-waking waiters with STATUS_TIMEOUT. Increments scheduler.deadlock_halts metric; sets the UI shutdown flag so the window closes alongside the worker. Default is force-wake (preserved probe-run behaviour — counts as scheduler.deadlock_recoveries). Also settable via XENIA_HALT_ON_DEADLOCK=1.
Typical use: Run once on a known-good build → commit the output as run.digest.json. CI re-runs xenia-rs check … --expect run.digest.json; non-zero exit blocks the PR on drift.
Default: enabled (simulated pad when no physical controller)
Disable with: XENIA_FAKE_PAD=0 (or false / off)
Effect: when no gilrs pad is attached, XamInputGetState still returns STATUS_SUCCESS with an all-zero X_INPUT_STATE so games don't bail with ERROR_DEVICE_NOT_CONNECTED. Set to 0 to get truthful "no controller" reporting.
Effect: random (with optional u64 XENIA_SCHED_SEED) shuffles round order for fuzzing thread interleavings.
XENIA_HALT_ON_DEADLOCK
Source: xenia-rs/crates/xenia-app/src/main.rs (resolved at the top of run_execution)
Values: 1 or true (case-insensitive) to enable; anything else = disabled
Default: disabled (force-wake waiters with STATUS_TIMEOUT, increment scheduler.deadlock_recoveries)
Effect: equivalent to exec --halt-on-deadlock. OR'd with the flag — either source is sufficient to trip the halt path. Use from shells / recipes without rewiring CLI args.
RUST_LOG_SPAN_EVENTS
Source: parsed by observability::parse_span_events
Values: full | close | active | enter | exit | new (anything else = none)
Effect: Controls the FmtSpan setting on fmt layers. close is the most useful — every span emits a line with time.busy/time.idle elapsed, giving per-phase timing in the console without reading a Chrome trace.
Database Table Layering
Command
Tables
extract --db
metadata, sections, imports
dis --db
above + functions, labels, instructions, xrefs
exec --db
above + exec_trace, import_calls, branch_trace*
*Only written when corresponding --trace-* flag is passed to exec.
Why: Cumulative schema lets analysis tools query across all levels without joining separate DBs.
How to apply: When suggesting DB workflows, recommend the appropriate command tier for the user's analysis goal.