-
Notifications
You must be signed in to change notification settings - Fork 5
feat: run python with perf jit dump #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: run python with perf jit dump #103
Conversation
801b78a
to
03cfd8a
Compare
1b98e09
to
1028e92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for DWARF unwinding in Python by enabling Python JIT support through environment variables and processing JIT dump files. The changes include extracting JIT symbols, converting them to perf maps, and generating unwind data for stack unwinding.
- Enables
PYTHON_PERF_JIT_SUPPORT
environment variable for walltime mode - Adds JIT dump parsing functionality to extract symbols and unwind data
- Modifies perf call graph mode to include larger stack size for DWARF unwinding
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/run/runner/wall_time/perf/jit_dump.rs | New module for parsing JIT dump files and converting to symbols/unwind data |
src/run/runner/wall_time/perf/mod.rs | Integrates JIT dump harvesting and adds Python module detection |
src/run/runner/wall_time/perf/perf_map.rs | Exposes Symbol struct and adds helper methods for module symbols |
src/run/runner/wall_time/perf/unwind_data.rs | Adds custom Debug implementation and test cases for unwind data |
src/run/runner/helpers/env.rs | Sets PYTHON_PERF_JIT_SUPPORT environment variable and fixes debug check |
src/run/mod.rs | Adds PartialEq derive to RunnerMode enum |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
for map in exe_maps.iter().sorted_by_key(|m| m.address.0) { | ||
let (base_addr, end_addr) = map.address; | ||
debug!( | ||
" {:016x}-{:016x} {:08x} {:?} {:?} ", | ||
base_addr, end_addr, map.offset, map.pathname, map.perms, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this be too much logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't add that much (around 40-50 lines). However, it's one of the most important things needed for debugging any perf related issues (e.g. if we fail to resolve the symbol we can look at which module it belongs to).
And since we only enable it when running with CODSPEED_LOG=debug
it shouldn't be an issue.
1028e92
to
942970d
Compare
942970d
to
3323c5a
Compare
This PR adds support for DWARF unwinding in Python by:
PYTHON_PERF_JIT_SUPPORT
feature via env varUnwindInfo
structure which is used for unwinding