Skip to content

[EventPipe] Align EventPipeThreadSamplingRate parsing on CoreCLR and NativeAOT - #135683

Merged
mdh1418 merged 1 commit into
dotnet:mainfrom
mdh1418:mdh1418-eventpipe-environment-parsing
Oct 14, 2026
Merged

mdh1418 merged 1 commit into
dotnet:mainfrom
mdh1418:mdh1418-eventpipe-environment-parsing

Conversation

@mdh1418

@mdh1418 mdh1418 commented Oct 13, 2026

Copy link
Copy Markdown
Member

When EventPipeThreadSamplingRate was added, parsing behavior differed between CoreCLR (hex) and NativeAOT (int).
It'd be less confusing if they were aligned in behavior.

EventPipeCircularMB, although still left as parsing hex, at least matches in behavior on CoreCLR and NativeAOT, and requires no clarification in documentation despite mono parsing as an integer.

Use ParseIntegerAsBase10 for EventPipeThreadSamplingRate to match NativeAOT and Mono. Preserve the zero default and leave EventPipeCircularMB unchanged.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: dd77bf41-5897-406e-ac8a-42315c29c560
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
See info in area-owners.md if you want to be subscribed.

@mdh1418

mdh1418 commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

@mdh1418

mdh1418 commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@mdh1418 an error occurred while backporting to release/10.0. See the workflow output for details.

steveisok pushed a commit that referenced this pull request Oct 19, 2026
…on CoreCLR and NativeAOT (#135777)

Backport of #135683 to release/11.0

/cc @mdh1418

## Customer Impact

- [X] Customer reported
- [X] Found internally

Customer reported that [docs for
DOTNET_EventPipeThreadSamplingRate](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe#trace-using-environment-variables)
did not accurately depict that `DOTNET_EventPipeThreadSamplingRate` was
parsed as a hex value on CoreCLR. Upon investigation, it does not look
intentional, and resulted in differing behaviors between CoreCLR and
NativeAOT. This aligns the experience by parsing the variable as an
integer.

## Regression

- [ ] Yes
- [X] No

## Testing

Tested locally on release/11.0 before and after the change using minimal
CoreCLR builds. Verified the configured sampling interval recorded in
EventPipe trace headers: environment-variable values were interpreted as
hexadecimal before the change and decimal afterward for example, `10`
produced a 16 ms interval before and 10 ms afterward.

## Risk

Low, this only changes how a single EventPipe environment variable is
parsed.

**IMPORTANT**: If this backport is for a servicing release, please
verify that:

- For .NET 8 and .NET 9: The PR target branch is `release/X.0-staging`,
not `release/X.0`.
- For .NET 10+: The PR target branch is `release/X.0` (no `-staging`
suffix).

## Package authoring no longer needed in .NET 9

**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: dd77bf41-5897-406e-ac8a-42315c29c560
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 19, 2026
steveisok added a commit that referenced this pull request Oct 23, 2026
…on CoreCLR and NativeAOT (#135784)

Backport of #135683 to release/10.0

/cc @mdh1418

## Customer Impact

- [X] Customer reported
- [X] Found internally

Customer reported that [docs for
DOTNET_EventPipeThreadSamplingRate](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe#trace-using-environment-variables)
did not accurately depict that `DOTNET_EventPipeThreadSamplingRate` was
parsed as a hex value on CoreCLR. Upon investigation, it does not look
intentional, and resulted in differing behaviors between CoreCLR and
NativeAOT. This aligns the experience by parsing the variable as an
integer.

## Regression

- [ ] Yes
- [X] No

## Testing

Tested locally on release/10.0 before and after the change using minimal
CoreCLR builds. Verified the configured sampling interval recorded in
EventPipe trace headers: environment-variable values were interpreted as
hexadecimal before the change and decimal afterward for example, `10`
produced a 16 ms interval before and 10 ms afterward.

## Risk

Low, this only changes how a single EventPipe environment variable is
parsed.

**IMPORTANT**: If this backport is for a servicing release, please
verify that:

- For .NET 8 and .NET 9: The PR target branch is `release/X.0-staging`,
not `release/X.0`.
- For .NET 10+: The PR target branch is `release/X.0` (no `-staging`
suffix).

## Package authoring no longer needed in .NET 9

**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

Co-authored-by: GitHub Copilot <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
Copilot-Session: dd77bf41-5897-406e-ac8a-42315c29c560
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants