Repository navigation
dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE) - #1931
Open
kawaii-shakal wants to merge 3 commits into
Open
dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE)#1931kawaii-shakal wants to merge 3 commits into
kawaii-shakal wants to merge 3 commits into
Conversation
…ushed as it goes (RT-IO-TRACE) When a boot stops, the startup trace names the files the title opened, but most of its reading goes through DirectStorage requests and ReadFile on files it opened long before. With LEONIDA_IO_TRACE=<file>, each DirectStorage request (file, offset, sizes, zlib/BCPack, request name) and each ReadFile, ReadFileEx or ReadFileScatter on a disk file (path, offset, size) is one line with the local time. The line is flushed at once into a file shared for reading, so the last reads before a crash are on disk and can be watched while the game runs. Paths are asked of the handle each time, because a handle value is reused after a close. io_trace_test covers positioned, overlapped and reused-handle reads, DirectStorage lines with good and bad name pointers, and pipes being left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflict resolution assisted by Codex.
Contributor
|
Verified on Windows 11 (
AI-assisted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as RT-IO-TRACE: #1608 (comment)
Problem
When a boot stops,
--tracenames the files the title opened (the first 600 opens), but not what it was reading. Most of the reading goes through DirectStorage requests andReadFileon files opened long before the stop. In a 1.0.2.1 boot here, the last open came 4 minutes before the device loss.Change
With
LEONIDA_IO_TRACE=<file>, every read is one line, starting with the local time (as themem-probelines do):ds: each DirectStorage request atEnqueueRequest, with file (or<memory>), file offset, source and destination sizes, zlib, BCPack and the request's name. The name pointer is the title's, so it is copied under SEH.rf: eachReadFile,ReadFileExandReadFileScatteron a disk file, with path, offset (theOVERLAPPED's, else the handle's position) and size. The path is asked of the handle every time, because a handle value is reused after a close._wfsopen(..., _SH_DENYNO)). The last reads before a crash or device loss are on disk, and the file can be watched during the boot.It is off by default; without the variable nothing is formatted.
runtime/shims/io_trace.himplements it, with hooks indstorage.cppandfile_system.cpp.docs/boot.mddocuments the variable.Tested (Windows 11 Pro 26300, VS 2026 RelWithDebInfo)
io_tracecovers positioned, overlapped and reused-handle reads, DirectStorage lines with a good, a bad and a null name pointer, pipes left out, and reading the trace while it is open.dstorageandfile_systempass too.anim.rpf,levels.rpf,core_bvh4.rpfandpacks.rpf, with all reads stopping at the moment of the loss.🤖 Generated with Claude Code