diff --git a/docs/core/diagnostics/dotnet-trace.md b/docs/core/diagnostics/dotnet-trace.md index 2f5a53de22f71..7c6e9be38f960 100644 --- a/docs/core/diagnostics/dotnet-trace.md +++ b/docs/core/diagnostics/dotnet-trace.md @@ -233,6 +233,9 @@ dotnet-trace collect |--------------|----------------------------------------------------------| | `dotnet-common` | Lightweight .NET runtime diagnostics designed to stay low overhead.
Includes GC, AssemblyLoader, Loader, JIT, Exceptions, Threading, JittedMethodILToNativeMap, and Compilation events
Equivalent to `--providers "Microsoft-Windows-DotNETRuntime:0x100003801D:4"`. | | `dotnet-sampled-thread-time` | Samples .NET thread stacks (~100 Hz) to identify hotspots over time. Uses the runtime sample profiler with managed stacks. | + + > [!TIP] + > The sampling rate used by `dotnet-sampled-thread-time` can be changed with the `DOTNET_EventPipeThreadSamplingRate` environment variable (value in milliseconds). This setting is process-global and affects all EventPipe sessions. See [Trace using environment variables](./eventpipe.md#trace-using-environment-variables) for details. | `gc-verbose` | Tracks GC collections and samples object allocations. | | `gc-collect` | Tracks GC collections only at very low overhead. | | `database` | Captures ADO.NET and Entity Framework database commands. | diff --git a/docs/core/diagnostics/eventpipe.md b/docs/core/diagnostics/eventpipe.md index 2c43045032866..960263ec36449 100644 --- a/docs/core/diagnostics/eventpipe.md +++ b/docs/core/diagnostics/eventpipe.md @@ -84,6 +84,8 @@ However, you can use the following environment variables to set up an EventPipe * `DOTNET_EventPipeProcNumbers`: Set this to `1` to enable capturing processor numbers in EventPipe event headers. The default value is `0`. +* `DOTNET_EventPipeThreadSamplingRate`: Available in .NET 11+. Sets the interval, in milliseconds, for the EventPipe thread time sampling profiler. When set to `0` or omitted, the runtime uses its built-in default of 10 ms (~100 Hz). This setting is process-global and affects all EventPipe sessions, including on-demand traces started by tools such as [dotnet-trace](./dotnet-trace.md). Setting a large value reduces sampling overhead but also reduces the resolution of any trace collected during the process lifetime. + * `DOTNET_EventPipeConfig`: Sets up the EventPipe session configuration when starting an EventPipe session with `DOTNET_EnableEventPipe`. The syntax is as follows: diff --git a/docs/core/runtime-config/debugging-profiling.md b/docs/core/runtime-config/debugging-profiling.md index 8cf36fbd94f48..bdd35a89ce9b5 100644 --- a/docs/core/runtime-config/debugging-profiling.md +++ b/docs/core/runtime-config/debugging-profiling.md @@ -81,6 +81,8 @@ The following table compares perf maps and jit maps. | **runtimeconfig.json** | N/A | N/A | | **Environment variable** | `DOTNET_PerfMapEnabled` | `0` - disabled
`1` - perf maps and jit dumps both enabled
`2` - jit dumps enabled
`3` - perf maps enabled | +For EventPipe-related environment variables, see [Trace using environment variables](../diagnostics/eventpipe.md#trace-using-environment-variables). + ## Perf log markers - Enables or disables the specified signal to be accepted and ignored as a marker in the perf logs.