perf(libkernel): read a loaded image's unwind tables once in sceKernelGetModuleInfoFromAddr #3514
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3514"
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?
Imported from boykopovar/AnyPS5. Originally posted by gookie-dev on 2026-10-11T12:06:34Z.
What
sceKernelGetModuleInfoFromAddrfound the size of the image's.eh_frameon every call by walking all of its CIE/FDE records (EhFrame::FramesSize), checking each against everyPT_LOADheader. The guest libc's unwinder calls it for each frame it unwinds, so a title that unwinds often walks its whole.eh_framehundreds of times per second.The tables read from a
.eh_frame_hdrare now kept per header address and reused while the image stays loaded. The cache is dropped wheneverdl_iterate_phdrreports that an object was unloaded (dlpi_subs), so an address reused by another image is read again. Linux path only; Windows reads.ehmetaand is unchanged.Tested
Ubuntu 24.04, GCC 13.3, Release.
guest_module_infonow queries a module twice and expects the same tables, then unloads it, loads it again and expects tables of the same size at the same offset in the new image.guest_unwind_module_infoandguest_unwind_module_info_failurepass.--to-intel, title screen, 10 s CPU sampling: 9269 samples before, 53.7% of them in this walk (FindImage<ModuleInfoEx>); 3306 after, 3.2% in the lookup. Over 500 calls per second, counted under gdb (which slows the title).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T13:16:25Z.
The current conventions and relinker failures are all from checkout, before the PR code runs: the failed run checked merge commit
2220effbe42c850d7f8df56dbac52e3cdea54009and reportsNo url found for submodule path '3rdparty/imgui' in .gitmodules. Currentmain(a11c8f7f70a0ed4e71504a89de69e8cdae687817) no longer has that orphan gitlink, so this run is stale relative to the fixed base. Please rebase or trigger a fresh run against currentmainbefore treating those failures as PR-specific.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T19:52:07Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libkernel/Module/src/ModuleInfo.cppL24-25Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:29:35Z.
Checked the diff, built it merged onto current main and ran the libs/libkernel ctest scope (112 tests,
guest_module_infoincluded) green. The cache is read and cleared under the loader lock held bydl_iterate_phdr, keyed by header address and dropped ondlpi_subschanges; Windows is untouched. Merging.