From 412a409a53916be9e961b0dfef5be51e95fc2554 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 23 Oct 2024 16:07:35 -0700 Subject: [PATCH] Use distinct EventSource names for compiler and workspace layer events --- ...ource.cs => CodeAnalysisEventSource.Common.cs} | 5 +---- .../Portable/CodeAnalysisEventSource.Compiler.cs | 15 +++++++++++++++ .../CodeAnalysisEventSource.Workspaces.cs | 15 +++++++++++++++ .../Microsoft.CodeAnalysis.Workspaces.csproj | 2 +- 4 files changed, 32 insertions(+), 5 deletions(-) rename src/Compilers/Core/Portable/{CodeAnalysisEventSource.cs => CodeAnalysisEventSource.Common.cs} (97%) create mode 100644 src/Compilers/Core/Portable/CodeAnalysisEventSource.Compiler.cs create mode 100644 src/Workspaces/Core/Portable/Diagnostics/CodeAnalysisEventSource.Workspaces.cs diff --git a/src/Compilers/Core/Portable/CodeAnalysisEventSource.cs b/src/Compilers/Core/Portable/CodeAnalysisEventSource.Common.cs similarity index 97% rename from src/Compilers/Core/Portable/CodeAnalysisEventSource.cs rename to src/Compilers/Core/Portable/CodeAnalysisEventSource.Common.cs index 7081fd195e492..2cfdcf8cfbbce 100644 --- a/src/Compilers/Core/Portable/CodeAnalysisEventSource.cs +++ b/src/Compilers/Core/Portable/CodeAnalysisEventSource.Common.cs @@ -7,11 +7,8 @@ namespace Microsoft.CodeAnalysis { - [EventSource(Name = "Microsoft-CodeAnalysis-General")] - internal sealed class CodeAnalysisEventSource : EventSource + internal sealed partial class CodeAnalysisEventSource : EventSource { - public static readonly CodeAnalysisEventSource Log = new CodeAnalysisEventSource(); - public static class Keywords { public const EventKeywords Performance = (EventKeywords)1; diff --git a/src/Compilers/Core/Portable/CodeAnalysisEventSource.Compiler.cs b/src/Compilers/Core/Portable/CodeAnalysisEventSource.Compiler.cs new file mode 100644 index 0000000000000..1700cb75d80ac --- /dev/null +++ b/src/Compilers/Core/Portable/CodeAnalysisEventSource.Compiler.cs @@ -0,0 +1,15 @@ +// 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. + +using System; +using System.Diagnostics.Tracing; + +namespace Microsoft.CodeAnalysis +{ + [EventSource(Name = "Microsoft-CodeAnalysis-General")] + internal sealed partial class CodeAnalysisEventSource + { + public static readonly CodeAnalysisEventSource Log = new CodeAnalysisEventSource(); + } +} diff --git a/src/Workspaces/Core/Portable/Diagnostics/CodeAnalysisEventSource.Workspaces.cs b/src/Workspaces/Core/Portable/Diagnostics/CodeAnalysisEventSource.Workspaces.cs new file mode 100644 index 0000000000000..40eaeb56ca70b --- /dev/null +++ b/src/Workspaces/Core/Portable/Diagnostics/CodeAnalysisEventSource.Workspaces.cs @@ -0,0 +1,15 @@ +// 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. + +using System; +using System.Diagnostics.Tracing; + +namespace Microsoft.CodeAnalysis +{ + [EventSource(Name = "Microsoft-CodeAnalysis-Workspaces")] + internal sealed partial class CodeAnalysisEventSource + { + public static readonly CodeAnalysisEventSource Log = new CodeAnalysisEventSource(); + } +} diff --git a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj index 172991f821fa8..7ddf1ce681c17 100644 --- a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj +++ b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj @@ -40,7 +40,7 @@ - +