You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`cpu-sampling` — kernel CPU sampling (perf-based) via `Universal.Events/cpu`.
298
298
299
-
A machine-wide trace will be collected. .NET Processes are discovered through their diagnostics ports, which are located under the `TMPDIR` environment variable when set and otherwise under `/tmp`.
299
+
By default, a machine-wide trace will be collected. .NET Processes are discovered through their diagnostics ports, which are located under the `TMPDIR` environment variable when set and otherwise under `/tmp`.
300
+
301
+
If collecting events from all .NET Processes is undesired, `-n, --name <name>` or `-p|--process-id <PID>` can be used to specify a particular process.
300
302
301
303
### Prerequisites
302
304
@@ -320,6 +322,10 @@ dotnet-trace collect-linux
320
322
# Trace Collection
321
323
[-o|--output <trace-file-path>]
322
324
[--duration dd:hh:mm:ss]
325
+
326
+
# .NET Process Target (Optional)
327
+
[-n, --name <name>]
328
+
[-p|--process-id <pid>]
323
329
```
324
330
325
331
### Options
@@ -433,6 +439,18 @@ dotnet-trace collect-linux
433
439
434
440
The time for the trace to run. Use the `dd:hh:mm:ss` format. For example `00:00:00:05` will run it for 5 seconds.
435
441
442
+
#### .NET Process Target Options
443
+
444
+
See [Default collection behavior](#default-collection-behavior)
445
+
446
+
-**`-n, --name <name>`**
447
+
448
+
The name of the process to collect the trace from.
449
+
450
+
-**`-p|--process-id <PID>`**
451
+
452
+
The process ID to collect the trace from.
453
+
436
454
> [!NOTE]
437
455
438
456
> - 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.
0 commit comments