mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:55:52 +01:00
[PR #1931] dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE) #1937
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1937
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1931
Author: @kawaii-shakal
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:io-trace📝 Commits (2)
9439e60dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE)a6e0360Merge upstream main into io-trace📊 Changes
6 files changed (+218 additions, -0 deletions)
View changed files
📝
docs/boot.md(+7 -0)📝
runtime/CMakeLists.txt(+7 -0)📝
runtime/shims/dstorage.cpp(+15 -0)📝
runtime/shims/file_system.cpp(+4 -0)➕
runtime/shims/io_trace.h(+100 -0)➕
runtime/test/io_trace_test.cpp(+85 -0)📄 Description
Claimed in the coordination issue as RT-IO-TRACE: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7167534627
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.