mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-19 06:29:58 -04:00
Say which guest region holds the memory when the process grows.
The commit census of NX2NAVI_TRACE=perf with NX2NAVI_MEM_CENSUS=1 reported the process's committed memory by kind, which lumps every guest region together. memory.c mem_guest_census now walks each reserved region (aslr, stack, heap, alias, kernel, host functions) beside it and reports the bytes committed in each, so a process that has grown to thirty gigabytes (issues #203, #215, #240) says which region to look at. Like the census, it runs only when mem_census asks for it, since the walk holds the address-space lock the game's threads take at every page fault. On the Kokiri route the answer was the aslr region at 28 to 31 GB, the heap at 7.5 GB and the alias window at 2.7 GB while the physical-memory pool itself stayed near its limit, which is what the device-loss crash follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ __attribute__((weak)) int prof_sampler_start(void) {
|
||||
__attribute__((weak)) void prof_sampler_write(void) {}
|
||||
__attribute__((weak)) void prof_sampler_frame(uint64_t frame, uint64_t now, uint64_t d) { (void)frame, (void)now, (void)d; }
|
||||
__attribute__((weak)) void prof_commit_census(uint64_t frame) { (void)frame; }
|
||||
__attribute__((weak)) void mem_guest_census(uint64_t frame) { (void)frame; }
|
||||
|
||||
// NX2NAVI_TRACE=perf, NX2NAVI_FLIGHT=1 or the full performance overlay: event counts are taken. Wait times are always taken
|
||||
// (frame-time summary). perf_base: the part fixed at start.
|
||||
@@ -448,7 +449,8 @@ static void perf_gpu_line(uint64_t frame, double interval_ms, double pace_share,
|
||||
static int census_on = -1;
|
||||
static uint64_t census_prv;
|
||||
if (census_on < 0) census_on = cfg_bool("NX2NAVI_MEM_CENSUS");
|
||||
if (census_on && (frame % 3600 == 0 || prv >= census_prv + (1ull << 30))) prof_commit_census(frame), census_prv = prv;
|
||||
if (census_on && (frame % 3600 == 0 || prv >= census_prv + (1ull << 30)))
|
||||
prof_commit_census(frame), mem_guest_census(frame), census_prv = prv;
|
||||
if (g.have_gpu && g.have_idle)
|
||||
rt_log("perf: frame %llu: gpu idle per frame %.2f ms between timed parts: %.2f ms waiting for the next submission, "
|
||||
"%.2f ms with it queued (untimed work or waits); %.1f gaps over 0.5 ms, longest %.2f ms; submit to start avg %.2f ms",
|
||||
|
||||
Reference in New Issue
Block a user