Add a regression test to validate sample profiling events#124410
Open
noahfalk wants to merge 1 commit intodotnet:mainfrom
Open
Add a regression test to validate sample profiling events#124410noahfalk wants to merge 1 commit intodotnet:mainfrom
noahfalk wants to merge 1 commit intodotnet:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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 |
This was referenced Feb 14, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up on #124019