Skip to content

Comments

Include info about which analyzers enable concurrency in AnalyzerReport#82481

Open
RikkiGibson wants to merge 3 commits intodotnet:mainfrom
RikkiGibson:analyzer-concurrency-report
Open

Include info about which analyzers enable concurrency in AnalyzerReport#82481
RikkiGibson wants to merge 3 commits intodotnet:mainfrom
RikkiGibson:analyzer-concurrency-report

Conversation

@RikkiGibson
Copy link
Member

Closes #82480

Example output when some analyzers are not concurrent:

Microsoft (R) Visual C# Compiler version 5.5.0-dev (<developer build>)
Copyright (C) Microsoft Corporation. All rights reserved.

CommandLineTests.cs_9429_03ce48da-fa09-4d79-afc2-715de31a2eef.tmp(1,7): info SP0001: Diagnostic 'Warning01: Throwing a diagnostic for types declared' was programmatically suppressed by a DiagnosticSuppressor with suppression ID 'Suppressor01' and justification 'Suppress Warning01'
CommandLineTests.cs_9429_03ce48da-fa09-4d79-afc2-715de31a2eef.tmp(1,7): warning ConcurrentAnalyzerId: ConcurrentAnalyzerMessage for symbol 'C'
NOTE: Elapsed time may be less than analyzer execution time because analyzers can run concurrently.

Total analyzer execution time: 0.141 seconds.

Time (s)    %   Analyzer
   0.124   87   Microsoft.CodeAnalysis.Test.Utilities, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   0.119   84      Microsoft.CodeAnalysis.CommonDiagnosticAnalyzers+ConcurrentAnalyzer (ConcurrentAnalyzerId)
   0.005    3      Microsoft.CodeAnalysis.CommonDiagnosticAnalyzers+DiagnosticSuppressorForId (Suppressor01)

   0.017   12   Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   0.017   12      Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests.WarningDiagnosticAnalyzer (Warning01)

Analyzers that have not enabled concurrent execution:
   Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35
      Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests.WarningDiagnosticAnalyzer

Total generator execution time: 0.013 seconds.

Time (s)    %   Generator
  <0.001   <1   Microsoft.CodeAnalysis.Compiler.Test.Resources, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  <0.001   <1      TestResources.Analyzers.DoNothingGenerator

Example output when all analyzers are concurrent:

Microsoft (R) Visual C# Compiler version 5.5.0-dev (<developer build>)
Copyright (C) Microsoft Corporation. All rights reserved.

CommandLineTests.cs_9460_f1efd71e-cdf4-4da6-bebd-2dce1b204b21.tmp(1,7): warning ConcurrentAnalyzerId: ConcurrentAnalyzerMessage for symbol 'C'
NOTE: Elapsed time may be less than analyzer execution time because analyzers can run concurrently.

Total analyzer execution time: 0.142 seconds.

Time (s)    %   Analyzer
   0.142  100   Microsoft.CodeAnalysis.Test.Utilities, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35
   0.142   99      Microsoft.CodeAnalysis.CommonDiagnosticAnalyzers+ConcurrentAnalyzer (ConcurrentAnalyzerId)
  <0.001   <1      Microsoft.CodeAnalysis.CommonDiagnosticAnalyzers+DiagnosticSuppressorForId (Suppressor01)

All analyzers have enabled concurrent execution.

Total generator execution time: 0.013 seconds.

Time (s)    %   Generator
  <0.001   <1   Microsoft.CodeAnalysis.Compiler.Test.Resources, Version=42.42.42.42, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  <0.001   <1      TestResources.Analyzers.DoNothingGenerator

@RikkiGibson RikkiGibson requested a review from a team as a code owner February 20, 2026 22:42
@RikkiGibson
Copy link
Member Author

RikkiGibson commented Feb 20, 2026

I'm unsure how the grouping of these messages works in the binlog viewer or where the "Analyzer Report"/"Generator Report" headers come from.

I think just reordering the logs could give a better result.

image

@AlekseyTs
Copy link
Contributor

The PR title doesn't sound as an action and doesn't describe what is done

@RikkiGibson RikkiGibson changed the title Analyzer concurrency report Include info about which analyzers enable concurrency in AnalyzerReport Feb 20, 2026
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (commit 2)

@RikkiGibson
Copy link
Member Author

@JoeRobich let me know that the binlog viewer is special casing some of the diagnostic messages to show them in a structured form.

https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/main/src/StructuredLogger/Analyzers/CscTaskAnalyzer.cs#L24

I think it's not really worth trying to change the order of messages as currently implemented in this PR. It seems reasonable to send a PR to the binlog viewer, to show this new output in a structured form.

@RikkiGibson
Copy link
Member Author

RuntimeAsync and UsedAssemblies jobs have "dead-lettered" and need to be rerun.

Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (commit 3)

@RikkiGibson RikkiGibson enabled auto-merge (squash) February 23, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReportAnalyzer should report when analyzers don't support concurrent execution

3 participants