Skip to content

Commit 3948247

Browse files
committed
1) Remove [EventSourceAutoGenerate], we rely on just [EventSource] + no explicit ctors
2) Introduce a new global SourceGenerators - EventSourceGenerator (and move the existing impl from SPC.Generators to this new project) 3) Update slnx files (via the UpdateSolutionFiles task) 4) Migrate all classes with [EventSource] to use the SG. Except for the ones with EtwSelfDescribingEventFormat
1 parent 25800e6 commit 3948247

File tree

204 files changed

+1441
-192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+1441
-192
lines changed

eng/generators.targets

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@
4040
'$(DisableImplicitFrameworkReferences)' == 'true' and
4141
'@(ProjectReference->AnyHaveMetadataValue('Filename', 'System.Runtime.InteropServices'))' == 'true'
4242
)" />
43+
44+
<EnabledGenerators Include="EventSourceGenerator"
45+
Condition="'$(IsSourceProject)' == 'true' and
46+
'$(MSBuildProjectExtension)' == '.csproj' and
47+
(
48+
'$(DisableImplicitFrameworkReferences)' == 'true'
49+
)" />
4350
</ItemGroup>
4451

4552
<ItemGroup Condition="'@(EnabledGenerators)' != '' and
@@ -70,6 +77,11 @@
7077
OutputItemType="Analyzer"
7178
SetConfiguration="Configuration=$(LibrariesConfiguration)"
7279
Condition="@(EnabledGenerators->AnyHaveMetadataValue('Identity', 'ComInterfaceGenerator'))" />
80+
<ProjectReference Include="$(LibrariesProjectRoot)System.Private.CoreLib\gen\EventSourceGenerator.csproj"
81+
ReferenceOutputAssembly="false"
82+
OutputItemType="Analyzer"
83+
SetConfiguration="Configuration=$(LibrariesConfiguration)"
84+
Condition="@(EnabledGenerators->AnyHaveMetadataValue('Identity', 'EventSourceGenerator'))" />
7385
</ItemGroup>
7486

7587
<Target Name="ConfigureGenerators"

src/coreclr/System.Private.CoreLib/System.Private.CoreLib.slnx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
<BuildType Solution="Checked|x64" Project="Release" />
2222
<BuildType Solution="Checked|x86" Project="Debug" />
2323
</Project>
24+
<Project Path="../../libraries/System.Private.CoreLib/gen/EventSourceGenerator.csproj">
25+
<BuildType Solution="Checked|amd64" Project="Debug" />
26+
<BuildType Solution="Checked|Any CPU" Project="Debug" />
27+
<BuildType Solution="Checked|arm" Project="Debug" />
28+
<BuildType Solution="Checked|arm64" Project="Debug" />
29+
<BuildType Solution="Checked|wasm" Project="Debug" />
30+
<BuildType Solution="Checked|x64" Project="Release" />
31+
<BuildType Solution="Checked|x86" Project="Debug" />
32+
</Project>
2433
<Project Path="../../libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.csproj">
2534
<BuildType Solution="Checked|*" Project="Debug" />
2635
</Project>

