Skip to content

Commit ea3d499

Browse files
committed
Add probe option
1 parent e865aab commit ea3d499

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/core/diagnostics/dotnet-trace.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ dotnet-trace collect-linux
334334
# .NET Process Target (Optional)
335335
[-n, --name <name>]
336336
[-p|--process-id <pid>]
337+
338+
# Probe mode
339+
[--probe]
337340
```
338341

339342
### Default collection behavior
@@ -467,6 +470,14 @@ See [Default collection behavior](#default-collection-behavior)
467470

468471
The process ID to collect the trace from.
469472

473+
#### Probe mode options
474+
475+
- **`--probe [-n|--name] [-p|--process-id] [-o|--output <stdout|output-filename>]`**
476+
477+
Probe .NET processes for support of the EventPipe UserEvents IPC command used by collect-linux, without collecting a trace. Results list supported processes first. Use '-o stdout' to print CSV (pid,processName,supportsCollectLinux) to the console, or '-o <file>' to write the CSV. Probe a single process with -n|--name or -p|--process-id.
478+
479+
As running `collect-linux` in probe mode does not collect a trace, it does not require root permissions to run. It does not provide validation of the [prerequisites](#Prerequisites), and .NET processes running on preview versions of .NET Runtime '10.0.0' are considered unsupported.
480+
470481
> [!NOTE]
471482
472483
> To collect a trace using `dotnet-trace collect-linux`, it needs to be run with root permissions (`CAP_PERFMON`/`CAP_SYS_ADMIN`). Otherwise, the tool will fail to collect events.
@@ -717,6 +728,24 @@ This example captures CPU samples for all processes on the machine. Any processe
717728
Trace written to <path-to-nettrace>trace_20251008_181939.nettrace
718729
```
719730
731+
For environments with multiple .NET versions installed, running `collect-linux` in [probe mode](#probe-mode-options) helps discern whether a .NET process is capable of being traced with collect-linux.
732+
733+
```output
734+
$ dotnet-trace collect-linux --probe
735+
==========================================================================================
736+
The collect-linux verb is a new preview feature and relies on an updated version of the
737+
.nettrace file format. The latest PerfView release supports these trace files but other
738+
ways of using the trace file may not work yet. For more details, see the docs at
739+
https://learn.microsoft.com/dotnet/core/diagnostics/dotnet-trace.
740+
==========================================================================================
741+
Probing .NET processes for support of the EventPipe UserEvents IPC command used by collect-linux. Requires runtime '10.0.0' or later.
742+
.NET processes that support the command:
743+
3802935 MyApp
744+
745+
.NET processes that do NOT support the command:
746+
3809123 dotnet - Detected runtime: '10.0.0-rc.1.25451.107'
747+
```
748+
720749
## View the trace captured from dotnet-trace
721750

722751
On Windows, you can view *.nettrace* files in [Visual Studio](/visualstudio/profiling/beginners-guide-to-performance-profiling?#step-2-analyze-cpu-usage-data) or [PerfView](https://github.com/microsoft/perfview) for analysis.

0 commit comments

Comments
 (0)