feat: discover jitdump files from MMAP2 records#280
Open
DaniPopes wants to merge 4 commits intoCodSpeedHQ:mainfrom
Open
feat: discover jitdump files from MMAP2 records#280DaniPopes wants to merge 4 commits intoCodSpeedHQ:mainfrom
DaniPopes wants to merge 4 commits intoCodSpeedHQ:mainfrom
Conversation
The jitdump search was hardcoded to /tmp/jit-{pid}.dump, which
misses jitdumps from LLVM ORC JIT (e.g. revmc, Julia) that write to
{JITDUMPDIR|HOME}/.debug/jit/*/jit-{pid}.dump per JITLoaderPerf.cpp.
Instead of searching hardcoded filesystem paths, extract jitdump file paths from MMAP2 records in the perf data. This is how perf inject finds them and works for any jitdump location.
Only match basenames of the form jit-<digits>.dump instead of any .dump suffix. This matches the validation in perf's jit_detect().
Match perf's jit_detect() behavior: the PID embedded in the jitdump filename must match the MMAP2 record's PID. Also fixes a bug where rposition returned a usize that was incorrectly used as a byte slice.
8f488d7 to
92ff4b6
Compare
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.
Jitdump discovery was hardcoded to
/tmp/jit-{pid}.dump, missing dumps from LLVM ORC JIT (e.g. revmc, Julia) which write to~/.debug/jit/*/jit-{pid}.dump.Instead of searching hardcoded filesystem paths, extract jitdump file paths from MMAP2 records in the perf data, matching how
perf inject --jitdiscovers them viajit_detect().