Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteEventWithRelatedActivityIdCore()

unsafe void System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityIdCore ( int eventId,
Guid * relatedActivityId,
int eventDataCount,
EventData * data )
inlineprotectedinherited

Definition at line 970 of file EventSource.cs.

971 {
972 if (!IsEnabled())
973 {
974 return;
975 }
976 try
977 {
978 ref EventMetadata reference = ref m_eventData[eventId];
979 EventOpcode opcode = (EventOpcode)reference.Descriptor.Opcode;
980 Guid* ptr = null;
983 if (opcode != 0 && relatedActivityId == null && (reference.ActivityOptions & EventActivityOptions.Disable) == 0)
984 {
985 switch (opcode)
986 {
987 case EventOpcode.Start:
989 break;
990 case EventOpcode.Stop:
992 break;
993 }
994 if (activityId != Guid.Empty)
995 {
996 ptr = &activityId;
997 }
999 {
1001 }
1002 }
1004 {
1005 if (reference.EnabledForETW && !m_etwProvider.WriteEvent(ref reference.Descriptor, reference.EventHandle, ptr, relatedActivityId, eventDataCount, (IntPtr)data))
1006 {
1008 }
1009 if (reference.EnabledForEventPipe && !m_eventPipeProvider.WriteEvent(ref reference.Descriptor, reference.EventHandle, ptr, relatedActivityId, eventDataCount, (IntPtr)data))
1010 {
1012 }
1013 }
1014 else if (reference.EnabledForETW || reference.EnabledForEventPipe)
1015 {
1016 EventSourceOptions eventSourceOptions = default(EventSourceOptions);
1017 eventSourceOptions.Keywords = (EventKeywords)reference.Descriptor.Keywords;
1018 eventSourceOptions.Level = (EventLevel)reference.Descriptor.Level;
1019 eventSourceOptions.Opcode = (EventOpcode)reference.Descriptor.Opcode;
1020 EventSourceOptions options = eventSourceOptions;
1021 WriteMultiMerge(reference.Name, ref options, reference.TraceLoggingEventTypes, ptr, relatedActivityId, data);
1022 }
1023 if (m_Dispatchers != null && reference.EnabledForAnyListener)
1024 {
1025 EventWrittenEventArgs eventCallbackArgs = new EventWrittenEventArgs(this, eventId, ptr, relatedActivityId);
1027 }
1028 }
1029 catch (Exception ex)
1030 {
1031 if (ex is EventSourceException)
1032 {
1033 throw;
1034 }
1036 }
1037 }
void OnStart(string providerName, string activityName, int task, ref Guid activityId, ref Guid relatedActivityId, EventActivityOptions options, bool useTplSource=true)
void OnStop(string providerName, string activityName, int task, ref Guid activityId, bool useTplSource=true)
volatile OverrideEventProvider m_eventPipeProvider
volatile EventMetadata[] m_eventData
volatile OverrideEventProvider m_etwProvider
unsafe void WriteToAllListeners(EventWrittenEventArgs eventCallbackArgs, int eventDataCount, EventData *data)
volatile EventDispatcher m_Dispatchers
void ThrowEventSourceException(string eventName, Exception innerEx=null)
unsafe void WriteMultiMerge(string eventName, ref EventSourceOptions options, TraceLoggingEventTypes eventTypes, Guid *activityID, Guid *childActivityID, params object[] values)
static readonly Guid Empty
Definition Guid.cs:86

References System.Guid.Empty, System.Diagnostics.Tracing.EventSource.IsEnabled(), System.Diagnostics.Tracing.EventSource.m_activityTracker, System.Diagnostics.Tracing.EventSource.m_Dispatchers, System.Diagnostics.Tracing.EventSource.m_etwProvider, System.Diagnostics.Tracing.EventSource.m_eventData, System.Diagnostics.Tracing.EventSource.m_eventPipeProvider, System.Diagnostics.Tracing.EventSource.m_name, System.Diagnostics.Tracing.EventSource.Name, System.Diagnostics.Tracing.ActivityTracker.OnStart(), System.Diagnostics.Tracing.ActivityTracker.OnStop(), System.options, System.Diagnostics.Tracing.EventSource.SelfDescribingEvents, System.Diagnostics.Tracing.EventSource.ThrowEventSourceException(), System.Diagnostics.Tracing.EventSource.WriteMultiMerge(), and System.Diagnostics.Tracing.EventSource.WriteToAllListeners().

Referenced by System.Threading.Tasks.TplEventSource.AwaitTaskContinuationScheduled(), System.Threading.Tasks.TplEventSource.TaskScheduled(), System.Threading.Tasks.TplEventSource.TaskWaitBegin(), and System.Diagnostics.Tracing.EventSource.WriteEventCore().