Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 4
0
 internal static bool HttpHandlerPickedForUrlIsEnabled()
 {
     if (!FxTrace.ShouldTraceInformation)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceInformationToTraceSource)
     {
         return(FxTrace.IsEventEnabled(0));
     }
     return(true);
 }
Ejemplo n.º 5
0
 private static bool IsEtwEventEnabled(int eventIndex)
 {
     EnsureEventDescriptors();
     return(FxTrace.IsEventEnabled(eventIndex));
 }