Notify profiler about unloads of all class instances when module is unloaded#114107
Merged
mdh1418 merged 5 commits intodotnet:mainfrom Apr 3, 2025
Conversation
Contributor
|
Tagging subscribers to this area: @tommcdon |
jkotas
reviewed
Apr 1, 2025
jkotas
reviewed
Apr 1, 2025
This was referenced Apr 1, 2025
noahfalk
reviewed
Apr 1, 2025
Co-authored-by: Noah Falk <[email protected]>
6c81f47 to
97ee0de
Compare
alexey-zakharov
commented
Apr 2, 2025
This was referenced Apr 2, 2025
jkotas
approved these changes
Apr 2, 2025
Member
jkotas
left a comment
There was a problem hiding this comment.
LGTM
I have not reviewed the test in detail
jkotas
reviewed
Apr 2, 2025
mdh1418
reviewed
Apr 2, 2025
Co-authored-by: Jan Kotas <[email protected]>
This was referenced Apr 3, 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.
Fix
ClassLoadStartedandClassUnloadStartedprofiler callbacks symmetry when unloading modules with generic class instances.The PR solves issue #114068
ClassUnloadStartedandClassUnloadFinishedprofiler api callbacks are not called for generic instances which are allocated under a different loader allocator. That:Notifylogic which is done at class loading time - https://github.com/dotnet/runtime/blob/main/src/coreclr/vm/clsload.cpp#L2617The suggested change adds a separate
EEClass:NotifyUnloadmethod that is called for all classes symmetrically toClassLoadStartednotification.Added a profiler test to validate the callbacks correctness for unloading modules and validated it locally.