The entry stub's RUNTIME_FUNCTION now ends before its final jmp [r10], so a stack walk there finds the return
address. The writer lock is taken with a 10 ms bound: a dropped record is counted and the next one writes
`# dropped <count>`. The next view is mapped ahead so a failed remap still ends the file in `# truncated`.
title_free_impl and create_file_w take the caller from the exported shim; a failed VirtualProtect deletes the
function table; pe_loader builds the module name only when tracing. Rules: 205, hash 873cd3bb78a70bc5.
Tested: full runtime build passes; ctest on the 149 non-GPU tests: 100% tests passed, 0 tests failed out of 149; xmem alone: 1/1 passed; xs_proxy_mock|xmem_: 100% tests passed, 0 tests failed out of 13; python -I tests/test_call_trace_rules.py OK. Not run in game.
LEONIDA_CALL_TRACE=<path> (cap LEONIDA_CALL_TRACE_MAX_MB, default 4096) records every call through the import
tables of the main image and the title DLLs in the shared v1 format, with the rules of tools/call_trace_rules.def.
Each import slot gets a 24-byte thunk to one of two common stubs (entry-only: jump, real return address; wrap: frame,
C and R lines), registered with RtlAddFunctionTable. The file is created new, written through 4 MiB mapped views.
Shims read their caller through RT_CALLER(), which sees through the wrap frame; unset, wrap() returns its target.
runtime/test/call_trace_test.cpp (ctest call_trace) and tests/test_call_trace_rules.py cover it.
Tested: full runtime build (RelWithDebInfo) passes; ctest on the 149 non-GPU tests that cannot open a Vulkan device or window: 100% tests passed, 0 tests failed out of 149; python tests of the rules, line endings, docs env vars pass. Not run in game.