Skip to content

Commit 8a2bbb0

Browse files
committed
Convert genRuntimeEventSources to a C# source generator
1 parent 7dcd892 commit 8a2bbb0

File tree

8 files changed

+404
-599
lines changed

8 files changed

+404
-599
lines changed

Directory.Build.targets

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
1313
<Import Project="$(RepositoryEngineeringDir)toolAot.targets" />
1414
<Import Project="$(RepositoryEngineeringDir)generators.targets" />
15-
<Import Project="$(RepositoryEngineeringDir)python.targets" />
1615
<Import Project="$(RepositoryEngineeringDir)generatorProjects.targets" Condition="'$(IsGeneratorProject)' == 'true'" />
1716
<Import Project="$(RepositoryEngineeringDir)resolveContract.targets" Condition="'$(IsSourceProject)' == 'true'" />
1817
<Import Project="$(RepositoryEngineeringDir)packaging.targets" Condition="'$(IsPackable)' == 'true' and '$(MSBuildProjectExtension)' != '.pkgproj'" />

eng/python.targets

-31
This file was deleted.

src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj

+2-25
Original file line numberDiff line numberDiff line change
@@ -314,30 +314,7 @@
314314
<Import Project="$(RepositoryEngineeringDir)codeOptimization.targets" />
315315

316316
<!-- Setup eventing file generation -->
317-
<ItemGroup>
318-
<EventingGenerationScript Include="$(CoreClrProjectRoot)scripts/genRuntimeEventSources.py" />
319-
<EventManifestFile Include="$(CoreClrProjectRoot)vm/ClrEtwAll.man" />
320-
<EventingSourceFile Include="$(IntermediateOutputPath)NativeRuntimeEventSource.Generated.cs" Condition="'$(FeaturePerfTracing)' == 'true' ">
321-
<Link>src\System\Diagnostics\Eventing\NativeRuntimeEventSource.Generated.cs</Link>
322-
</EventingSourceFile>
323-
<Compile Include="@(EventingSourceFile)" />
317+
<ItemGroup Condition="'$(FeaturePerfTracing)' == 'true'">
318+
<AdditionalFiles Include="$(CoreClrProjectRoot)vm/ClrEtwAll.man" />
324319
</ItemGroup>
325-
326-
<Target Name="GenerateEventingFiles" Inputs="@(EventingGenerationScript);@(EventManifestFile)" Outputs="@(EventingSourceFile)" DependsOnTargets="FindPython" BeforeTargets="BeforeCompile">
327-
328-
<Error Condition="'$(PYTHON)' == ''" Text="Unable to locate Python. NativeRuntimeEventSource.Generated.cs cannot be generated without Python installed on the machine. Either install Python in your path or point to it with the PYTHON environment variable." />
329-
<PropertyGroup>
330-
<_PythonWarningParameter>-Wall</_PythonWarningParameter>
331-
<_PythonWarningParameter Condition="'$(MSBuildTreatWarningsAsErrors)' == 'true'">$(_PythonWarningParameter) -Werror</_PythonWarningParameter>
332-
<_EventingSourceFileDirectory>%(EventingSourceFile.RootDir)%(EventingSourceFile.Directory)</_EventingSourceFileDirectory>
333-
<_EventingSourceFileDirectory Condition="HasTrailingSlash('$(_EventingSourceFileDirectory)')">$(_EventingSourceFileDirectory.TrimEnd('\'))</_EventingSourceFileDirectory>
334-
335-
</PropertyGroup>
336-
337-
<Exec Command="&quot;$(PYTHON)&quot; -B $(_PythonWarningParameter) &quot;@(EventingGenerationScript)&quot; --man &quot;@(EventManifestFile)&quot; --intermediate &quot;$(_EventingSourceFileDirectory)&quot;" />
338-
339-
<ItemGroup>
340-
<FileWrites Include="@(EventingSourceFile)" />
341-
</ItemGroup>
342-
</Target>
343320
</Project>

src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj

+3-29
Original file line numberDiff line numberDiff line change
@@ -565,34 +565,8 @@
565565
</ItemGroup>
566566

567567
<!-- Setup eventing file generation -->
568-
<ItemGroup>
569-
<EventingGenerationScript Include="$(CoreClrProjectRoot)scripts/genRuntimeEventSources.py" />
570-
<EventManifestFile Include="$(CoreClrProjectRoot)vm/ClrEtwAll.man" />
571-
<EventingInclusionList Include="$(CoreClrProjectRoot)nativeaot/Runtime/eventpipe/gen-eventing-event-inc.lst" />
572-
<EventingSourceFile Include="$(IntermediateOutputPath)NativeRuntimeEventSource.Generated.cs" Condition="'$(FeaturePerfTracing)' == 'true' ">
573-
<Link>src\System\Diagnostics\Eventing\NativeRuntimeEventSource.Generated.cs</Link>
574-
</EventingSourceFile>
575-
<Compile Include="@(EventingSourceFile)" />
568+
<ItemGroup Condition="'$(FeaturePerfTracing)' == 'true'">
569+
<AdditionalFiles Include="$(CoreClrProjectRoot)vm/ClrEtwAll.man" />
570+
<AdditionalFiles Include="$(CoreClrProjectRoot)nativeaot/Runtime/eventpipe/gen-eventing-event-inc.lst" />
576571
</ItemGroup>
577-
578-
<Target Name="GenerateEventingFiles"
579-
Inputs="@(EventingGenerationScript);@(EventManifestFile);@(EventingInclusionList)"
580-
Outputs="@(EventingSourceFile)"
581-
DependsOnTargets="FindPython"
582-
BeforeTargets="BeforeCompile">
583-
584-
<Error Condition="'$(PYTHON)' == ''" Text="Unable to locate Python. NativeRuntimeEventSource.Generared.cs cannot be generated without Python installed on the machine. Either install Python in your path or point to it with the PYTHON environment variable." />
585-
<PropertyGroup>
586-
<_PythonWarningParameter>-Wall</_PythonWarningParameter>
587-
<_PythonWarningParameter Condition="'$(MSBuildTreatWarningsAsErrors)' == 'true'">$(_PythonWarningParameter) -Werror</_PythonWarningParameter>
588-
<_EventingSourceFileDirectory>%(EventingSourceFile.RootDir)%(EventingSourceFile.Directory)</_EventingSourceFileDirectory>
589-
<_EventingSourceFileDirectory Condition="HasTrailingSlash('$(_EventingSourceFileDirectory)')">$(_EventingSourceFileDirectory.TrimEnd('\'))</_EventingSourceFileDirectory>
590-
</PropertyGroup>
591-
592-
<Exec Command="&quot;$(PYTHON)&quot; -B $(_PythonWarningParameter) &quot;@(EventingGenerationScript)&quot; --man &quot;@(EventManifestFile)&quot; --intermediate &quot;$(_EventingSourceFileDirectory)&quot; --inc &quot;@(EventingInclusionList)&quot;" />
593-
594-
<ItemGroup>
595-
<FileWrites Include="@(EventingSourceFile)" />
596-
</ItemGroup>
597-
</Target>
598572
</Project>

0 commit comments

Comments
 (0)