dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.92k stars 4.02k forks source link

Report Generator timing info in VS 'Report a problem' #68401

Open chsienki opened 1 year ago

chsienki commented 1 year ago

The generator driver has the ability to capture information about generator timing via an ETW event source called Microsoft-CodeAnalysis-General

When using the 'Report a problem' tool inside Visual Studio, certain ETW providers are turned on and captured in the trace. We should add Microsoft-CodeAnalysis-General to these providers so that the timing information is captured and allows us to quickly see if a misbehaving generator is causing any slowness.

Note: there is already a roslyn ETW provider included in the traces RoslynEventSource but we can't use it in this case as it's declared in the workspaces layer rather than the compiler layer.

chsienki commented 1 year ago

This hasn't yet closed on the VS side, so leaving it here for tracking until it does. (see https://devdiv.visualstudio.com/DevDiv/_git/Setup-Engine/pullrequest/485095)