mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 17:09:57 -04:00
With mem_census = 1 the census trigger compared the private bytes with the last census, and Windows charges the video memory to them, so every gigabyte of textures started another 130-260 ms walk on the presenting thread: 22 of the 33 walks of the 2026-11-13 session came from that trigger, while the process's own commit grew 307 MiB in play. The trigger now reads the private bytes less the write-combined memory of the last walk (and what the driver's device-local figure grew since), compares them with the highest figure seen at a census, and waits 60 s after the last walk; the 3600-frame censuses stay. On Windows one walk of the address space now gives both the commit census and the guest regions' committed bytes, which mem_guest_census walked a second time. The census counts the driver's write-combined views apart instead of as guest memory, counts as guest only the reserved guest regions and the loaded modules, and ranks the process's own allocations wherever they lie. The frame after a walk charges its time to a new "census" cause in the frame-time summary and the stutter map instead of "unattributed". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
1.1 KiB
C
17 lines
1.1 KiB
C
// Between perf.c (frame timing, always built) and the OS's sampling profiler (prof_win.c on Windows).
|
|
#pragma once
|
|
#include <stdint.h>
|
|
|
|
extern volatile uint32_t prof_render_tid; // the thread that presents (perf_present)
|
|
extern volatile uint32_t prof_main_tid; // the guest main thread (perf_main_thread)
|
|
extern volatile uint32_t prof_replay_tid; // the asynchronous replay (perf_replay_thread): its waits hold up the frame too
|
|
|
|
// The sampler; perf.c's weak versions do nothing.
|
|
int prof_sampler_start(void); // NX2NAVI_PROFILE: starts sampling; 1 when it runs
|
|
void prof_sampler_write(void); // writes the profile once (prof_write)
|
|
void prof_sampler_frame(uint64_t frame, uint64_t now, uint64_t d); // every present; d: the interval, 0 on the first
|
|
// NX2NAVI_MEM_CENSUS (perf.c census_check): logs where the process's committed memory lies and the guest regions'
|
|
// committed bytes from one walk of the address space; *wc the write-combined total. 0 where there is no such walk
|
|
// (perf.c's weak version): mem_guest_census walks the guest regions then.
|
|
int prof_commit_census(uint64_t frame, uint64_t *wc);
|