feat(profiling): a profile folder carries the renderer's symbols, so a tester's zip is named anywhere #2862
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2862
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:push-pnyqsuyxrmsx"
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?
Summary
A profile folder from a tester (HOS_PROFILE=1) could only be named on a PC that has the same build. Now the run also writes
symbolsinto the folder: the renderer's (longshot_vk.so/longshot_vk.dll, our own code) function symbols as sorted<hex offset> <name>lines (mangled; the scripts demangle). Linux reads the ELF.symtab(else.dynsym) itself, so a player needs no binutils; Windows takes the code section oflongshot_vk.mapwhen it sits beside the game. No renderer or no symbols: a one-line# no symbols: <why>file. Written once at start on its own thread. It is about 1.3 MB of text (about 230 KB zipped) for a current Linux build (17k functions).The game module (
longshot,longshot.exe) is never read or written: nothing made from the game leaves the PC. The test checks that a stand-in game module's symbols stay out and that the source never names it.scripts/profiling/symbols.py(load_symbols_file, used byload_symbols),folder.py(default_maps: the game folder, else the folder's ownsymbols) andscripts/perf.py(threads/renderer/stacksdefault their symbols to the sample file's folder when it hassymbols) read it, so an unpacked zip names the renderer's frames anywhere; the game's frames staylongshot+<offset>. Docs:docs/dev/reference/profiling.md,docs/user/performance-report.md. Read first:host/profiling.c(symbols_collect).Testing
Tested: Linux only, game-free. This did not run in the game (no game run, per the person I work for).
tests/test_profile_symbols.pycuts the symbols code out ofhost/profiling.c, compiles it with a stub beside a smalllongshot_vk.so(C and C++ names) and a stand-inlongshot, and checks the file equals nm's function symbols, sorted, the game module absent, the note without a renderer, and a frame named throughsymbols.py/folder.py.host/profiling.calso passesgcc -fsyntax-only -Wall -Wextrawith the host/posix shim.test_profiling_mode.py,test_profile_report_names.pyandtest_perf_report.pypass.Still to test:
symbolsin the folder, andperf.py reporton a copy of the folder away from the game folder nameslongshot_vk:frames (by hand)longshot_vk.mapbeside the game; that branch has not been compiled or run (by hand)Measurements
Nothing to measure: a diagnostic mode's folder gains one file, written once on a side thread at start, off by default.
Risks
Profiling mode only (off by default). A side thread reads about 18 MB of the .so once at start and writes about 1.3 MB; a failure writes the note and nothing else. A revert is enough. The Windows map reader is unproven.
Checklist
Ready for review
main; the title is a Conventional Commit.--forceallowed by the person I work for)mise run testpasses. (only the touched profiling tests andtest_perf_report.pywere run, all passing)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
tests/that reads changed source is updated, not weakened.Assisted-by:/Co-Authored-By:trailers.Possibly related, for context:
WIP: feat(profiling): a profile folder carries the renderer's symbols, so a tester's zip is named anywhereto feat(profiling): a profile folder carries the renderer's symbols, so a tester's zip is named anywhere