Skip to content
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

Fix trimming for DiagnosticSource #106680

Merged
merged 2 commits into from
Aug 22, 2024
Merged

Commits on Aug 20, 2024

  1. Fix trimming for DiagnosticSource

    Recent changes to EventSource startup caused the IL trimmer to include portions of the DiagnosticSource assembly. Adding the IsMeterSupported feature check wasn't sufficient because EventSource also roots all of its methods via a DynamicallyAccessedMembers attribute. To ensure that the new methods can be removed when needed I refactored them into a separate EventSourceInitHelper class that won't be rooted by the existing DAM attribute.
    
    When EventSouce.IsSupported is false I'd expect the entire EventSourceInitHelper class to be unreachable. If only EventSource.IsMeterSupported is false then I'd expect PreregisterEventProviders and GetMetricsEventSource() to be unreachable but the rest of the class will remain.
    
    Hopefully this really fixes dotnet#106265 this time.
    noahfalk committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    1eac77f View commit details
    Browse the repository at this point in the history
  2. PR feedback

    noahfalk committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    3941714 View commit details
    Browse the repository at this point in the history