This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
[3.1] Backport fixes to ETW/EventPipe events to enable GCDumps #27297
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.
Description
#27237
These two commits fix two issues preventing successful GCDump creation using events sent over EventPipe. PerfView has the ability to generate GCDumps (a collections of statistics about all objects on the heap) of a running process by turning on a specific set of keywords on the
Microsoft-Windows-DotNETRuntime
provider and analyzing the data. These are a powerful tool for triaging memory leaks and other flavors of memory issues.ff37915 - This moves a function call to
EtwCallbackCommon
so that both ETW and EventPipe have the same behavior.OnKeywordsChanged
modifies some global statics for type logging to cause the type cache to be emptied when a specific keyword is not enabled. Without clearing this type cache, type metadata events are not generated when GCs are triggered via EventPipe resulting in GCDumps that have no type information. Moving this toEtwCallbackCommon
ensures that the type cache is correctly flushed like it was with ETW.2a1a6cf - This fixes 3 events that were not being sent over EventPipe previously. Without these events, static, ccw, and rcw type metadata would not be present in GCDumps created via EventPipe.
Customer Impact
With these changes, customers will be able to collect GCDumps on Linux, Mac, and Windows by analyzing events sent over EventPipe as they could with ETW.
Regression
This is a discrepancy in the event parity between ETW and EventPipe (i.e., what events can be collected by what technology), but not technically a regression as this issue has existed since before 2.2.
Risk
Low - These changes are targeted to preserve ETW behavior without modifying any other logic.
CC @tommcdon @caslan