|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace System.ServiceModel.Activation.Diagnostics
{
using System.Runtime;
using System.Runtime.Diagnostics;
using System.Security;
internal partial class TD
{
static System.Resources.ResourceManager resourceManager;
static System.Globalization.CultureInfo resourceCulture;
[System.Security.SecurityCriticalAttribute()]
static System.Runtime.Diagnostics.EventDescriptor[] eventDescriptors;
static object syncLock = new object();
// Double-checked locking pattern requires volatile for read/write synchronization
static volatile bool eventDescriptorsCreated;
private TD()
{
}
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="This is an auto-generated code, some ETW/TraceSource mixed code would use it.")]
static System.Resources.ResourceManager ResourceManager
{
get
{
if (object.ReferenceEquals(resourceManager, null))
{
resourceManager = new System.Resources.ResourceManager("System.ServiceModel.Activation.Diagnostics.TD", typeof(TD).Assembly);
}
return resourceManager;
}
}
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="This template is shared across all assemblies, some of which use this accessor.")]
internal static System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4001, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool TransportListenerSessionsReceivedIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(0));
}
/// <summary>
/// Gets trace definition like: Transport listener session received with via '{0}'
/// Event description ID=4001, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="via">Parameter 0 for event: Transport listener session received with via '{0}'</param>
internal static void TransportListenerSessionsReceived(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string via)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(0))
{
TD.WriteEtwEvent(0, eventTraceActivity, via, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4002, Level=Critical, Channel=Analytic
/// </summary>
internal static bool FailFastExceptionIsEnabled()
{
return (FxTrace.ShouldTraceCritical
&& (FxTrace.ShouldTraceCriticalToTraceSource || TD.IsEtwEventEnabled(1)));
}
/// <summary>
/// Gets trace definition like: FailFastException.
/// Event description ID=4002, Level=Critical, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="exception">Exception associated with the event</param>
internal static void FailFastException(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, System.Exception exception)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, exception);
if (TD.IsEtwEventEnabled(1))
{
TD.WriteEtwEvent(1, eventTraceActivity, payload.SerializedException, payload.AppDomainFriendlyName);
}
if (FxTrace.ShouldTraceCriticalToTraceSource)
{
string description = string.Format(Culture, ResourceManager.GetString("FailFastException", Culture));
TD.WriteTraceSource(1, description, payload);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4003, Level=Error, Channel=Analytic
/// </summary>
internal static bool ServiceStartPipeErrorIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(2));
}
/// <summary>
/// Gets trace definition like: Service start pipe error.
/// Event description ID=4003, Level=Error, Channel=Analytic
/// </summary>
/// <param name="Endpoint">Parameter 0 for event: Service start pipe error.</param>
internal static void ServiceStartPipeError(string Endpoint)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(2))
{
TD.WriteEtwEvent(2, null, Endpoint, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4008, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool DispatchSessionStartIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(3));
}
/// <summary>
/// Gets trace definition like: Session dispatch started.
/// Event description ID=4008, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void DispatchSessionStart(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(3))
{
TD.WriteEtwEvent(3, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4010, Level=Warning, Channel=Analytic
/// </summary>
internal static bool PendingSessionQueueFullIsEnabled()
{
return (FxTrace.ShouldTraceWarning && TD.IsEtwEventEnabled(4));
}
/// <summary>
/// Gets trace definition like: Session dispatch for '{0}' failed since pending session queue is full with '{1}' pending items.
/// Event description ID=4010, Level=Warning, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="Uri">Parameter 0 for event: Session dispatch for '{0}' failed since pending session queue is full with '{1}' pending items.</param>
/// <param name="count">Parameter 1 for event: Session dispatch for '{0}' failed since pending session queue is full with '{1}' pending items.</param>
internal static void PendingSessionQueueFull(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string Uri, int count)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(4))
{
TD.WriteEtwEvent(4, eventTraceActivity, Uri, count, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4011, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool MessageQueueRegisterStartIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(5));
}
/// <summary>
/// Gets trace definition like: Message queue register start.
/// Event description ID=4011, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void MessageQueueRegisterStart(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(5))
{
TD.WriteEtwEvent(5, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4014, Level=Error, Channel=Analytic
/// </summary>
internal static bool MessageQueueRegisterFailedIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(6));
}
/// <summary>
/// Gets trace definition like: Message queue registration for uri:'{0}' failed with status:'{1}'.
/// Event description ID=4014, Level=Error, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="Uri">Parameter 0 for event: Message queue registration for uri:'{0}' failed with status:'{1}'.</param>
/// <param name="Status">Parameter 1 for event: Message queue registration for uri:'{0}' failed with status:'{1}'.</param>
internal static void MessageQueueRegisterFailed(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string Uri, string Status)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(6))
{
TD.WriteEtwEvent(6, eventTraceActivity, Uri, Status, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4015, Level=Informational, Channel=Analytic
/// </summary>
internal static bool MessageQueueRegisterCompletedIsEnabled()
{
return (FxTrace.ShouldTraceInformation && TD.IsEtwEventEnabled(7));
}
/// <summary>
/// Gets trace definition like: Message queue registration completed for uri '{0}'.
/// Event description ID=4015, Level=Informational, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="Uri">Parameter 0 for event: Message queue registration completed for uri '{0}'.</param>
internal static void MessageQueueRegisterCompleted(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string Uri)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(7))
{
TD.WriteEtwEvent(7, eventTraceActivity, Uri, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4012, Level=Error, Channel=Analytic
/// </summary>
internal static bool MessageQueueRegisterAbortIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(8));
}
/// <summary>
/// Gets trace definition like: Message queue registration aborted with status:'{0}' for uri:'{1}'.
/// Event description ID=4012, Level=Error, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="Status">Parameter 0 for event: Message queue registration aborted with status:'{0}' for uri:'{1}'.</param>
/// <param name="Uri">Parameter 1 for event: Message queue registration aborted with status:'{0}' for uri:'{1}'.</param>
internal static void MessageQueueRegisterAbort(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string Status, string Uri)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(8))
{
TD.WriteEtwEvent(8, eventTraceActivity, Status, Uri, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4013, Level=verbose, Channel=Analytic
/// </summary>
internal static bool MessageQueueUnregisterSucceededIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(9));
}
/// <summary>
/// Gets trace definition like: Message queue unregister succeeded for uri:'{0}'.
/// Event description ID=4013, Level=verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="Uri">Parameter 0 for event: Message queue unregister succeeded for uri:'{0}'.</param>
internal static void MessageQueueUnregisterSucceeded(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string Uri)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(9))
{
TD.WriteEtwEvent(9, eventTraceActivity, Uri, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4016, Level=Error, Channel=Analytic
/// </summary>
internal static bool MessageQueueDuplicatedSocketErrorIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(10));
}
/// <summary>
/// Gets trace definition like: Message queue failed duplicating socket.
/// Event description ID=4016, Level=Error, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void MessageQueueDuplicatedSocketError(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(10))
{
TD.WriteEtwEvent(10, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4019, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool MessageQueueDuplicatedSocketCompleteIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(11));
}
/// <summary>
/// Gets trace definition like: MessageQueueDuplicatedSocketComplete
/// Event description ID=4019, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void MessageQueueDuplicatedSocketComplete(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(11))
{
TD.WriteEtwEvent(11, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4020, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool TcpTransportListenerListeningStartIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(12));
}
/// <summary>
/// Gets trace definition like: Tcp transport listener starting to listen on uri:'{0}'.
/// Event description ID=4020, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="Uri">Parameter 0 for event: Tcp transport listener starting to listen on uri:'{0}'.</param>
internal static void TcpTransportListenerListeningStart(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string Uri)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(12))
{
TD.WriteEtwEvent(12, eventTraceActivity, Uri, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4021, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool TcpTransportListenerListeningStopIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(13));
}
/// <summary>
/// Gets trace definition like: Tcp transport listener listening.
/// Event description ID=4021, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void TcpTransportListenerListeningStop(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(13))
{
TD.WriteEtwEvent(13, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4022, Level=Error, Channel=Analytic
/// </summary>
internal static bool WebhostUnregisterProtocolFailedIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(14));
}
/// <summary>
/// Gets trace definition like: Error Code:{0}
/// Event description ID=4022, Level=Error, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="hresult">Parameter 0 for event: Error Code:{0}</param>
internal static void WebhostUnregisterProtocolFailed(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string hresult)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(14))
{
TD.WriteEtwEvent(14, eventTraceActivity, hresult, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4023, Level=Informational, Channel=Analytic
/// </summary>
internal static bool WasCloseAllListenerChannelInstancesCompletedIsEnabled()
{
return (FxTrace.ShouldTraceInformation && TD.IsEtwEventEnabled(15));
}
/// <summary>
/// Gets trace definition like: Was closing all listener channel instances completed.
/// Event description ID=4023, Level=Informational, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void WasCloseAllListenerChannelInstancesCompleted(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(15))
{
TD.WriteEtwEvent(15, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4024, Level=Error, Channel=Analytic
/// </summary>
internal static bool WasCloseAllListenerChannelInstancesFailedIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(16));
}
/// <summary>
/// Gets trace definition like: Error Code:{0}
/// Event description ID=4024, Level=Error, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="hresult">Parameter 0 for event: Error Code:{0}</param>
internal static void WasCloseAllListenerChannelInstancesFailed(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string hresult)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(16))
{
TD.WriteEtwEvent(16, eventTraceActivity, hresult, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4025, Level=Error, Channel=Analytic
/// </summary>
internal static bool OpenListenerChannelInstanceFailedIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(17));
}
/// <summary>
/// Gets trace definition like: Error Code:{0}
/// Event description ID=4025, Level=Error, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="hresult">Parameter 0 for event: Error Code:{0}</param>
internal static void OpenListenerChannelInstanceFailed(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string hresult)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(17))
{
TD.WriteEtwEvent(17, eventTraceActivity, hresult, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4026, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool WasConnectedIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(18));
}
/// <summary>
/// Gets trace definition like: WAS Connected.
/// Event description ID=4026, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void WasConnected(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(18))
{
TD.WriteEtwEvent(18, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4027, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool WasDisconnectedIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(19));
}
/// <summary>
/// Gets trace definition like: WAS Disconnected.
/// Event description ID=4027, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void WasDisconnected(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(19))
{
TD.WriteEtwEvent(19, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4028, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool PipeTransportListenerListeningStartIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(20));
}
/// <summary>
/// Gets trace definition like: Pipe transport listener listening start on uri:{0}.
/// Event description ID=4028, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
/// <param name="Uri">Parameter 0 for event: Pipe transport listener listening start on uri:{0}.</param>
internal static void PipeTransportListenerListeningStart(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string Uri)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(20))
{
TD.WriteEtwEvent(20, eventTraceActivity, Uri, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4029, Level=Verbose, Channel=Analytic
/// </summary>
internal static bool PipeTransportListenerListeningStopIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(21));
}
/// <summary>
/// Gets trace definition like: Pipe transport listener listening stop.
/// Event description ID=4029, Level=Verbose, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void PipeTransportListenerListeningStop(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(21))
{
TD.WriteEtwEvent(21, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4030, Level=informational, Channel=Analytic
/// </summary>
internal static bool DispatchSessionSuccessIsEnabled()
{
return (FxTrace.ShouldTraceInformation && TD.IsEtwEventEnabled(22));
}
/// <summary>
/// Gets trace definition like: Session dispatch succeeded.
/// Event description ID=4030, Level=informational, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void DispatchSessionSuccess(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(22))
{
TD.WriteEtwEvent(22, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4031, Level=Error, Channel=Analytic
/// </summary>
internal static bool DispatchSessionFailedIsEnabled()
{
return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(23));
}
/// <summary>
/// Gets trace definition like: Session dispatch failed.
/// Event description ID=4031, Level=Error, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void DispatchSessionFailed(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(23))
{
TD.WriteEtwEvent(23, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4032, Level=Critical, Channel=Analytic
/// </summary>
internal static bool WasConnectionTimedoutIsEnabled()
{
return (FxTrace.ShouldTraceCritical && TD.IsEtwEventEnabled(24));
}
/// <summary>
/// Gets trace definition like: WAS connection timed out.
/// Event description ID=4032, Level=Critical, Channel=Analytic
/// </summary>
/// <param name="eventTraceActivity">The event trace activity</param>
internal static void WasConnectionTimedout(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(24))
{
TD.WriteEtwEvent(24, eventTraceActivity, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4033, Level=Verbose, Channel=Debug
/// </summary>
internal static bool RoutingTableLookupStartIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(25));
}
/// <summary>
/// Gets trace definition like: Routing table lookup started.
/// Event description ID=4033, Level=Verbose, Channel=Debug
/// </summary>
internal static void RoutingTableLookupStart()
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(25))
{
TD.WriteEtwEvent(25, null, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4034, Level=Verbose, Channel=Debug
/// </summary>
internal static bool RoutingTableLookupStopIsEnabled()
{
return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(26));
}
/// <summary>
/// Gets trace definition like: Routing table lookup completed.
/// Event description ID=4034, Level=Verbose, Channel=Debug
/// </summary>
internal static void RoutingTableLookupStop()
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(26))
{
TD.WriteEtwEvent(26, null, payload.AppDomainFriendlyName);
}
}
/// <summary>
/// Check if trace definition is enabled
/// Event description ID=4035, Level=verbose, Channel=debug
/// </summary>
internal static bool PendingSessionQueueRatioIsEnabled()
{
return (FxTrace.ShouldTraceVerbose
&& (FxTrace.ShouldTraceVerboseToTraceSource || TD.IsEtwEventEnabled(27)));
}
/// <summary>
/// Gets trace definition like: Pending session queue ratio: {0}/{1}
/// Event description ID=4035, Level=verbose, Channel=debug
/// </summary>
/// <param name="curr">Parameter 0 for event: Pending session queue ratio: {0}/{1}</param>
/// <param name="max">Parameter 1 for event: Pending session queue ratio: {0}/{1}</param>
internal static void PendingSessionQueueRatio(int curr, int max)
{
TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
if (TD.IsEtwEventEnabled(27))
{
TD.WriteEtwEvent(27, null, curr, max, payload.AppDomainFriendlyName);
}
if (FxTrace.ShouldTraceVerboseToTraceSource)
{
string description = string.Format(Culture, ResourceManager.GetString("PendingSessionQueueRatio", Culture), curr, max);
TD.WriteTraceSource(27, description, payload);
}
}
/// <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(4001, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Receive, 0x9c4, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4002, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Critical, (byte)TraceEventOpcode.Info, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4003, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9c9, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4008, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9c4, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4010, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Warning, (byte)TraceEventOpcode.Info, 0x9c4, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4011, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9fd, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4014, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9fd, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4015, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Informational, (byte)TraceEventOpcode.Info, 0x9fd, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4012, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9fd, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4013, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9fd, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4016, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9c4, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4019, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9c4, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4020, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9ca, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4021, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9ca, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4022, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4023, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Informational, (byte)TraceEventOpcode.Stop, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4024, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Stop, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4025, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4026, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)132, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4027, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)133, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4028, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9c7, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4029, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9c7, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4030, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Informational, (byte)TraceEventOpcode.Stop, 0x9c4, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4031, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0x9c4, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4032, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Critical, (byte)TraceEventOpcode.Info, 0xa2b, 0x2000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4033, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9c8, 0x1000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4034, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9c8, 0x1000000000000800),
new System.Runtime.Diagnostics.EventDescriptor(4035, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Info, 0xa00, 0x1000000000400000)};
ushort[] e2eEvents = new ushort[] {
4001,
4002,
4008,
4010,
4011,
4012,
4013,
4014,
4015,
4016,
4019,
4020,
4021,
4022,
4023,
4024,
4025,
4026,
4027,
4028,
4029,
4030,
4031,
4032};
FxTrace.UpdateEventDefinitions(descriptors, e2eEvents);
eventDescriptors = descriptors;
}
/// <summary>
/// Ensures that the event descriptors array is initialized
/// </summary>
static void EnsureEventDescriptors()
{
if (eventDescriptorsCreated)
{
return;
}
System.Threading.Monitor.Enter(syncLock);
try
{
if (eventDescriptorsCreated)
{
return;
}
CreateEventDescriptors();
eventDescriptorsCreated = true;
}
finally
{
System.Threading.Monitor.Exit(syncLock);
}
}
/// <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;
}
/// <summary>
/// Writes ETW trace event
///</summary>
/// <param name="eventIndex">The index of the event descriptor</param>>
/// <param name="eventParam0">A parameter of the ETW event</param>>
/// <param name="eventParam1">A parameter of the ETW event</param>>
/// <param name="eventParam2">A parameter of the ETW event</param>>
static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2)
{
EnsureEventDescriptors();
return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2);
}
/// <summary>
/// Writes ETW trace event
///</summary>
/// <param name="eventIndex">The index of the event descriptor</param>>
/// <param name="eventParam0">A parameter of the ETW event</param>>
/// <param name="eventParam1">A parameter of the ETW event</param>>
static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1)
{
EnsureEventDescriptors();
return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1);
}
/// <summary>
/// Writes ETW trace event
///</summary>
/// <param name="eventIndex">The index of the event descriptor</param>>
/// <param name="eventParam0">A parameter of the ETW event</param>>
/// <param name="eventParam1">A parameter of the ETW event</param>>
/// <param name="eventParam2">A parameter of the ETW event</param>>
/// <param name="eventParam3">A parameter of the ETW event</param>>
static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, int eventParam2, string eventParam3)
{
EnsureEventDescriptors();
return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2, eventParam3);
}
/// <summary>
/// Writes ETW trace event
///</summary>
/// <param name="eventIndex">The index of the event descriptor</param>>
/// <param name="eventParam0">A parameter of the ETW event</param>>
/// <param name="eventParam1">A parameter of the ETW event</param>>
/// <param name="eventParam2">A parameter of the ETW event</param>>
/// <param name="eventParam3">A parameter of the ETW event</param>>
static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2, string eventParam3)
{
EnsureEventDescriptors();
return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2, eventParam3);
}
/// <summary>
/// Writes ETW trace event
///</summary>
/// <param name="eventIndex">The index of the event descriptor</param>>
/// <param name="eventParam0">A parameter of the ETW event</param>>
/// <param name="eventParam1">A parameter of the ETW event</param>>
/// <param name="eventParam2">A parameter of the ETW event</param>>
/// <param name="eventParam3">A parameter of the ETW event</param>>
static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, int eventParam1, int eventParam2, string eventParam3)
{
EnsureEventDescriptors();
return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2, eventParam3);
}
/// <summary>
/// write a trace source into the diagnostic trace
/// </summary>
/// <param name="eventIndex">The index of the event descriptor</param>
/// <param name="description">The description to write</param>
/// <param name="payload">The trace payload</param>
static void WriteTraceSource(int eventIndex, string description, TracePayload payload)
{
EnsureEventDescriptors();
FxTrace.Trace.WriteTraceSource(ref eventDescriptors[eventIndex], description, payload);
}
}
}
|