Example #1
0
 /// <summary>
 /// Creates the event descriptors array
 /// </summary>
 static void CreateEventDescriptors()
 {
     System.Runtime.Diagnostics.EventDescriptor[] descriptors = new System.Runtime.Diagnostics.EventDescriptor[] {
         new System.Runtime.Diagnostics.EventDescriptor(62326, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)TraceEventOpcode.Info, 0x9de, 0x1000000000000080)
     };
     ushort[] e2eEvents = new ushort[0];
     FxTrace.UpdateEventDefinitions(descriptors, e2eEvents);
     eventDescriptors = descriptors;
 }
Example #2
0
 /// <summary>
 /// Check if ETW tracing is enabled for the particular event
 /// </summary>
 /// <param name="eventIndex">The index of the event descriptor</param>
 static bool IsEtwEventEnabled(int eventIndex)
 {
     if (FxTrace.Trace.IsEtwProviderEnabled)
     {
         EnsureEventDescriptors();
         return(FxTrace.IsEventEnabled(eventIndex));
     }
     return(false);
 }
 private static void EnsureEventDescriptors()
 {
     if (object.ReferenceEquals(TD.eventDescriptors, null))
     {
         EventDescriptor[] eventDescriptors = new EventDescriptor[] { new EventDescriptor(0xf376, 0, 0x13, 4, 0, 0, 0x1000000000000000L) };
         FxTrace.UpdateEventDefinitions(eventDescriptors);
         TD.eventDescriptors = eventDescriptors;
     }
 }
 internal static bool HttpHandlerPickedForUrlIsEnabled()
 {
     if (!FxTrace.ShouldTraceInformation)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceInformationToTraceSource)
     {
         return(FxTrace.IsEventEnabled(0));
     }
     return(true);
 }
 private static bool IsEtwEventEnabled(int eventIndex)
 {
     EnsureEventDescriptors();
     return(FxTrace.IsEventEnabled(eventIndex));
 }