fix(scripts): the profile readers name and count Linux samples #1746
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1746
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/profilers-linux"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The profile readers only knew the Windows module names, so on Linux
scripts/crit.pyreported every thread as never running and named nothing. That made it useless for the Kokiri Forest stutter investigation (#dev-work), where the critical path is exactly what's needed.What changes
scripts/prof.py:load_symbols()reads the Windows linker maps as before, and for the Linux build the binaries' own symbols withnm(hookshot,hookshot_vk.so). PointRX_MAPSat the game folder.RUN_MODSandmodule_name()are shared.crit.py,vkprof.py,hotlist.pyandprof.pyuse it.vkprof.pyalso counts Linux driver leaves (libnvidia-glcore.so, RADV, ANV) as running, as it doesnvoglv64.dll.docs/development.md: one line onRX_MAPSfor Linux.Testing
tests/test_prof_symbols.py. It builds a small PIE namedhookshotthat prints its own function offsets from its load address (as a sample records them), then runscrit.pyandhotlist.pyon synthetic samples: a thread inhookshotmust count as running, one in libc as blocked, and the lifted function must be named. A synthetichookshot.mapchecks that the Windows path is unchanged. It fails onmainand passes here. The ELF part skips without a C compiler andnm.python -I -B tests/run_all.py: 239 passed, 0 failed (Linux).RX_MAPS=<game folder> python -I scripts/crit.py <HOS_SAMPLE_ALL file>on a Kokiri sample now gives Presentation_Thread 27.5% running and sead::MainThread 13.5%, with the main thread's waits named (f_81207a50,f_806668b0,f_8007fe60). Before it was 0.0% for every thread.Tested on: Ubuntu 26.04, RTX 4070 Ti, driver 595.99.02, Ryzen 7 9800X3D.
🤖 Generated with Claude Code
Looks good. Read through all five scripts and the test: the Windows map path is unchanged (same bases, same
.maplookup), the Linux path uses nm offsets that match what a sample records for a PIE/shared object, andRUN_MODS/module_name()are shared sensibly. The new test is picked up by run_all'stests/test_*.pyglob, covers both the map and ELF paths, and skips cleanly without cc/nm. CI is green.Nits only, no need to change anything:
prof.py main()now honorsRX_MAPS(it used the build dir before), which is what you'd want; and thelibnvidia-glcore.soetc. prefixes in vkprof.py will miss other drivers (e.g. lavapipe), which is fine for now.