Files
NX2navi/runtime/prof_syms.h
Tobim6 f3a9d2967f Profiler: name the exe's addresses from its own symbol table, and sample the replay thread alone.
A NX2NAVI_PROFILE profile needed the link map to name its Rips, and the launcher's builds keep none. A MinGW link keeps
the COFF symbol table in the exe, so prof_sampler_write now reads it (runtime/prof_syms.c, plain file reads) and appends
`sym <address> <function>+<offset>` for every exe address in the Rip and chain lists. NX2NAVI_PROFILE_REPLAY=1 samples
only the replay thread: with NX2NAVI_REPLAY_ASYNC=1 the render thread spends 98% of a 37 ms frame waiting, and the
replay thread (22 ms a frame recording Vulkan commands) is the one to look at.

(cherry picked from commit 9d3126ca780d7f0f0b91468d42b8ee70572747c8)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:22:00 +01:00

10 lines
460 B
C

#pragma once
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
// Writes `sym <address> <function>+0x<offset>` for each of the n addresses (any order, repeats allowed) that falls in
// the image loaded at base, from the COFF symbol table of the file at exe_path. Returns the lines written, -1 when the
// file has no symbol table or cannot be read.
int prof_syms_write(FILE *out, const char *exe_path, uint64_t base, const uint64_t *addr, size_t n);