Skip to content

Add a regression test to validate sample profiling events#124410

Merged
noahfalk merged 1 commit intodotnet:mainfrom
noahfalk:eventpipe_sampleprofiler_regression
Mar 4, 2026
Merged

Add a regression test to validate sample profiling events#124410
noahfalk merged 1 commit intodotnet:mainfrom
noahfalk:eventpipe_sampleprofiler_regression

Conversation

@noahfalk
Copy link
Member

Follow up on #124019

Copy link
Contributor

Copilot AI left a comment

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 adds a regression test to validate that the SampleProfiler correctly reports the SampleType field in ThreadSample events. The test ensures that when threads are executing managed code, the SampleType is reported as "Managed" (value 2) rather than incorrectly reporting "External" (value 1), which was a regression introduced in .NET 9.

Changes:

  • Added a new test project SampleProfilerSampleType that validates ThreadSample events report correct SampleType values
  • Test spins doing managed work and verifies at least some samples are marked as Managed type
  • Follows the established pattern for EventPipe validation tests in the repository

Reviewed changes

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

File Description
src/tests/tracing/eventpipe/eventsvalidation/SampleProfilerSampleType.csproj Test project file with standard configuration for tracing tests (GCStressIncompatible, JitOptimizationSensitive)
src/tests/tracing/eventpipe/eventsvalidation/SampleProfilerSampleType.cs Regression test that validates ThreadSample events report SampleType=Managed when executing managed code

@noahfalk
Copy link
Member Author

noahfalk commented Mar 3, 2026

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@noahfalk noahfalk force-pushed the eventpipe_sampleprofiler_regression branch from 52b498f to c09d9d1 Compare March 4, 2026 02:55
@noahfalk noahfalk enabled auto-merge (squash) March 4, 2026 02:56
@noahfalk
Copy link
Member Author

noahfalk commented Mar 4, 2026

/ba-g - This PR already passed CI earlier but everything got reset trying to rebase it at the end. I don't think its meaningful to re-run.

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.

3 participants