Repository navigation
fix(valgrind): stop excluding the node executable from callgrind - #617
Draft
not-matthias wants to merge 2 commits into
Draft
not-matthias wants to merge 2 commits into
not-matthias wants to merge 2 commits into
Conversation
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Pass --separate-callers=all --pop-on-jump to callgrind. With the node executable instrumented, V8 builtins sit between most pairs of JS functions; as single nodes they join every JS caller to every JS callee and form false cycles. Whole-stack contexts keep the chains apart, and --pop-on-jump keeps tail-jump chains (bytecode handler dispatch) from nesting. Requires a valgrind-codspeed release with --separate-callers=all (CodSpeedHQ/valgrind-codspeed#63).
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.
Fixes COD-4155.
1. Stop excluding the node executable
The runner ran
node -e 'console.log(process.execPath)'and added the result to callgrind's ignored objects. Node runtime cost was then missing from simulation profiles. Removeget_node_objectsso the node executable is instrumented.2. Pass
--separate-callers=all --pop-on-jumpto callgrindWith node instrumented, V8 builtins (
Call*,CallFunction*, bytecode handlers) sit between most pairs of JS functions. As single nodes they join every JS caller to every JS callee and form false cycles in the flame graph.--separate-callers=allnames every function by its whole call stack, so unrelated chains stay apart;--pop-on-jumpmakes tail jumps replace the jumping frame, which keeps those stacks shallow.Dependencies:
--separate-callers=alland the--pop-on-jumpfixes: fix(callgrind): correct V8 call graphs (Sparkplug returns, whole-stack contexts, pop-on-jump) valgrind-codspeed#63. The current pin rejects the flag, so the pin must be bumped before merging.'callercontext suffixes from function names.node -e 0writes 309 MB with these flags (4 MB before).Companion change in codspeed-node removes the matching
callgrindAddObjSkip(process.execPath)call: CodSpeedHQ/codspeed-node#121