Write the session's reports when the window loses the focus in play, more often in play, and log every end of the game in the launcher.

The session of 2026-11-13 ended 8 s after its window lost the focus, after 7 minutes of play, with none of the game's exit lines: no frame-time summary of its last period, no stutter map of its last minute and no growth ranking at all, as the ranking came every 10 minutes. When the window loses the focus in play, the present thread now writes the frame-time summary so far (starting a new period), the stutter map and the growth ranking at its next present, at most once a minute; formatting only, nothing asks the device. The growth ranking comes every 2 minutes of play instead of 10, the stutter map every 5 instead of 10.

A process that ends through exit() rather than plat_exit now writes the log thread's queue last, after the frame-time summary's exit handler, instead of losing it.

The launcher logged a game's end only for a nonzero code, so the session's end with code 0 left no line anywhere. It now logs every end of a game it started, and when the game's log has no line of the game's own end (the window's close, the game's ExitProcess, a timed run's end, a FATAL or exit line), it notes the end there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 12:41:44 -05:00
parent 00081be563
commit 7b0dbeb18d
11 changed files with 116 additions and 7 deletions

View File

@@ -5415,7 +5415,9 @@ uint64_t vk_mem_give_back(void) {
// their locks (a fraction of a millisecond, once a report), the C runtime heap's summary. Nothing is counted per frame.
#define IDLE_MIN 10 // pipelines no lookup reached for this many minutes count as unused
#define GROWTH_STEP (64ull << 20) // growth_take names a category that grew by more than this
#define RANK_EVERY_NS (600ull * 1000000000ull) // the ranking's period in play
// the ranking's period in play: every 2 minutes, as a session ended without its exit lines after 7 minutes of play had
// no ranking at all with one every 10 (2026-11-13); a ranking is one line of figures the book already holds
#define RANK_EVERY_NS (120ull * 1000000000ull)
#define HEAP_SLOW_NS 2000000ull // a heap summary that took longer is not asked for again
typedef struct {
@@ -5608,6 +5610,13 @@ void vk_mem_exit_log(void) {
plat_mutex_unlock(&grow_lock);
}
// The same ranking at a moment of the caller's (perf.c session_report, when the window loses the focus).
void vk_mem_rank_log(const char *when) {
plat_mutex_lock(&grow_lock);
if (gbook.play) rank_log_locked(when, plat_now_ns());
plat_mutex_unlock(&grow_lock);
}
static void beyond_log(VkCtx *c, uint64_t frame, const VkPhysicalDeviceMemoryBudgetPropertiesEXT *bp, const VmaBudget *vb,
const ReportFig *f) {
VkPipeMem pm;