Repository navigation
Add multi-state sessions, CPU v2 profiles, and regression tests - #1
Merged
Merged
Conversation
Align vLua with recent pLua tooling and session APIs: write CPU v2 .pro metadata, add tools/vlua -proto export with Go tests, and replace the removed google-perftools apt package in CI. Give each lua_State its own profiler session with status/close/config and a configurable SIGPROF interval, keep hookso lrealstart/lrealstop, and return clear errors when the target C function cannot be found. Register attribution ranking, API, hot-reload stress, converter, and two-state unit tests in ctest. Document Lua 5.3.x-only support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to pLua's November tooling and session work, adapted to vLua's SIGPROF C-function sampler (Linux only; no Windows port).
.profiles with pLua-compatible metadata (magic/ version / kind / SIGPROF backend / interval). Legacy readers that walk from the tail still work.tools/vlua -protowrites gzipprofile.protofor moderngo tool pprof(no third-party Go deps).-pprofand-flame/-collapsedare unchanged. Converter hasgo testcoverage.lua_Statesessions: stopping one session does not stop others. New Lua APIs:status(),close(),set_config()/get_config(), and an optionalstart(func, path, interval_ms)argument. hooksolrealstart/lrealstopsignatures are unchanged.calc_damage/update_killahead of colder paths), function-name recovery without hostluac/./pprof, API and not-found tests, two-state unit test, hot-reload stress (crash = fail). Optionalbench_vlua.luastays out of CI.google-perftoolsapt package; install Go pprof instead. Linux remains the only CI target.Lua 5.4 is explicitly out of scope. Sessions are not OS-thread safe (same limitation as pLua). The SIGPROF path still does no Lua API calls, allocations, or locks.
On optimized Lua builds,
luaH_getshortstris often inlined intoluaH_get; attribution tests sampleluaH_getfor that reason. This is documented in the READMEs.Test plan
cmake --build build(Release,BUILD_TESTING=ON)ctest --test-dir build --output-on-failure— 8/8 passed locallygo testintools/tools/show.sh ../test(flame + proto);go tool pprof -topreads the v2 proto