static void CreateEventDescriptors()
 {
     System.Runtime.Diagnostics.EventDescriptor[] descriptors = new System.Runtime.Diagnostics.EventDescriptor[] {
         new System.Runtime.Diagnostics.EventDescriptor(4201, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0xa1d, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4202, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0xa1d, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4203, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9f9, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4205, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0xa1d, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4206, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9f9, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4207, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)TraceEventOpcode.Info, 0xa1d, 0x1000000008400000),
         new System.Runtime.Diagnostics.EventDescriptor(4208, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)TraceEventOpcode.Info, 0xa1d, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4209, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0xa1d, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4210, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)TraceEventOpcode.Info, 0xa1d, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4212, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)TraceEventOpcode.Info, 0xa1d, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4211, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)TraceEventOpcode.Info, 0x9f9, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4213, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9f9, 0x1000000008000000),
         new System.Runtime.Diagnostics.EventDescriptor(4214, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9f9, 0x1000000008000000)
     };
     // The hashcodes calculated from PTCop for TD.CreateEventDescriptors are unstable when just declaring
     // a local field of ushort[] if the array is non-empty and contains more than 2 entries, because
     // the c#-compiler is using some private types for optimization. The type name follows the following pattern:
     // <PrivateImplementationDetails>{6BAE93FD-290B-4DE0-BCEE-366B30800FDF} (where the GUID is changing with every build)
     // To scope the change to unblock PTCop as much as possible we wrap the list of End2EndEvents in a List<ushort>
     System.Collections.Generic.List <ushort> e2eEvents = new System.Collections.Generic.List <ushort>(7);
     e2eEvents.Add(4205);
     e2eEvents.Add(4207);
     e2eEvents.Add(4208);
     e2eEvents.Add(4209);
     e2eEvents.Add(4210);
     e2eEvents.Add(4211);
     e2eEvents.Add(4212);
     FxTrace.UpdateEventDefinitions(descriptors, e2eEvents.ToArray());
     eventDescriptors = descriptors;
 }
 /// <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(0x1069, 0, 0x13, 5, 0, 0, 0x1000000000000000L), new EventDescriptor(0x106a, 0, 0x13, 5, 0, 0, 0x1000000000000000L), new EventDescriptor(0x106b, 0, 0x13, 2, 0, 0, 0x1000000000000000L), new EventDescriptor(0x106d, 0, 0x13, 2, 0, 0, 0x1000000000000000L), new EventDescriptor(0x106e, 0, 0x13, 2, 0, 0, 0x1000000000000000L), new EventDescriptor(0x106f, 0, 0x13, 4, 0, 0, 0x1000000000000000L), new EventDescriptor(0x1070, 0, 0x13, 4, 0, 0, 0x1000000000000000L), new EventDescriptor(0x1071, 0, 0x13, 2, 0, 0, 0x1000000000000000L), new EventDescriptor(0x1072, 0, 0x13, 3, 0, 0, 0x1000000000000000L), new EventDescriptor(0x1074, 0, 0x13, 3, 0, 0, 0x1000000000000000L), new EventDescriptor(0x1073, 0, 0x13, 3, 0, 0, 0x1000000000000000L), new EventDescriptor(0x1075, 0, 0x13, 2, 0, 0, 0x1000000000000000L), new EventDescriptor(0x1076, 0, 0x13, 2, 0, 0, 0x1000000000000000L) };
         FxTrace.UpdateEventDefinitions(eventDescriptors);
         TD.eventDescriptors = eventDescriptors;
     }
 }
Ejemplo n.º 4
0
 internal static bool FoundProcessingErrorIsEnabled()
 {
     if (!FxTrace.ShouldTraceError)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceErrorToTraceSource)
     {
         return(FxTrace.IsEventEnabled(3));
     }
     return(true);
 }
Ejemplo n.º 5
0
 internal static bool UnlockInstanceExceptionIsEnabled()
 {
     if (!FxTrace.ShouldTraceError)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceErrorToTraceSource)
     {
         return(FxTrace.IsEventEnabled(4));
     }
     return(true);
 }
Ejemplo n.º 6
0
 internal static bool EndSqlCommandExecuteIsEnabled()
 {
     if (!FxTrace.ShouldTraceVerbose)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceVerboseToTraceSource)
     {
         return(FxTrace.IsEventEnabled(0));
     }
     return(true);
 }
Ejemplo n.º 7
0
 internal static bool TimeoutOpeningSqlConnectionIsEnabled()
 {
     if (!FxTrace.ShouldTraceError)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceErrorToTraceSource)
     {
         return(FxTrace.IsEventEnabled(7));
     }
     return(true);
 }
Ejemplo n.º 8
0
 internal static bool RunnableInstancesDetectionErrorIsEnabled()
 {
     if (!FxTrace.ShouldTraceError)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceErrorToTraceSource)
     {
         return(FxTrace.IsEventEnabled(11));
     }
     return(true);
 }
Ejemplo n.º 9
0
 internal static bool SqlExceptionCaughtIsEnabled()
 {
     if (!FxTrace.ShouldTraceWarning)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceWarningToTraceSource)
     {
         return(FxTrace.IsEventEnabled(8));
     }
     return(true);
 }
Ejemplo n.º 10
0
 internal static bool RenewLockSystemErrorIsEnabled()
 {
     if (!FxTrace.ShouldTraceError)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceErrorToTraceSource)
     {
         return(FxTrace.IsEventEnabled(2));
     }
     return(true);
 }
Ejemplo n.º 11
0
 internal static bool RetryingSqlCommandDueToSqlErrorIsEnabled()
 {
     if (!FxTrace.ShouldTraceInformation)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceInformationToTraceSource)
     {
         return(FxTrace.IsEventEnabled(6));
     }
     return(true);
 }
Ejemplo n.º 12
0
 internal static bool QueingSqlRetryIsEnabled()
 {
     if (!FxTrace.ShouldTraceWarning)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceWarningToTraceSource)
     {
         return(FxTrace.IsEventEnabled(10));
     }
     return(true);
 }
Ejemplo n.º 13
0
 internal static bool MaximumRetriesExceededForSqlCommandIsEnabled()
 {
     if (!FxTrace.ShouldTraceInformation)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceInformationToTraceSource)
     {
         return(FxTrace.IsEventEnabled(5));
     }
     return(true);
 }
Ejemplo n.º 14
0
 internal static bool LockRetryTimeoutIsEnabled()
 {
     if (!FxTrace.ShouldTraceWarning)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceWarningToTraceSource)
     {
         return(FxTrace.IsEventEnabled(9));
     }
     return(true);
 }
Ejemplo n.º 15
0
 internal static bool InstanceLocksRecoveryErrorIsEnabled()
 {
     if (!FxTrace.ShouldTraceError)
     {
         return(false);
     }
     if (!FxTrace.ShouldTraceErrorToTraceSource)
     {
         return(FxTrace.IsEventEnabled(12));
     }
     return(true);
 }
Ejemplo n.º 16
0
 private static bool IsEtwEventEnabled(int eventIndex)
 {
     EnsureEventDescriptors();
     return(FxTrace.IsEventEnabled(eventIndex));
 }