-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[mono] fix --trace #117246
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
[mono] fix --trace #117246
Conversation
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 addresses a regression in the --trace option by adjusting the profiler instrumentation flags set during JIT compilation.
- Removed samplepoint-related flags from
cfg->prof_flagswhen--traceis enabled. - Ensures only enter/leave instrumentation is active under
--trace.
Comments suppressed due to low confidence (2)
src/mono/mono/mini/mini.c:3456
- Add a unit or integration test that verifies enabling
--traceproduces exactly the expectedprof_flags(ENTER, ENTER_CONTEXT, LEAVE, LEAVE_CONTEXT) to guard against future regressions in flag composition.
if (trace)
src/mono/mono/mini/mini.c:3458
- [nitpick] Add or update a comment explaining why the samplepoint instrumentation flags were removed under
--traceto clarify the intent for future maintainers.
MONO_PROFILER_CALL_INSTRUMENTATION_ENTER | MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT |
|
Could you add a small explanation for this ? Is tracing simply incompatible with samplepoint instrumentation ? |
We discovered that the root cause it that Because the |
|
Does |
It only needs to exist for the |
|
Yes, I would prefer to have it removed if it's an option that will not be used |
|
/ba-g CI timeouts |

Fixes regression caused by #112352 that breaks
--traceon mono VM.Root cause is stack allocation inside of a loop for
emit_fill_call_ctxof newSAMPLEPOINT_CONTEXTprofiler event.That event is not necessary for any of the other scenarios. And also samplepoint is not interesting trace event.
Fix
mini_profiler_emit_samplepoint