Skip to content

feat: discover jitdump files from MMAP2 records#280

Open
DaniPopes wants to merge 4 commits intoCodSpeedHQ:mainfrom
DaniPopes:dani/jit-dump-llvm-orc
Open

feat: discover jitdump files from MMAP2 records#280
DaniPopes wants to merge 4 commits intoCodSpeedHQ:mainfrom
DaniPopes:dani/jit-dump-llvm-orc

Conversation

@DaniPopes
Copy link
Copy Markdown

@DaniPopes DaniPopes commented Mar 29, 2026

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 --jit discovers them via jit_detect().

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().
@DaniPopes DaniPopes changed the title feat: search LLVM ORC JIT jitdump paths feat: discover jitdump files from MMAP2 records Mar 29, 2026
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.
@DaniPopes DaniPopes force-pushed the dani/jit-dump-llvm-orc branch from 8f488d7 to 92ff4b6 Compare March 29, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant