mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 13:39:58 -04:00
Name the work behind each frame on any thread under the perf trace: RomFS reads, zstd decodes, pipeline creates, guest memory maps, pool initialize and finalize, and device memory allocations.
A slow frame's line and the 60-frame window's line now say how long each kind took on any thread, how often, how many bytes and the longest single one, so a hitch outside the render thread's own waits has a named cause. While NX2NAVI_TRACE=perf is off each site pays one branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -271,7 +271,7 @@ static void destroy_rec(VkCtx *c, PoolRec *r) {
|
||||
free(r);
|
||||
}
|
||||
|
||||
int vk_pool_init(pool_t *p) {
|
||||
static int pool_init(pool_t *p) {
|
||||
VkCtx *c = vk_ctx();
|
||||
if (!c) { rt_log("vk: MemoryPoolInitialize before vk_init"); return 0; }
|
||||
// The GPU never sees a GPU_NO_ACCESS pool, except a physical one (0x189; 1.4.3 also 0x18c, CPU-visible) through the
|
||||
@@ -346,7 +346,7 @@ static uint32_t gpa_cover(uint64_t a) {
|
||||
|
||||
static void gpa_retire(void *arg) { destroy_rec(vk_ctx(), arg); }
|
||||
|
||||
void vk_pool_fini(pool_t *p) {
|
||||
static void pool_fini(pool_t *p) {
|
||||
VkCtx *c = vk_ctx();
|
||||
if (!c) return;
|
||||
pidx_ent e;
|
||||
@@ -396,6 +396,21 @@ void vk_pool_fini(pool_t *p) {
|
||||
else destroy_rec(c, r);
|
||||
}
|
||||
|
||||
// NX2NAVI_TRACE=perf: a pool's initialize and finalize, with their imports, allocations, uploads and GPU waits, marked
|
||||
// as work a frame can wait for (perf.c perf_mark_add).
|
||||
int vk_pool_init(pool_t *p) {
|
||||
uint64_t t0 = perf_mark_begin();
|
||||
int r = pool_init(p);
|
||||
perf_mark_end(PERF_M_POOL, t0, p->size);
|
||||
return r;
|
||||
}
|
||||
|
||||
void vk_pool_fini(pool_t *p) {
|
||||
uint64_t t0 = perf_mark_begin(), size = p->size;
|
||||
pool_fini(p);
|
||||
perf_mark_end(PERF_M_POOL, t0, size);
|
||||
}
|
||||
|
||||
// pool_lock held: the device address table follows a MapVirtual request on [lo, hi) of virtual pool v. Ranges it
|
||||
// covers whole leave the table (their records retire); the pages then name the physical pool's buffer at poff, or none.
|
||||
static void gpa_map_virtual(PoolRec *v, uint64_t lo, uint64_t hi, PoolRec *ph, uint64_t poff) {
|
||||
|
||||
Reference in New Issue
Block a user