Use EventSource guid ctor for RuntimeEventSource (dotnet/coreclr#21714)
authorBen Adams <thundercat@illyriad.co.uk>
Sun, 30 Dec 2018 15:35:42 +0000 (16:35 +0100)
committerJan Kotas <jkotas@microsoft.com>
Sun, 30 Dec 2018 15:35:42 +0000 (05:35 -1000)
Commit migrated from https://github.com/dotnet/coreclr/commit/77b8960b562959998827a988a5e4ea1460ef3c82

src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/DotNETRuntimeEventSource.cs
src/coreclr/src/scripts/genRuntimeEventSources.py

index 42cf779..604d7c5 100644 (file)
@@ -1,6 +1,7 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
+
 namespace System.Diagnostics.Tracing
 {
 #if FEATURE_PERFTRACING
@@ -8,8 +9,12 @@ namespace System.Diagnostics.Tracing
     /// RuntimeEventSource is an EventSource that represents the ETW/EventPipe events emitted by the native runtime.
     /// Most of RuntimeEventSource is auto-generated by scripts/genRuntimeEventSources.py based on the contents of the Microsoft-Windows-DotNETRuntime provider.
     /// </summary>
+    [EventSource(Guid = "5E5BB766-BBFC-5662-0548-1D44FAD9BB56", Name = "Microsoft-Windows-DotNETRuntime")]
     internal sealed partial class RuntimeEventSource : EventSource
     {
+        // The RuntimeEventSource GUID is {5e5bb766-bbfc-5662-0548-1d44fad9bb56}
+        private RuntimeEventSource() : base(new Guid(0x5e5bb766, 0xbbfc, 0x5662, 0x05, 0x48, 0x1d, 0x44, 0xfa, 0xd9, 0xbb, 0x56), "Microsoft-Windows-DotNETRuntime") { }
+
         /// <summary>
         /// Dispatch a single event with the specified event ID and payload.
         /// </summary>
index 1bde74a..014abcb 100644 (file)
@@ -374,7 +374,6 @@ namespace System.Diagnostics.Tracing
             increaseTabLevel()
 
             className = providerNameToClassNameMap[providerName]
-            writeOutput(outputFile, "[EventSource(Name = \"" + providerName + "\")]\n")
             writeOutput(outputFile, "internal sealed partial class " + className + " : EventSource\n")
             writeOutput(outputFile, "{\n")
             increaseTabLevel()