Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove AnonymousType ILLinkTrim entry for EventSource #37083

Merged
merged 1 commit into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/coreclr/src/System.Private.CoreLib/ILLinkTrim.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
<!-- Accessed via private reflection and by native code. -->
<type fullname="System.Diagnostics.Tracing.RuntimeEventSource" />
<type fullname="System.Diagnostics.Tracing.NativeRuntimeEventSource" />
<!-- Accessed via reflection in TraceLogging-style EventSource events. -->
<type fullname="*f__AnonymousType*" />
<type fullname="System.Diagnostics.Tracing.PropertyValue/ReferenceTypeHelper`1">
<!-- Instantiated via reflection -->
<method name=".ctor" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2178,9 +2178,8 @@ private unsafe void WriteEventString(string msgString)
Keywords = (EventKeywords)unchecked(keywords),
Level = level
};
var msg = new { message = msgString };
var tlet = new TraceLoggingEventTypes(EventName, EventTags.None, new Type[] { msg.GetType() });
WriteMultiMergeInner(EventName, ref opt, tlet, null, null, msg);
var tlet = new TraceLoggingEventTypes(EventName, EventTags.None, new Type[] { typeof(string) });
WriteMultiMergeInner(EventName, ref opt, tlet, null, null, msgString);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ public override void WriteMetadata(
string? name,
EventFieldFormat format)
{
collector.AddNullTerminatedString(name!, Statics.MakeDataType(TraceLoggingDataType.Utf16String, format));
// name can be null if the string was used as a top-level object in an event.
// In that case, use 'message' as the name of the field.
name ??= "message";

collector.AddNullTerminatedString(name, Statics.MakeDataType(TraceLoggingDataType.Utf16String, format));
}

public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value)
Expand Down