[clr-interp] Fix a grab bag of issues, mostly around the profiler#122421
Merged
davidwrighton merged 4 commits intodotnet:mainfrom Dec 11, 2025
Merged
[clr-interp] Fix a grab bag of issues, mostly around the profiler#122421davidwrighton merged 4 commits intodotnet:mainfrom
davidwrighton merged 4 commits intodotnet:mainfrom
Conversation
- Add support for tracking transitions via the profiler/debugger internal apis - Notably this involves calls to ProfilerManagedToUnmanagedTransitionMD/ProfilerUnmanagedToManagedTransitionMD for the profiler - And DebuggerTraceCall for the debugger on reverse p/invoke - Disabling the enter/leave hooks in the ICorProfiler api - We now detect attempts to generate these in the interpreter compiler, and will fail the compile - Adding a PlatformDetection flag for disabling the tests which depend on this - And adjust several tests to use this flag - Adjusting profiler test testing the ability of the profiler to control inlining by disabling that portion of that profiler test as the interpreter can't do that - Finally disabling the R2RDumpTests test when the interpreter is enabled. It works, but its really slow, so lets not wait for it to finish in any of our test passes
Contributor
|
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds profiler and debugger support for the CoreCLR interpreter, specifically for tracking transitions between managed and unmanaged code. Key fixes include:
- Adding profiler transition tracking for reverse P/Invoke and unmanaged calli operations
- Disabling ICorProfiler enter/leave hooks support in the interpreter (not supported)
- Adjusting tests to skip when enter/leave hooks are unavailable
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/prestub.cpp | Adds profiler/debugger transition tracking for reverse P/Invoke in ExecuteInterpretedMethod |
| src/coreclr/vm/jithelpers.cpp | Changes DebuggerTraceCall from static to non-static for use in prestub.cpp |
| src/coreclr/vm/interpexec.cpp | Adds profiler transition tracking for unmanaged calli operations |
| src/coreclr/vm/dllimportcallback.h | Declares new non-destructive getter for UMEntryThunkData |
| src/coreclr/vm/dllimportcallback.cpp | Implements GetMostRecentUMEntryThunkDataNonDestructive() |
| src/coreclr/interpreter/inc/interpretershared.h | Adds publishSecretStubParam field to InterpMethod structure |
| src/coreclr/interpreter/compiler.h | Adds m_corJitFlags member to cache JIT flags |
| src/coreclr/interpreter/compiler.cpp | Refactors to use cached m_corJitFlags, adds detection for unsupported PROF_ENTERLEAVE flag, and handles PROF_NO_PINVOKE_INLINE |
| src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs | Adds IsICorProfilerEnabled and IsICorProfilerEnterLeaveHooksEnabled properties |
| src/tests/profiler/unittest/inlining.cs | Adds check to skip test when enter/leave hooks are disabled |
| src/tests/profiler/elt/slowpatheltleave.cs | Adds check to skip test when enter/leave hooks are disabled |
| src/tests/profiler/elt/slowpatheltenter.cs | Adds check to skip test when enter/leave hooks are disabled |
| src/tests/profiler/dynamicoptimization/DynamicOptimization.cs | Adjusts test expectations for interpreter (no inlining support) |
| src/tests/readytorun/r2rdump/FrameworkTests/R2RDumpTests.csproj | Marks test as InterpreterIncompatible due to excessive runtime |
janvorli
reviewed
Dec 11, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This should fix JIT/profiler/elt/slowpatheltenter, JIT/profiler/elt/slowpatheltleave, JIT/profiler/unittest/inlining, JIT/profiler/transitions/transitions, profiler/dynamicoptimization/DynamicOptimization and readytorun/r2rdump/FrameworkTests/R2RDumpTests.