src/coreclr/tools/aot/ILCompiler.DependencyAnalysisFramework/PerfEventSource.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
namespace ILCompiler.DependencyAnalysisFramework
1111
{
1212
[EventSource(Name = "Microsoft-ILCompiler-Graph-Perf")]
13-
public class PerfEventSource : EventSource
13+
public partial class PerfEventSource : EventSource
1414
{
15-
private PerfEventSource() { }
16-
1715
public static PerfEventSource Log = new PerfEventSource();
1816

1917
public struct StartStopEvents : IDisposable

src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/PerfEventSource.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
namespace ILCompiler
1111
{
1212
[EventSource(Name = "Microsoft-ILCompiler-Perf")]
13-
public class PerfEventSource : EventSource
13+
public partial class PerfEventSource : EventSource
1414
{
15-
private PerfEventSource() { }
16-
1715
public static PerfEventSource Log = new PerfEventSource();
1816

1917
public struct StartStopEvents : IDisposable

src/libraries/Microsoft.Bcl.Cryptography/Microsoft.Bcl.Cryptography.slnx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
<Platform Name="x86" />
1111
</Configurations>
1212
<Folder Name="/gen/">
13+
<Project Path="../System.Private.CoreLib/gen/EventSourceGenerator.csproj">
14+
<BuildType Solution="Checked|*" Project="Debug" />
15+
<Build Solution="*|arm" Project="false" />
16+
<Build Solution="*|arm64" Project="false" />
17+
<Build Solution="Checked|Any CPU" Project="false" />
18+
<Build Solution="Checked|x64" Project="false" />
19+
<Build Solution="Checked|x86" Project="false" />
20+
</Project>
1321
<Project Path="../System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj">
1422
<BuildType Solution="Checked|*" Project="Debug" />
1523
<Build Solution="*|arm" Project="false" />

src/libraries/Microsoft.CSharp/Microsoft.CSharp.slnx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
<Platform Name="x86" />
1111
</Configurations>
1212
<Folder Name="/gen/">
13+
<Project Path="../System.Private.CoreLib/gen/EventSourceGenerator.csproj">
14+
<BuildType Solution="Checked|*" Project="Debug" />
15+
<Build Solution="*|arm" Project="false" />
16+
<Build Solution="*|arm64" Project="false" />
17+
<Build Solution="Checked|Any CPU" Project="false" />
18+
<Build Solution="Checked|x64" Project="false" />
19+
<Build Solution="Checked|x86" Project="false" />
20+
</Project>
1321
<Project Path="../System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj">
1422
<BuildType Solution="Checked|*" Project="Debug" />
1523
<Build Solution="*|arm" Project="false" />

src/libraries/Microsoft.Extensions.Caching.Memory/Microsoft.Extensions.Caching.Memory.slnx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
<Build Solution="Checked|x64" Project="false" />
4343
<Build Solution="Checked|x86" Project="false" />
4444
</Project>
45+
<Project Path="../System.Private.CoreLib/gen/EventSourceGenerator.csproj">
46+
<BuildType Solution="Checked|*" Project="Debug" />
47+
<Build Solution="*|arm" Project="false" />
48+
<Build Solution="*|arm64" Project="false" />
49+
<Build Solution="Checked|Any CPU" Project="false" />
50+
<Build Solution="Checked|x64" Project="false" />
51+
<Build Solution="Checked|x86" Project="false" />
52+
</Project>
4553
<Project Path="../System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj">
4654
<BuildType Solution="Checked|*" Project="Debug" />
4755
<Build Solution="*|arm" Project="false" />

src/libraries/Microsoft.Extensions.Configuration.Binder/Microsoft.Extensions.Configuration.Binder.slnx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
<Build Solution="Checked|x64" Project="false" />
1919
<Build Solution="Checked|x86" Project="false" />
2020
</Project>
21+
<Project Path="../System.Private.CoreLib/gen/EventSourceGenerator.csproj">
22+
<BuildType Solution="Checked|*" Project="Debug" />
23+
<Build Solution="*|arm" Project="false" />
24+
<Build Solution="*|arm64" Project="false" />
25+
<Build Solution="Checked|Any CPU" Project="false" />
26+
<Build Solution="Checked|x64" Project="false" />
27+
<Build Solution="Checked|x86" Project="false" />
28+
</Project>
2129
<Project Path="../System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj">
2230
<BuildType Solution="Checked|*" Project="Debug" />
2331
<Build Solution="*|arm" Project="false" />

src/libraries/Microsoft.Extensions.Configuration.Json/Microsoft.Extensions.Configuration.Json.slnx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
<Build Solution="Checked|x64" Project="false" />
1919
<Build Solution="Checked|x86" Project="false" />
2020
</Project>
21+
<Project Path="../System.Private.CoreLib/gen/EventSourceGenerator.csproj">
22+
<BuildType Solution="Checked|*" Project="Debug" />
23+
<Build Solution="*|arm" Project="false" />
24+
<Build Solution="*|arm64" Project="false" />
25+
<Build Solution="Checked|Any CPU" Project="false" />
26+
<Build Solution="Checked|x64" Project="false" />
27+
<Build Solution="Checked|x86" Project="false" />
28+
</Project>
2129
<Project Path="../System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj">
2230
<BuildType Solution="Checked|*" Project="Debug" />
2331
<Build Solution="*|arm" Project="false" />

src/libraries/Microsoft.Extensions.Configuration.UserSecrets/Microsoft.Extensions.Configuration.UserSecrets.slnx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
<Platform Name="x86" />
1111
</Configurations>
1212
<Folder Name="/gen/">
13+
<Project Path="../System.Private.CoreLib/gen/EventSourceGenerator.csproj">
14+
<BuildType Solution="Checked|*" Project="Debug" />
15+
<Build Solution="*|arm" Project="false" />
16+
<Build Solution="*|arm64" Project="false" />
17+
<Build Solution="Checked|Any CPU" Project="false" />
18+
<Build Solution="Checked|x64" Project="false" />
19+
<Build Solution="Checked|x86" Project="false" />
20+
</Project>
1321
<Project Path="../System.Private.CoreLib/gen/System.Private.CoreLib.Generators.csproj">
1422
<BuildType Solution="Checked|*" Project="Debug" />
1523
<Build Solution="*|arm" Project="false" />

0 commit comments

Comments
 (0)