16[
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2113:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves methods on Delegate and MulticastDelegate because the nested type OverrideEventProvider's base type EventProvider defines a delegate. This includes Delegate and MulticastDelegate methods which require unreferenced code, but EnsureDescriptorsInitialized does not access these members and is safe to call.")]
17[
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2115:ReflectionToDynamicallyAccessedMembers", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves methods on Delegate and MulticastDelegate because the nested type OverrideEventProvider's base type EventProvider defines a delegate. This includes Delegate and MulticastDelegate methods which have dynamically accessed members requirements, but EnsureDescriptorsInitialized does not access these members and is safe to call.")]
130 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
131 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
150 string[]
array =
new string[parameters.Length];
151 for (
int i = 0; i <
array.Length; i++)
169 for (
int i = 0; i <
array.Length; i++)
240 private const string EventSourceRequiresUnreferenceMessage =
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type";
263 return default(
Guid);
361 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2114:ReflectionToDynamicallyAccessedMembers", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which has dynamically accessed members requirements, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
367 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2114:ReflectionToDynamicallyAccessedMembers", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which has dynamically accessed members requirements, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
410 if (eventSource ==
null)
426 for (
int i = 0; i < m_traits.Length - 1; i += 2)
441 return base.ToString();
510 for (
int i = 0; i < num; i++)
518 long keywords =
m_eventData[i].Descriptor.Keywords;
534 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
540 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
553 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
569 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
588 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
601 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
617 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
636 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
649 ptr->Size = (arg1.Length + 1) * 2;
656 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
681 ptr2->Size = (arg1.Length + 1) * 2;
684 ptr2[1].Size = (arg2.Length + 1) * 2;
685 ptr2[1].Reserved = 0;
695 ptr2->Size = (arg1.Length + 1) * 2;
698 ptr2[1].Size = (arg2.Length + 1) * 2;
699 ptr2[1].Reserved = 0;
705 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
737 ptr4->Size = (arg1.Length + 1) * 2;
740 ptr4[1].Size = (arg2.Length + 1) * 2;
741 ptr4[1].Reserved = 0;
743 ptr4[2].Size = (arg3.Length + 1) * 2;
744 ptr4[2].Reserved = 0;
758 ptr4->Size = (arg1.Length + 1) * 2;
761 ptr4[1].Size = (arg2.Length + 1) * 2;
762 ptr4[1].Reserved = 0;
764 ptr4[2].Size = (arg3.Length + 1) * 2;
765 ptr4[2].Reserved = 0;
772 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
785 ptr->Size = (arg1.Length + 1) * 2;
795 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
808 ptr->Size = (arg1.Length + 1) * 2;
821 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
834 ptr->Size = (arg1.Length + 1) * 2;
844 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
860 ptr[1].Size = (arg2.Length + 1) * 2;
867 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
883 ptr[1].Size = (arg2.Length + 1) * 2;
890 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
898 if (
arg1 ==
null ||
arg1.Length == 0)
910 int size =
arg1.Length;
923 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
934 if (
arg2 ==
null ||
arg2.Length == 0)
946 int size =
arg2.Length;
959 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
960 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
967 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
968 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
1039 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
1040 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
1046 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
1047 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
1211 72, 44, 45, 178, 195, 144, 71, 200, 135, 248,
1212 26, 21, 191, 193, 48, 251
1240 int size = data->
Size;
1243 if ((uint)(typeCode - 5) <= 4
u)
1335 if (data->
Size == 0)
1355 [Conditional(
"DEBUG")]
1359 int num = data->
Size / 2 - 1;
1360 for (
int i = 0; i < num; i++)
1378 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
1379 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
1465 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
1466 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
1472 for (
int i = 0; i < num; i++)
1482 if (
args.Length != parameters.Length)
1487 for (
int i = 0; i <
args.Length; i++)
1516 while (num <
array.Length)
1524 else if (
reference.AllParametersAreInt32)
1577 long keywords = -1
L;
1604 eventData.Ptr = (ulong)
ptr;
1605 eventData.Size = (uint)(2 * (
msgString.Length + 1));
1606 eventData.Reserved = 0
u;
1625 string eventName =
"EventSourceMessage";
1639 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The call to TraceLoggingEventTypes with the below parameter values are trim safe")]
1649 eventWrittenEventArgs.EventName = eventName;
1650 eventWrittenEventArgs.Message = msg;
1735 string text =
"EventSourceException";
1736 if (eventName !=
null)
1738 text =
text +
" while processing event \"" + eventName +
"\"";
1793 if (opcode ==
EventOpcode.Info && eventName !=
null)
1884 bool flag = commandArgs.perEventSourceSessionId >= 0;
1893 commandArgs.perEventSourceSessionId = -
commandArgs.perEventSourceSessionId;
1897 commandArgs.Command = (flag ? EventCommand.Enable :
EventCommand.Disable);
1954 if (dispatcher ==
null)
2018 eventDispatcher2.m_EventEnabled =
new bool[
m_eventData.Length];
2035 manifestEnvelope.MajorVersion = 1;
2036 manifestEnvelope.MinorVersion = 0;
2037 manifestEnvelope.Magic = 91;
2039 manifestEnvelope.ChunkNumber = 0;
2045 ptr[1].Reserved = 0
u;
2050 manifestEnvelope.TotalChunks = (ushort)((num + (
num2 - 1)) /
num2);
2096 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2114:ReflectionToDynamicallyAccessedMembers", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which has dynamically accessed members requirements, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
2101 return member.GetCustomAttribute(attributeType,
inherit:
false);
2154 if (
type.BaseType ==
null)
2162 while (
type !=
null &&
type.IsAbstract);
2172 else if (
type.Name !=
"EventSource")
2180 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2114:ReflectionToDynamicallyAccessedMembers", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which has dynamically accessed members requirements, but its use of this method satisfies these requirements because it passes in the result of GetType with the same annotations.")]
2184 bool flag =
source ==
null || !
source.SelfDescribingEvents;
2186 byte[] result =
null;
2227 string[]
array =
new string[3] {
"Keywords",
"Tasks",
"Opcodes" };
2303 string text2 = name.Substring(0, name.Length -
"Start".Length);
2304 if (
string.Compare(name, 0,
text2, 0,
text2.Length) == 0 &&
string.Compare(name,
text2.Length,
"Start", 0,
Math.
Max(name.Length -
text2.Length,
"Start".Length)) == 0)
2311 int num2 = eventAttribute.EventId - 1;
2315 string text3 = name.Substring(0, name.Length -
"Stop".Length);
2333 for (
int l = 0;
l <
args.Length;
l++)
2350 string key =
"event_" + name;
2387 string text4 =
string.Empty;
2403 text4 =
"Unexpected error: " +
ex.Message;
2475 reference.Name = eventName;
2506 reference.EventListenerParameterCount = num;
2515 if (
eventData[num].Descriptor.EventId != 0)
2545 string name =
method.Name;
2555 for (
int i = 0; i <
eventData.Length; i++)
2597 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode", Justification =
"The method calls MethodBase.GetMethodBody. Trimming application can change IL of various methodswhich can lead to change of behavior. This method only uses this to validate usage of event source APIs.In the worst case it will not be able to determine the value it's looking for and will not performany validation.")]
2719 msg =
"Reached message limit. End of EventSource error messages.";
2762 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
2763 public unsafe
void Write(
string? eventName)
2772 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:UnrecognizedReflectionPattern", Justification =
"Parameters to this method are primitive and are trimmer safe")]
2781 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
2782 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
2792 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
2793 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
2802 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
2803 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
2812 [
UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2112:ReflectionToRequiresUnreferencedCode", Justification =
"EnsureDescriptorsInitialized's use of GetType preserves this method which requires unreferenced code, but EnsureDescriptorsInitialized does not access this member and is safe to call.")]
2813 [
RequiresUnreferencedCode(
"EventSource will serialize the whole object graph. Trimmer will not safely handle this case because properties may be trimmed. This can be suppressed if the object is a primitive type")]
2833 byte level = (((options.valuesSet & 4
u) != 0) ? options.level :
eventTypes.level);
2845 byte level = (((options.valuesSet & 4
u) != 0) ? options.level :
eventTypes.level);
2846 byte opcode = (((options.valuesSet & 8
u) != 0) ? options.opcode :
eventTypes.opcode);
2860 for (
int i = 0; i < eventTypes.dataCount + 3; i++)
2865 for (
int j = 0;
j < pinCount;
j++)
2913 int num = eventTypes.dataCount + eventTypes.typeInfos.Length * 2 + 3;
2915 for (
int i = 0; i < num; i++)
2964 for (
int i = 0; i < eventTypes.dataCount + 3; i++)
2969 for (
int j = 0;
j < pinCount;
j++)
3049 EventName = eventName,
3067 for (
int i = 0; i <
cPins; i++)
3069 if (
pPins[i].IsAllocated)
3085 for (
int i = 0; i < m_traits.Length - 1; i += 2)
3094 if (!(
text ==
"GROUP"))
3125 if (
value.Length == 0)
3141 for (
int i = 1; i <
value.Length; i++)
3143 if (
value[i] !=
' ')
3145 if (i + 1 >=
value.Length)
3156 if (
'A' <= c ||
' ' == c)
3163 return metaData.Count -
count;
3168 if (
'0' <= c && c <=
'9')
3176 if (
'A' <= c && c <=
'F')
3187 byte level = (((options.valuesSet & 4
u) != 0) ? options.level :
eventInfo.level);
3188 byte opcode = (((options.valuesSet & 8
u) != 0) ? options.opcode :
eventInfo.opcode);
static int EventActivityIdControl(ActivityControl ControlCode, ref Guid ActivityId)
static ? object CreateInstance([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type type, BindingFlags bindingAttr, Binder? binder, object?[]? args, CultureInfo? culture)
static bool TryGetSwitch(string switchName, out bool isEnabled)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
bool ContainsKey(TKey key)
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
void Add(TKey key, TValue value)
static ? Delegate Remove(Delegate? source, Delegate? value)
static ? Delegate Combine(Delegate? a, Delegate? b)
static void Log(int level, string? category, string? message)
void OnStart(string providerName, string activityName, int task, ref Guid activityId, ref Guid relatedActivityId, EventActivityOptions options, bool useTplSource=true)
static ActivityTracker Instance
void OnStop(string providerName, string activityName, int task, ref Guid activityId, bool useTplSource=true)
virtual void OnEventSourceCreated(EventSource eventSource)
static void AddEventSource(EventSource newEventSource)
static List< WeakReference< EventSource > > s_EventSources
static object EventListenersLock
static int EventActivityIdControl(Interop.Advapi32.ActivityControl ControlCode, ref Guid ActivityId)
static WriteEventErrorCode GetLastWriteEventError()
readonly EventProviderType m_eventProviderType
OverrideEventProvider(EventSource eventSource, EventProviderType providerType)
readonly EventSource m_eventSource
override void OnControllerCommand(ControllerCommand command, IDictionary< string, string > arguments, int perEventSourceSessionId, int etwSessionId)
void SendCommand(EventListener listener, EventProviderType eventProviderType, int perEventSourceSessionId, int etwSessionId, EventCommand command, bool enable, EventLevel level, EventKeywords matchAnyKeyword, IDictionary< string, string > commandArguments)
const string s_ActivityStartSuffix
const string DuplicateSourceNamesSwitch
unsafe void WriteEvent(int eventId, long arg1, byte[]? arg2)
unsafe void WriteEvent(int eventId, string? arg1, int arg2)
volatile ulong[] m_channelData
unsafe void WriteEventWithRelatedActivityId(int eventId, Guid relatedActivityId, params object?[] args)
static void AddProviderEnumKind(ManifestBuilder manifest, FieldInfo staticField, string providerEnumKind)
static EventSourceSettings ValidateSettings(EventSourceSettings settings)
unsafe void WriteMultiMergeInner(string eventName, ref EventSourceOptions options, TraceLoggingEventTypes eventTypes, Guid *activityID, Guid *childActivityID, params object[] values)
unsafe void WriteEventCore(int eventId, int eventDataCount, EventData *data)
void DispatchToAllListeners(EventWrittenEventArgs eventCallbackArgs)
Exception? ConstructionException
void WriteStringToAllListeners(string eventName, string msg)
EventHandler< EventCommandEventArgs >? EventCommandExecuted
void LogEventArgsMismatches(int eventId, object[] args)
Exception m_constructionException
static Guid GenerateGuidFromName(string name)
unsafe void WriteEvent(int eventId, string? arg1, string? arg2)
override string ToString()
static byte[] CreateManifestAndDescriptors([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type eventSourceType, string eventSourceDllName, EventSource source, EventManifestOptions flags=EventManifestOptions.None)
virtual void Dispose(bool disposing)
bool IsEnabledCommon(bool enabled, EventLevel currentLevel, EventKeywords currentMatchAnyKeyword, EventLevel eventLevel, EventKeywords eventKeywords, EventChannel eventChannel)
static Guid GetGuid(Type eventSourceType)
EventCommandEventArgs m_deferredCommands
static string GetName(Type eventSourceType)
unsafe void SendManifest(byte[] rawManifest)
bool IsEnabled(EventLevel level, EventKeywords keywords, EventChannel channel)
static int AddValueToMetaData(List< byte > metaData, string value)
EventSource(Guid eventSourceGuid, string eventSourceName)
static byte m_EventSourceExceptionRecurenceCount
unsafe void WriteToAllListeners(string eventName, ref EventDescriptor eventDescriptor, EventTags tags, Guid *pActivityId, Guid *pChildActivityId, EventPayload payload)
unsafe void Write(string? eventName)
EventSource(bool throwOnEventWriteErrors)
static Attribute GetCustomAttributeHelper(MemberInfo member, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.PublicProperties)] Type attributeType, EventManifestOptions flags=EventManifestOptions.None)
NameInfo UpdateDescriptor(string name, TraceLoggingEventTypes eventInfo, ref EventSourceOptions options, out EventDescriptor descriptor)
void AddListener(EventListener listener)
unsafe void WriteEvent(int eventId, long arg1, string? arg2)
EventKeywords m_matchAnyKeyword
static void DebugCheckEvent(ref Dictionary< string, string > eventsByName, EventMetadata[] eventData, MethodInfo method, EventAttribute eventAttribute, ManifestBuilder manifest, EventManifestOptions options)
unsafe void WriteEvent(int eventId, long arg1)
static void TrimEventDescriptors(ref EventMetadata[] eventData)
readonly TraceLoggingEventHandleTable m_eventHandleTable
virtual ReadOnlySpan< byte > ProviderMetadata
unsafe void WriteEvent(int eventId, string? arg1, int arg2, int arg3)
volatile OverrideEventProvider m_eventPipeProvider
unsafe void Initialize(Guid eventSourceGuid, string eventSourceName, string[] traits)
static Type GetEventSourceBaseType(Type eventSourceType, bool allowEventSourceOverride, bool reflectionOnly)
IntPtr m_writeEventStringEventHandle
unsafe void DefineEventPipeEvents()
volatile EventMetadata[] m_eventData
unsafe void WriteEvent(int eventId, int arg1)
const string EventSourceRequiresUnreferenceMessage
unsafe void WriteEvent(int eventId, int arg1, int arg2)
unsafe void WriteImpl(string eventName, ref EventSourceOptions options, object data, Guid *pActivityId, Guid *pRelatedActivityId, TraceLoggingEventTypes eventTypes)
unsafe void WriteEvent(int eventId, string? arg1, long arg2)
ActivityTracker m_activityTracker
unsafe void WriteEventRaw(string eventName, ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid *activityID, Guid *relatedActivityID, int dataCount, IntPtr data)
EventSource(string eventSourceName, EventSourceSettings config)
volatile byte[] m_rawManifest
virtual void OnEventCommand(EventCommandEventArgs command)
EventSource(string eventSourceName)
byte m_outOfBandMessageCount
static bool AttributeTypeNamesMatch(Type attributeType, Type reflectedAttributeType)
static void SetCurrentThreadActivityId(Guid activityId)
void ReportOutOfBandMessage(string msg)
unsafe void WriteEvent(int eventId, int arg1, string? arg2)
unsafe void WriteEvent(int eventId, params object?[] args)
static EventOpcode GetOpcodeWithDefault(EventOpcode opcode, string eventName)
bool EnableEventForDispatcher(EventDispatcher dispatcher, EventProviderType eventProviderType, int eventId, bool value)
unsafe void WriteEvent(int eventId, long arg1, long arg2, long arg3)
EventSource(EventSourceSettings settings, params string[]? traits)
static void SendCommand(EventSource eventSource, EventCommand command, IDictionary< string, string?>? commandArguments)
static ? string GenerateManifest([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type eventSourceType, string? assemblyPathToIncludeInManifest, EventManifestOptions flags)
static int GetHelperCallFirstArg(MethodInfo method)
bool m_eventSourceEnabled
void EnsureDescriptorsInitialized()
static bool IsCustomAttributeDefinedHelper(MemberInfo member, Type attributeType, EventManifestOptions flags=EventManifestOptions.None)
static IEnumerable< EventSource > GetSources()
const string s_ActivityStopSuffix
static string GetName(Type eventSourceType, EventManifestOptions flags)
unsafe void WriteEventVarargs(int eventId, Guid *childActivityID, object[] args)
volatile OverrideEventProvider m_etwProvider
static unsafe void DecodeObjects(object[] decodedObjects, Type[] parameterTypes, EventData *data)
const string EventSourceSuppressMessage
EventSource(EventSourceSettings settings)
unsafe void WriteEventWithRelatedActivityIdCore(int eventId, Guid *relatedActivityId, int eventDataCount, EventData *data)
unsafe void WriteToAllListeners(EventWrittenEventArgs eventCallbackArgs, int eventDataCount, EventData *data)
EventDispatcher GetDispatcher(EventListener listener)
static int HexDigit(char c)
static readonly bool AllowDuplicateSourceNames
EventSource(Guid eventSourceGuid, string eventSourceName, EventSourceSettings settings, string[] traits=null)
static void SetCurrentThreadActivityId(Guid activityId, out Guid oldActivityThatWillContinue)
string? GetTrait(string key)
volatile EventDispatcher m_Dispatchers
unsafe void WriteEvent(int eventId, long arg1, long arg2)
EventHandler< EventCommandEventArgs > m_eventCommandExecuted
EventSourceSettings Settings
const DynamicallyAccessedMemberTypes ManifestMemberTypes
object[] SerializeEventArgs(int eventId, object[] args)
unsafe void Write(string? eventName, EventSourceOptions options)
EventSource(string eventSourceName, EventSourceSettings config, params string[]? traits)
static void AddEventDescriptor([NotNull] ref EventMetadata[] eventData, string eventName, EventAttribute eventAttribute, ParameterInfo[] eventParameters, bool hasRelatedActivityID)
void InitializeProviderMetadata()
static unsafe void WriteCleanup(GCHandle *pPins, int cPins)
static ? string GenerateManifest([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type eventSourceType, string? assemblyPathToIncludeInManifest)
unsafe void WriteEvent(int eventId, string? arg1)
static bool InitializeIsSupported()
unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3)
void DoCommand(EventCommandEventArgs commandArgs)
unsafe void WriteEvent(int eventId, int arg1, int arg2, int arg3)
static bool RemoveFirstArgIfRelatedActivityId(ref ParameterInfo[] args)
bool SelfDescribingEvents
unsafe void WriteEvent(int eventId, byte[]? arg1)
void ThrowEventSourceException(string eventName, Exception innerEx=null)
readonly EventSourceSettings m_config
bool IsEnabled(EventLevel level, EventKeywords keywords)
unsafe void WriteMultiMerge(string eventName, ref EventSourceOptions options, TraceLoggingEventTypes eventTypes, Guid *activityID, Guid *childActivityID, EventData *data)
unsafe void WriteEvent(int eventId)
byte[] m_providerMetadata
unsafe void WriteMultiMerge(string eventName, ref EventSourceOptions options, TraceLoggingEventTypes eventTypes, Guid *activityID, Guid *childActivityID, params object[] values)
bool ThrowOnEventWriteErrors
static unsafe void AssertValidString(EventData *data)
bool m_eventSourceDisposed
unsafe void WriteEventString(string msgString)
static Guid CurrentThreadActivityId
bool IsEnabledByDefault(int eventNum, bool enable, EventLevel currentLevel, EventKeywords currentMatchAnyKeyword)
static readonly ReadOnlyCollection< object > EmptyPayload
static void ReserveEventIDsBelow(int eventId)
static byte[] MetadataForString(string name, int prefixSize, int suffixSize, int additionalSize)
static object Parse(Type enumType, string value)
static bool IsWindows8OrAbove
static void SuppressFinalize(object obj)
static CultureInfo CurrentUICulture
static bool PreserveEventListnerObjectIdentity
static byte Min(byte val1, byte val2)
static byte Max(byte val1, byte val2)
static IList< CustomAttributeData > GetCustomAttributes(MemberInfo target)
bool IsDefined(Type attributeType, bool inherit)
virtual Type ParameterType
static void Copy(int[] source, int startIndex, IntPtr destination, int length)
static string EventSource_EventNameReused
static string EventSource_MismatchIdToWriteEvent
static string EventSource_EnumKindMismatch
static string EventSource_EventMustHaveTaskIfNonDefaultOpcode
static string EventSource_EventTooBig
static string EventSource_InvalidEventFormat
static string EventSource_BadHexDigit
static string EventSource_TypeMustDeriveFromEventSource
static string EventSource_NeedName
static string EventSource_TaskOpcodePairReused
static string EventSource_EventMustNotBeExplicitImplementation
static string Format(string resourceFormat, object p1)
static string EventSource_IllegalValue
static string EventSource_ListenerNotFound
static string EventSource_TraitEven
static string EventSource_TypeMustBeSealedOrAbstract
static string EventSource_NoFreeBuffers
static string EventSource_NoRelatedActivityId
static string EventSource_VarArgsParameterMismatch
static string EventSource_AbstractMustNotDeclareKTOC
static string EventSource_AbstractMustNotDeclareEventMethods
static string EventSource_NeedGuid
static string EventSource_EventParametersMismatch
static string EventSource_ToString
static string EventSource_InvalidCommand
static string EventSource_EventSourceGuidInUse
static string EventSource_NullInput
static string EventSource_NeedPositiveId
static string EventSource_EvenHexDigits
static string EventSource_EventIdReused
static string EventSource_UnknownEtwTrait
static string EventSource_TooManyArgs
static string Argument_InvalidTypeName
static string EventSource_StopsFollowStarts
static Encoding BigEndianUnicode
static int CompareExchange(ref int location1, int value, int comparand)
static readonly TplEventSource Log
static void Sleep(int millisecondsTimeout)
static TypeCode GetTypeCode(Type? type)
DynamicallyAccessedMemberTypes
@ EtwSelfDescribingEventFormat
static DataCollector ThreadInstance
unsafe IntPtr DataPointer
unsafe void SetMetadata(byte *pointer, int size, int reserved)
static bool TryParse([NotNullWhen(true)] string? input, out Guid result)
static readonly Guid Empty
static readonly IntPtr Zero