Repository navigation
[clr-interp] Add support for logging interpreter IR ranges to perf map - #129989
Conversation
Tested that it works correctly when passing the following env vars to the runtime: ``` export DOTNET_PerfMapEnabled=1 export DOTNET_PerfMapStubGranularity=2 ```
|
Tagging subscribers to this area: @agocke |
There was a problem hiding this comment.
Pull request overview
This PR extends CoreCLR’s perf-map logging to include interpreter-generated IR ranges, so profiler tools can symbolize interpreter frames similarly to JIT-compiled methods.
Changes:
- Add
PerfMap::LogInterpreterMethod(...)API (guarded byFEATURE_INTERPRETER) and implement logging of interpreter IR ranges. - Update
MethodDesc::JitCompileCodeLockedEventWrapperto log interpreter IR ranges instead of logging the interpreter entrypoint as a JIT-compiled method.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/vm/prestub.cpp | Adds interpreter-specific perfmap logging in the JIT/compile wrapper. |
| src/coreclr/vm/perfmap.h | Declares the new interpreter logging entrypoint on PerfMap. |
| src/coreclr/vm/perfmap.cpp | Implements interpreter IR range logging to the perfmap output. |
|
Example usage: Normal perf output (non-descriptive InterpMethodExec) Parsed interp execution: |
davidwrighton
left a comment
There was a problem hiding this comment.
I think we can get an even better profiler than this constructed with actual mixed interpreter/native stack walking, but this is a great first step.
|
@davidwrighton Any more detail about what you mean here ? I normally envision this as an internal development tool, where you also care about native bits in the runtime. For all other things, managed only profiling, we would need to make sure that the interpreter frames integrate well into the dotnet-trace flows, which I belive are used for profiling apps by customers. Last time I tried a couple of months ago, it wasn't really working. Do you envision also third approach ? Or any other nice to haves on the interpreter profiling front ? EDIT: It looks like profiling with dotnet-trace actually works correctly with the interpreter. |
#129989) Tested that it works correctly when passing the following env vars to the runtime: ``` export DOTNET_PerfMapEnabled=1 export DOTNET_PerfMapStubGranularity=2 ``` The interpreter entries from the perf map could be used to profile as described in https://gist.github.com/BrzVlad/80c1b1f61b024f251b60f39c5dedc9d3
Tested that it works correctly when passing the following env vars to the runtime:
The interpreter entries from the perf map could be used to profile as described in https://gist.github.com/BrzVlad/80c1b1f61b024f251b60f39c5dedc9d3