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

Make CreateManifestAndDescriptors a nop for NativeRuntimeEventSource #90416

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -3099,6 +3099,11 @@ private static bool AttributeTypeNamesMatch(Type attributeType, Type reflectedAt
EventSource? source,
EventManifestOptions flags = EventManifestOptions.None)
{
if (source is NativeRuntimeEventSource)
{
return null;
}

ManifestBuilder? manifest = null;
bool bNeedsManifest = source != null ? !source.SelfDescribingEvents : true;
Exception? exception = null; // exception that might get raised during validation b/c we couldn't/didn't recover from a previous error
Expand Down Expand Up @@ -3126,20 +3131,11 @@ private static bool AttributeTypeNamesMatch(Type attributeType, Type reflectedAt
if (eventSourceAttrib != null && eventSourceAttrib.LocalizationResources != null)
resources = new ResourceManager(eventSourceAttrib.LocalizationResources, eventSourceType.Assembly);

if (source?.GetType() == typeof(NativeRuntimeEventSource))
{
// Don't emit nor generate the manifest for NativeRuntimeEventSource i.e., Microsoft-Windows-DotNETRuntime.
manifest = new ManifestBuilder(resources, flags);
bNeedsManifest = false;
}
else
{
// Try to get name and GUID directly from the source. Otherwise get it from the Type's attribute.
string providerName = source?.Name ?? GetName(eventSourceType, flags);
Guid providerGuid = source?.Guid ?? GetGuid(eventSourceType);
// Try to get name and GUID directly from the source. Otherwise get it from the Type's attribute.
string providerName = source?.Name ?? GetName(eventSourceType, flags);
Guid providerGuid = source?.Guid ?? GetGuid(eventSourceType);

manifest = new ManifestBuilder(providerName, providerGuid, eventSourceDllName, resources, flags);
}
manifest = new ManifestBuilder(providerName, providerGuid, eventSourceDllName, resources, flags);

// Add an entry unconditionally for event ID 0 which will be for a string message.
manifest.StartEvent("EventSourceMessage", new EventAttribute(0) { Level = EventLevel.LogAlways, Task = (EventTask)0xFFFE });
Expand Down