mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 14:39:58 -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:
@@ -490,3 +490,14 @@ void vk_usnap_shutdown(void) {
|
||||
free_arenas = NULL;
|
||||
plat_mutex_unlock(&free_lock);
|
||||
}
|
||||
|
||||
// NX2NAVI_TRACE=perf "mem: sizes" (perf.c): the free uniform snapshot arenas (the free list is never trimmed) and the
|
||||
// GPU-write list (the replay thread's; read without a lock, a line may be one write behind).
|
||||
void vk_usnap_sizes(PerfSizes *s) {
|
||||
uint64_t n = 0, b = 0;
|
||||
plat_mutex_lock(&free_lock);
|
||||
for (const Arena *a = free_arenas; a; a = a->next) n++, b += a->size;
|
||||
plat_mutex_unlock(&free_lock);
|
||||
perf_size(s, "free uniform snapshot arenas", n, 0, b);
|
||||
perf_size(s, "uniform snapshot GPU writes", (uint64_t)__atomic_load_n(&U.nwr, __ATOMIC_RELAXED), 0, PERF_SIZE_NONE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user