feat(libc): rotate ANYPS5_LOG_FILE by size and add an optional frame hang watchdog #17259
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17259"
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?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-08T16:30:13Z.
What
ANYPS5_LOG_FILErotates by size.ANYPS5_LOG_MAX_BYTESsets the size limit andANYPS5_LOG_KEEPsets how many rotated files are kept. Without a limit the file grows as before.ANYPS5_HANG_SECONDS. It is off by default (unset, empty or0). When set, it reports once per hang when no frame has been presented for that many seconds, and reports again only after a new frame arrives and a later hang happens.docs/dev/ENVIRONMENT.mdanddocs/user/USAGE.md, and the known gaps indocs/dev/debt/libc.mdanddocs/dev/debt/libSceVideoOut.md.Tested
Linux, archive build of this head, focused targets only:
Not verified: rotation on Windows and macOS (only the Linux file path ran), a real hung title (the watchdog was only run through its unit test and the window start and stop), real shader compile times (not measured).
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-12T14:59:49Z.
Review: CHANGES_REQUESTED
Agreeing with @oneandonlydean's point, which is still open on the current head:
core/libs/prx/libc/src/LogFile.cpp:74-81(Tee::rotate): the results ofRemoveFile(_path)(keep 0) andRenameFile(_path, RotatedName(_path, 1))are ignored. If the rename fails (on Windows, another process holds the log withoutFILE_SHARE_DELETE), the same full file is reopened, every later write rotates again, the oldest rotated files are deleted and shifted away, and the live file grows past the limit. Please check that result and, on failure, write one notice to the terminal, turn rotation off for the rest of the run and keep appending.path.1) and checks the file keeps growing, rotated files stay intact and the notice is written once.The branch also conflicts with
mainnow; rebase when you push the fix. The rest (default path, watchdog, docs, Windows link fix) looks fine.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T16:28:09Z.
Review: COMMENTED
The watchdog can report a completed presentation before the first frame.
DisplayWindow::EnsurecallsStartFromEnvironmentimmediately after creating the window, andStartcallsBeat. If the first draw or shader compile exceeds the threshold, the warning says the last stage was “frame presented to the window” even though no presentation occurred. Please track the startup timer separately from the first presentation, and cover that case in the watchdog test.The full
log_filefixture and all three EOP flip cases passed onmainat9d362fb088and on0073d330e4under Xvfb on Linux with Mesa lavapipe. The VideoOut tests required Vulkan and disabled the shader cache. The loader insertedVK_LAYER_KHRONOS_validation1.4.369 in both paired logs. There were no missing-layer warnings orVUID-messages. The branch'svideo_out_frame_watchdogalso passed. The earlier abrupt-child failure in the isolated rotation harness did not occur in the integratedlog_filetest.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.