mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 07:31:06 -04:00
The review of the log tail change found that main.c log_sink opened the 4 MiB reserve past the cap on g_log_final as well as on g_log_ending. bugcap.c write_log_tail calls rt_log_sync in play, which sets g_log_final, so after a bug capture in a trace = perf session past the cap, ordinary play lines filled the reserve (about 6 minutes at 12 KB/s), the end's lines were dropped again, and the "end of the run follows" line came mid-run. The reserve is now keyed on g_log_ending alone, as E-10's design had it. The ends that relied on rt_log_sync now call rt_log_ending first: dispatch.c fatal_end and main.c crash_handler right after their guard, vk_device.c lost_wait_exit's watchdog before its sync, and plat_exit through the new main.c log_sync_ending (plat_exit_hook in a game run), so every path that ends through plat_exit marks the end too. rt_exit_begin and perf_summary_flush call it as before. Not reproduced in the game before the change. tests/log_cap_check.py gains a capture case (rt_log_sync in play, 1000 more play lines, then the end): on the code before this change 58 play lines took the reserve, the end line came at the sync and no end line reached the file; now no play line passes the cap and the end's lines fill the reserve. A fatal case runs rt_log_ending and then rt_log_sync, and static checks hold crash_handler, log_sync_ending, fatal_end and lost_wait_exit to calling rt_log_ending before rt_log_sync. log_cap_check, fatal_exit_check (with a stand-in for rt_log_ending) and the compile checks of main.c, dispatch.c and vk_device.c pass, with no new -Wall warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
61 KiB
61 KiB