You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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#106265 this time.
privatereadonlyEventSourceSettingsm_config;// configuration information
237
+
238
+
privateboolm_eventSourceDisposed;// has Dispose been called.
239
+
240
+
// Enabling bits
241
+
privateboolm_eventSourceEnabled;// am I enabled (any of my events are enabled for any dispatcher)
242
+
internalEventLevelm_level;// highest level enabled by any output dispatcher
243
+
internalEventKeywordsm_matchAnyKeyword;// the logical OR of all levels enabled by any output dispatcher (zero is a special case) meaning 'all keywords'
244
+
245
+
// Dispatching state
246
+
internalvolatileEventDispatcher?m_Dispatchers;// Linked list of code:EventDispatchers we write the data to (we also do ETW specially)
247
+
privatevolatileOverrideEventProviderm_etwProvider=null!;// This hooks up ETW commands to our 'OnEventCommand' callback
privateboolm_completelyInited;// The EventSource constructor has returned without exception.
254
+
privateException?m_constructionException;// If there was an exception construction, this is it
255
+
privatebytem_outOfBandMessageCount;// The number of out of band messages sent (we throttle them
256
+
privateEventCommandEventArgs?m_deferredCommands;// If we get commands before we are fully we store them here and run the when we are fully inited.
257
+
258
+
privatestring[]?m_traits;// Used to implement GetTraits
259
+
260
+
[ThreadStatic]
261
+
privatestaticbytem_EventSourceExceptionRecurenceCount;// current recursion count inside ThrowEventSourceException
262
+
263
+
internalvolatileulong[]?m_channelData;
264
+
265
+
// We use a single instance of ActivityTracker for all EventSources instances to allow correlation between multiple event providers.
266
+
// We have m_activityTracker field simply because instance field is more efficient than static field fetch.
267
+
privateActivityTrackerm_activityTracker=null!;
268
+
internalconststringActivityStartSuffix="Start";
269
+
internalconststringActivityStopSuffix="Stop";
270
+
271
+
// This switch controls an opt-in, off-by-default mechanism for allowing multiple EventSources to have the same
272
+
// name and by extension GUID. This is not considered a mainline scenario and is explicitly intended as a release
273
+
// valve for users that make heavy use of AssemblyLoadContext and experience exceptions from EventSource.
274
+
// This does not solve any issues that might arise from this configuration. For instance:
275
+
//
276
+
// * If multiple manifest-mode EventSources have the same name/GUID, it is ambiguous which manifest should be used by an ETW parser.
277
+
// This can result in events being incorrectly parse. The data will still be there, but EventTrace (or other libraries) won't
278
+
// know how to parse it.
279
+
// * Potential issues in parsing self-describing EventSources that use the same name/GUID, event name, and payload type from the same AssemblyLoadContext
private readonly EventSourceSettings m_config;// configuration information
3978
-
3979
-
private bool m_eventSourceDisposed;// has Dispose been called.
3980
-
3981
-
// Enabling bits
3982
-
private bool m_eventSourceEnabled;// am I enabled (any of my events are enabled for any dispatcher)
3983
-
internal EventLevel m_level;// highest level enabled by any output dispatcher
3984
-
internal EventKeywords m_matchAnyKeyword;// the logical OR of all levels enabled by any output dispatcher (zero is a special case) meaning 'all keywords'
3985
-
3986
-
// Dispatching state
3987
-
internal volatile EventDispatcher? m_Dispatchers;// Linked list of code:EventDispatchers we write the data to (we also do ETW specially)
3988
-
private volatile OverrideEventProvider m_etwProvider =null!;// This hooks up ETW commands to our 'OnEventCommand' callback
// This switch controls an opt-in, off-by-default mechanism for allowing multiple EventSources to have the same
4013
-
// name and by extension GUID. This is not considered a mainline scenario and is explicitly intended as a release
4014
-
// valve for users that make heavy use of AssemblyLoadContext and experience exceptions from EventSource.
4015
-
// This does not solve any issues that might arise from this configuration. For instance:
4016
-
//
4017
-
// * If multiple manifest-mode EventSources have the same name/GUID, it is ambiguous which manifest should be used by an ETW parser.
4018
-
// This can result in events being incorrectly parse. The data will still be there, but EventTrace (or other libraries) won't
4019
-
// know how to parse it.
4020
-
// * Potential issues in parsing self-describing EventSources that use the same name/GUID, event name, and payload type from the same AssemblyLoadContext
0 commit comments