Skip to content

Add a regression test to validate sample profiling events#124410

Open
noahfalk wants to merge 1 commit intodotnet:mainfrom
noahfalk:eventpipe_sampleprofiler_regression
Open

Add a regression test to validate sample profiling events#124410
noahfalk wants to merge 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

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.

1 participant