mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 21:29:58 -04:00
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>
25 lines
1.8 KiB
C
25 lines
1.8 KiB
C
// The stutter map (NX2NAVI_STUTTER_MAP=1, stutter_map.c): for a play session, which frames hitched, in which area, what
|
|
// the frame waited for, and which pipelines and shaders draws met missing, so the next pipeline list and shader
|
|
// preparation can take them in.
|
|
#pragma once
|
|
#include <stdint.h>
|
|
|
|
extern int stutter_map_on; // set once at start (stutter_map_init); every hook below returns at once while it is 0
|
|
|
|
void stutter_map_init(void);
|
|
// An area's load (perf.c perf_scene, from romfs.c): hitches from here on are counted in that area, and those within
|
|
// SM_LOAD_NS of the load apart from play.
|
|
void stutter_area(const char *name);
|
|
// A draw met its pipeline (shader 0) or one of its shaders (shader 1) missing and the replay thread spent ns on it
|
|
// before it was bound or skipped (vk_exec_draw.c, beside wait_note). vi, fi: the vertex (or mesh) and fragment shaders'
|
|
// input ids, NULL when not known (still translating, or no fragment stage).
|
|
void stutter_miss(int shader, int mesh, const uint8_t *vi, const uint8_t *fi, uint64_t ns, int skipped);
|
|
// A pipeline a draw missed became usable ms after the miss (vk_pipeline.c ready_note): recorded 1 when pipeline-keys.bin
|
|
// (or the seed list) named it, fresh 1 when one of its shaders was translated in this session (not prepared).
|
|
void stutter_ready(int mesh, const uint8_t *vi, const uint8_t *fi, double ms, int recorded, int fresh, int fast);
|
|
// Every present (perf.c ft_frame): d the frame's interval, part the time it went to by cause (names[i], n of them;
|
|
// the last one is the part nothing recorded explains), cause the one the frame is charged to.
|
|
void stutter_frame(uint64_t frame, uint64_t now, uint64_t d, const uint64_t *part, const char *const *names, int n,
|
|
int cause);
|
|
void stutter_report(const char *tag); // the map so far; every 5 minutes of play, at a focus loss in play and at exit
|