mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -04:00
Log the sizes of the caches, pools and tables under the perf trace, every 600 presents and with each memory snapshot.
Four "mem: sizes" lines give the entries and bytes of what no other line counted: the guest heap, physical maps, kernel region, lazily written ranges and the fixed kernel, setjmp, save-file, RomFS and zstd tables; pool records, mirrors, deferred destructions, upload and staging buffers, the device address table and the texture, sampler and slot caches; image views, descriptor spares, the completion queue, uniform snapshot arenas, recording copies and pins; and pipelines, layouts, stage libraries, job queues, the shader memory cache and the translator processes. Each subsystem reads its own counters under its lock; settings now count the replaced values they keep. Segment and scene lines say "-" for the world clock before it starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2033,3 +2033,14 @@ int probe_fs(void) {
|
||||
printf("probe-fs: passed (%llu files, %d sampled)\n", (unsigned long long)files, SAMPLES);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// NX2NAVI_TRACE=perf "mem: sizes" (perf.c): open save-data files and directory listings against their tables.
|
||||
void fs_host_sizes(PerfSizes *s) {
|
||||
uint64_t nf = 0, nd = 0;
|
||||
plat_mutex_lock_shared(&lock);
|
||||
for (int i = 0; i < NFILES; i++) nf += files[i].h != NULL;
|
||||
for (int i = 0; i < NDIRS; i++) nd += dirs[i].used != 0;
|
||||
plat_mutex_unlock_shared(&lock);
|
||||
perf_size(s, "save files open", nf, NFILES, PERF_SIZE_NONE);
|
||||
perf_size(s, "save listings open", nd, NDIRS, PERF_SIZE_NONE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user