[clr-interp] Add support for logging interpreter IR ranges to perf map#129989
[clr-interp] Add support for logging interpreter IR ranges to perf map#129989BrzVlad wants to merge 1 commit into
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. |
| SString name; | ||
| pMethod->GetFullMethodInfo(name); | ||
|
|
||
| SString line; | ||
| line.Printf(FMT_CODE_ADDR " %x [Interpreter] %s\n", irAddress, irSize, name.GetUTF8()); | ||
|
|
||
| { | ||
| CrstHolder ch(&(s_csPerfMap)); | ||
|
|
||
| if (s_Current != nullptr) | ||
| { | ||
| s_Current->WriteLine(line); | ||
| } | ||
| } |
|
Example usage: Normal perf output (non-descriptive InterpMethodExec) Parsed interp execution: |
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