Preserve Python and Node symbols in memory flamegraphs - #556
Draft
not-matthias wants to merge 4 commits into
Draft
not-matthias wants to merge 4 commits into
not-matthias wants to merge 4 commits into
Conversation
Merging this PR will not alter performance
|
Python and Node write runtime symbols to /tmp/perf-<pid>.map, and Python JIT dumps carry the unwind data needed to walk through interpreter trampolines. Collect both for the benchmark processes before saving the memtrack metadata, reusing the walltime artifact pipeline, so offline allocation stacks keep their runtime frames.
Memory stacks can only name Python and Node frames from the runtime perf maps. Set PYTHONPERFSUPPORT and the Node perf options per benchmark command, as simulation mode already does. Memory mode also passes --interpreted-frames-native-stack, since interpreted JS frames otherwise all resolve to the shared V8 interpreter trampoline.
Track a native allocation made from a Python function (perf trampoline) and a Node function (V8 perf-basic-prof). Assert the allocation carries a captured stack and that the runtime perf map names the allocating function, which offline attribution needs.
not-matthias
force-pushed
the
cod-3654-support-memory-flamegraphs-for-pythonnode
branch
from
October 2, 2026 15:19
5c6e4f0 to
62fd7de
Compare
A process can map the same file at several addresses at once. V8 remaps its embedded builtins out of the node binary into its code range, so node runs from both its original text and that copy. Each placement has its own load bias, but only the last mapping per (path, pid) was kept, so frames in every earlier placement lost their symbols and unwind data. In a Node memory profile, all native node frames showed up as unresolved addresses. Record every distinct load bias and the unwind data of every executable mapping for each process, and emit them all in the artifact metadata. The walltime perf path shares this bookkeeping and gets the same fix. Add a sample that maps its own text a second time and allocates through both copies. The test feeds that process's real mappings into the artifact pipeline and checks that both copies resolve. Refs COD-1377
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
NODE_OPTIONS.Verification
cargo test --release --bin codspeed writes_keyed_artifacts_and_metadata_for_a_streamed_mappingcargo fmt --all --check