-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
For transition profiler callbacks, always load the thread #105104
Conversation
Also, add tests for profiler callbacks on a new thread to the runtime
Tagging subscribers to this area: @tommcdon |
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.
Thanks for the fix, I don't know the details of the interop space enough to comment on the fix but the profiler tests look good to me
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.
I don't fully understand all the IL code emitting details, but from #69761, the change to EmitProfilerEndTransitionCallback
to have _ASSERTE(SF_IsForwardStub(dwStubFlags));
+ defaulting to !fReverseInterop
code paths in stubhelpers.cpp seems to suggest that Profiler transitions shouldn't occur during reverse interops, but even if they did, behave the same as forward interops? Am I understanding that correctly?
Could we add asserts that pThread is not null in stubhelpers.cpp ProfilerBeginTransitionCallback/ProfilerEndTransitionCallback?
The profiler transitions for "reverse interop" are done as part of the JIT code emit now for these scenarios, so we don't handle them in the IL stub (which is what #69761 was fixing). I can add the assert. |
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 to me!
@jkoritzinsky thanks! Does this need to be backported to .net 7 and .net 8? |
I'll backport this to .NET 8. 7 is EOL so I can't backport there. |
/backport to release/8.0-staging |
Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/10029358160 |
Also, add tests for profiler callbacks on a new thread to the runtime
Fixes #105070