diff options
| author | MoonEyes <ducoinbenjamin@yahoo.fr> | 2026-11-29 16:43:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-29 16:43:26 +0100 |
| commit | 950259cd409ec8e12bb383bc6ebb9918be78ae76 (patch) | |
| tree | 84d2d060ce62827d6bfb5efe99f60e556b2cedca /runtime/shims/file_system.cpp | |
| parent | 15701e412d126d637f6b8480bb911d1782a3746c (diff) | |
| parent | 7d571f75b7e126e69f8eb61d151ac7f11d866803 (diff) | |
Merge pull request #1931 from kawaii-shakal/io-trace
dstorage, fs: LEONIDA_IO_TRACE logs every read the title asks for, flushed as it goes (RT-IO-TRACE)
Diffstat (limited to 'runtime/shims/file_system.cpp')
| -rw-r--r-- | runtime/shims/file_system.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/shims/file_system.cpp b/runtime/shims/file_system.cpp index afac581ad..6326f3caf 100644 --- a/runtime/shims/file_system.cpp +++ b/runtime/shims/file_system.cpp | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | #include "file_system.h" | 43 | #include "file_system.h" |
| 44 | #include "shims.h" | 44 | #include "shims.h" |
| 45 | #include "startup_trace.h" | 45 | #include "startup_trace.h" |
| 46 | #include "io_trace.h" // LEONIDA_IO_TRACE | ||
| 46 | #include "../src/title_page_watch.h" | 47 | #include "../src/title_page_watch.h" |
| 47 | 48 | ||
| 48 | namespace rt::fs { | 49 | namespace rt::fs { |
| @@ -1729,6 +1730,7 @@ using namespace rt::fs; | |||
| 1729 | // fails with ERROR_NOACCESS (998), and the title's read loop sleeps 1 ms and retries forever (measured on 1.0.2.1, | 1730 | // fails with ERROR_NOACCESS (998), and the title's read loop sleeps 1 ms and retries forever (measured on 1.0.2.1, |
| 1730 | // native Windows). Touching the pages from user mode commits them; the read is then retried once. | 1731 | // native Windows). Touching the pages from user mode commits them; the read is then retried once. |
| 1731 | BOOL WINAPI read_file(HANDLE file, LPVOID buffer, DWORD bytes, LPDWORD read, LPOVERLAPPED overlapped) { | 1732 | BOOL WINAPI read_file(HANDLE file, LPVOID buffer, DWORD bytes, LPDWORD read, LPOVERLAPPED overlapped) { |
| 1733 | rt::io_trace::note_read_file(file, bytes, overlapped); | ||
| 1732 | if (leonida::kernel_writes::read_file(file, buffer, bytes, read, overlapped)) return TRUE; | 1734 | if (leonida::kernel_writes::read_file(file, buffer, bytes, read, overlapped)) return TRUE; |
| 1733 | if (GetLastError() != ERROR_NOACCESS || !buffer || !bytes) return FALSE; | 1735 | if (GetLastError() != ERROR_NOACCESS || !buffer || !bytes) return FALSE; |
| 1734 | static std::atomic<bool> logged{false}; | 1736 | static std::atomic<bool> logged{false}; |
| @@ -1740,10 +1742,12 @@ BOOL WINAPI read_file(HANDLE file, LPVOID buffer, DWORD bytes, LPDWORD read, LPO | |||
| 1740 | } | 1742 | } |
| 1741 | BOOL WINAPI read_file_ex(HANDLE file, LPVOID buffer, DWORD bytes, LPOVERLAPPED overlapped, | 1743 | BOOL WINAPI read_file_ex(HANDLE file, LPVOID buffer, DWORD bytes, LPOVERLAPPED overlapped, |
| 1742 | LPOVERLAPPED_COMPLETION_ROUTINE routine) { | 1744 | LPOVERLAPPED_COMPLETION_ROUTINE routine) { |
| 1745 | rt::io_trace::note_read_file(file, bytes, overlapped); | ||
| 1743 | return leonida::kernel_writes::read_file_ex(file, buffer, bytes, overlapped, routine); | 1746 | return leonida::kernel_writes::read_file_ex(file, buffer, bytes, overlapped, routine); |
| 1744 | } | 1747 | } |
| 1745 | BOOL WINAPI read_file_scatter(HANDLE file, FILE_SEGMENT_ELEMENT segments[], DWORD bytes, LPDWORD reserved, | 1748 | BOOL WINAPI read_file_scatter(HANDLE file, FILE_SEGMENT_ELEMENT segments[], DWORD bytes, LPDWORD reserved, |
| 1746 | LPOVERLAPPED overlapped) { | 1749 | LPOVERLAPPED overlapped) { |
| 1750 | rt::io_trace::note_read_file(file, bytes, overlapped); | ||
| 1747 | return leonida::kernel_writes::read_file_scatter(file, segments, bytes, reserved, overlapped); | 1751 | return leonida::kernel_writes::read_file_scatter(file, segments, bytes, reserved, overlapped); |
| 1748 | } | 1752 | } |
| 1749 | 1753 | ||