Skip to content

Add RequestThreadProc context to ETW events - #13978

Merged
AlesProkop merged 8 commits into
dotnet:mainfrom
vitek-karas:feature/requestthreadproc-event-context
Jun 26, 2026
Merged

Add RequestThreadProc context to ETW events#13978
AlesProkop merged 8 commits into
dotnet:mainfrom
vitek-karas:feature/requestthreadproc-event-context

Conversation

@vitek-karas

Copy link
Copy Markdown
Member

Summary

  • add request context payload to RequestThreadProcStart/RequestThreadProcStop
  • emit project and request identifiers from RequestBuilder
  • add a unit test covering the enriched start/stop event payloads

Testing

  • .\build.cmd -v quiet
  • artifacts\bin\Microsoft.Build.Engine.UnitTests\Debug\net10.0\Microsoft.Build.Engine.UnitTests.exe --filter-method "RequestThreadProcEventsIncludeRequestContext"
  • artifacts\bin\Microsoft.Build.Engine.UnitTests\Debug\net472\Microsoft.Build.Engine.UnitTests.exe --filter-method "RequestThreadProcEventsIncludeRequestContext"

vitek-karas and others added 5 commits June 5, 2026 14:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vitek-karas
vitek-karas marked this pull request as ready for review June 7, 2026 18:40
Copilot AI review requested due to automatic review settings June 7, 2026 18:40
@vitek-karas
vitek-karas requested a review from AR-May June 7, 2026 18:40
@vitek-karas vitek-karas self-assigned this Jun 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enriches MSBuild’s ETW RequestThreadProcStart / RequestThreadProcStop events with request context (project path + request/config identifiers) so traces can be correlated back to the originating build request. It also adds a unit test validating the new event payload shape.

Changes:

  • Extend MSBuildEventSource RequestThreadProcStart/Stop (EventIds 37/38) to include request context payloads (versioned to Version = 1).
  • Emit the enriched ETW events from RequestBuilder.RequestThreadProc.
  • Add a unit test asserting the new ETW payload names and values.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/Framework/MSBuildEventSource.cs Adds v1 ETW payloads to RequestThreadProc start/stop events.
src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs Populates and emits request context fields into the ETW start/stop events.
src/Build.UnitTests/BackEnd/RequestBuilder_Tests.cs Adds a unit test validating the enriched start/stop ETW payload.

Comment thread src/Build/BackEnd/Components/RequestBuilder/RequestBuilder.cs Outdated
Comment thread src/Build.UnitTests/BackEnd/RequestBuilder_Tests.cs
vitek-karas and others added 2 commits June 8, 2026 11:25
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AR-May

AR-May commented Jun 10, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

Comment thread src/Framework/MSBuildEventSource.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@AlesProkop

Copy link
Copy Markdown
Member

@AR-May Should we merge this?

@AlesProkop
AlesProkop merged commit 5adc783 into dotnet:main Jun 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants