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
[-- <command>] (for target applications running .NET 5 or later)
92
92
[--show-child-io]
@@ -211,21 +211,24 @@ dotnet-trace collect
211
211
> [!NOTE]
212
212
> On Linux and macOS, using this option requires the target application and `dotnet-trace` to share the same `TMPDIR` environment variable. Otherwise, the command will time out.
A named pre-defined set of provider configurations that allows common tracing scenarios to be specified succinctly. The following profiles are available:
216
+
A comma-separated list of named, pre-defined set of provider configurations for common tracing scenarios. The union of profiles and providers will be in effect.
217
+
218
+
Default behavior (when `--profiles`, `--providers`, and `--clrevents` are omitted): dotnet-trace enables a useful, low-overhead composition: `dotnet-common` + `dotnet-thread-time`.
219
+
220
+
Available profiles:
217
221
218
222
| Profile | Description |
219
223
|---------|-------------|
220
-
|`dotnet-default`|Combination of `dotnet-thread-time` and `dotnet-clr-default`. This is the default profile used when no other provider/event/profile options are specified.|
221
-
|`dotnet-thread-time`|Useful for tracking .NET thread-time information. This is the default profile used when no other provider/event/profile options are specified.|
222
-
|`dotnet-clr-default`|Useful for tracking a multitude of .NET events.|
224
+
|`dotnet-common`|Lightweight .NET runtime diagnostics (GC, JIT, loader/assembly loader, threading, contention). Designed to stay low overhead.|
225
+
|`dotnet-thread-time`|Samples .NET thread stacks (~100 Hz) to identify hotspots over time. Uses the runtime sample profiler with managed stacks.|
223
226
|`gc-verbose`|Tracks GC collections and samples object allocations.|
224
227
|`gc-collect`|Tracks GC collections only at very low overhead.|
A comma-separated list of `EventPipe` providers to be enabled. These providers supplement any providers implied by `--profile <profile-name>`. If there's any inconsistency for a particular provider, this configuration takes precedence over the implicit configuration from the profile.
231
+
A comma-separated list of `EventPipe` providers to be enabled. These providers supplement any providers implied by `--profiles <list-of-comma-separated-profile-names>`. If there's any inconsistency for a particular provider, this configuration takes precedence over the implicit configuration from the profiles.
229
232
230
233
This list of providers is in the form:
231
234
@@ -278,6 +281,19 @@ Collects diagnostic traces using perf_events, a Linux OS technology. `collect-li
278
281
279
282
This Linux-only command includes the same .NET events as [`dotnet-trace collect`](#dotnet-trace-collect), and it uses the kernel’s user_events mechanism to emit .NET events as perf events, enabling unification of user-space .NET events with kernel-space system events.
280
283
284
+
### Default collection behavior
285
+
286
+
When `--profiles`, `--clrevents`, and `--providers` aren’t specified, `collect-linux` enables the default `profile` providing the comprehensive composition:
-`kernel-cpu` — kernel CPU sampling (perf-based) via `Universal.Events/cpu`.
291
+
-`kernel-cswitch` — kernel context switches via `Universal.Events/cswitch` for on/off-CPU analysis.
292
+
293
+
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`. `dotnet-trace` will need to share the same `TMPDIR` value as .NET Processes of interest, otherwise events will not be collected from those processes.
294
+
295
+
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. **NOTE**: Should the target application have a `TMPDIR` enviornment variable set, `dotnet-trace` will need to share the same `TMPDIR` value, otherwise events will not be collected from the target application.
296
+
281
297
### Prerequisites
282
298
283
299
- Linux kernel with `CONFIG_USER_EVENTS=y` support (kernel 6.4+)
A comma-separated list of `EventPipe` providers to be enabled. These providers supplement any providers implied by `--profile <profile-name>`. If there's any inconsistency for a particular provider, this configuration takes precedence over the implicit configuration from the profile.
334
+
A comma-separated list of `EventPipe` providers to be enabled. These providers supplement any providers implied by `--profiles <list-of-comma-separated-profile-names>`. If there's any inconsistency for a particular provider, this configuration takes precedence over the implicit configuration from the specified profiles.
A named, pre-defined set of provider configurations for common tracing scenarios. You can specify multiple profiles as a comma-separated list. When multiple profiles are specified, the providers and settings are combined (union), and duplicates are ignored.
397
415
398
-
A named pre-defined set of provider configurations that allows common tracing scenarios to be specified succinctly. The following profiles are available:
416
+
Available profiles:
399
417
400
418
| Profile | Description |
401
419
|---------|-------------|
402
-
|`dotnet-default`|Combination of `dotnet-thread-time` and `dotnet-clr-default`. This is the default profile used when no other provider/event/profile options are specified.|
403
-
|`dotnet-thread-time`|Useful for tracking .NET thread-time information. This is the default profile used when no other provider/event/profile options are specified.|
404
-
|`dotnet-clr-default`|Useful for tracking a multitude of .NET events.|
420
+
|`dotnet-common`|Lightweight .NET runtime diagnostics (GC, JIT, loader/assembly loader, threading, contention). Designed to stay low overhead.|
421
+
|`dotnet-thread-time`|Samples .NET thread stacks (~100 Hz) to identify hotspots over time. Uses the runtime sample profiler with managed stacks.|
422
+
|`kernel-cpu`|Kernel CPU sampling (perf-based), emitted as `Universal.Events/cpu`, for precise on-CPU attribution.|
423
+
|`kernel-cswitch`|Kernel thread context switches, emitted as `Universal.Events/cswitch`, for on/off-CPU and scheduler analysis.|
424
+
|`kernel-precise-thread-time`|Combines `kernel-cpu` + `kernel-cswitch` for a precise thread-time view using kernel events only.|
405
425
|`gc-verbose`|Tracks GC collections and samples object allocations.|
406
426
|`gc-collect`|Tracks GC collections only at very low overhead.|
407
-
|`cpu-sampling`|Useful for tracking CPU usage.|
427
+
428
+
> [!NOTE]
429
+
> The former default `cpu-sampling` profile is now named as `dotnet-thread-time`.
408
430
409
431
#### Trace Collection Options
410
432
@@ -422,22 +444,21 @@ dotnet-trace collect-linux
422
444
423
445
#### .NET Process Target Options
424
446
425
-
> ![NOTE]
426
-
> The default behavior for collect-linux is to collect .NET events and perf event tracepoints from ALL discoverable processes.
447
+
See [Default collection behavior](#default-collection-behavior)
427
448
428
449
-**`-n, --name <name>`**
429
450
430
451
The name of the process to collect the trace from.
431
452
432
453
> [!NOTE]
433
-
> By default, `/tmp` will be searched to discover .NET processes diagnostics ports. Should the target application have a `TMPDIR` enviornment variable set, `dotnet-trace` will need to share the same `TMPDIR` value, otherwise events will not be collected from the target application.
454
+
> Should the target application have a `TMPDIR` enviornment variable set, `dotnet-trace` will need to share the same `TMPDIR` value, otherwise events will not be collected from the target application.
434
455
435
456
-**`-p|--process-id <PID>`**
436
457
437
458
The process ID to collect the trace from.
438
459
439
460
> [!NOTE]
440
-
> By default, `/tmp` will be searched to discover .NET processes diagnostics ports. Should the target application have a `TMPDIR` enviornment variable set, `dotnet-trace` will need to share the same `TMPDIR` value, otherwise events will not be collected from the target application.
461
+
> Should the target application have a `TMPDIR` enviornment variable set, `dotnet-trace` will need to share the same `TMPDIR` value, otherwise events will not be collected from the target application.
0 commit comments