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
A comma-separated list of named, pre-defined set of provider configurations for common tracing scenarios. Providers configured through `--providers` will override the profile's configuration. Similarly, if any profile configures the CLR runtime provider, it will override any configurations prescribed through `--clrevents`.
225
+
In this context, a profile is a pre-defined set of provider configurations for common tracing scenarios. Multiple profiles can be specified at a time, delimited by commas. Providers configured through `--providers` will override the profile's configuration. Similarly, if any profile configures the CLR runtime provider, it will override any configurations prescribed through `--clrevents`.
217
226
218
-
Default behavior (when `--profile`, `--providers`, and `--clrevents` are omitted): dotnet-trace enables a useful, low-overhead composition: `dotnet-common`+`dotnet-sampled-thread-time`.
227
+
When `--profile`, `--providers`, and `--clrevents` are all omitted, `dotnet-trace collect`enables profiles `dotnet-common`and`dotnet-sampled-thread-time` by default.
219
228
220
229
Available profiles:
221
230
@@ -228,7 +237,7 @@ dotnet-trace collect
228
237
|`database`|Captures ADO.NET and Entity Framework database commands.|
229
238
230
239
> [!NOTE]
231
-
> The former default `cpu-sampling`profile is now `--profile dotnet-sampled-thread-time` + `--providers "Microsoft-Windows-DotNETRuntime:0x14C14FCCBD:4"`.
240
+
> In past versions of the dotnet-trace tool, the collect verb supported a profile called `cpu-sampling`. This profile was removed because the name was misleading. It sampled all threads regardless of their CPU usage. You can achieve a similar result now using `--profile dotnet-sampled-thread-time,dotnet-common`. If you need to match the former `cpu-sampling` behavior exactly use `--profile dotnet-sampled-thread-time --providers "Microsoft-Windows-DotNETRuntime:0x14C14FCCBD:4"`.
-`Provider` is in the form: `KnownProviderName[:Flags[:Level][:KeyValueArgs]]`.
249
+
-`Provider` is in the form: `KnownProviderName[:Flags[:Level[:KeyValueArgs]]]`.
241
250
-`KeyValueArgs` is in the form: `[key1=value1][;key2=value2]`.
242
251
243
252
To learn more about some of the well-known providers in .NET, refer to [Well-known Event Providers](./well-known-event-providers.md).
@@ -282,35 +291,28 @@ dotnet-trace collect
282
291
## dotnet-trace collect-linux
283
292
284
293
> [!NOTE]
285
-
> The collect-linux verb is a new preview feature and relies on an updated version of the .nettrace file format. The latest PerfView release supports these trace files but other ways of using the trace file may not work yet.
294
+
> The collect-linux verb is a new preview feature and relies on an updated version of the .nettrace file format. The latest PerfView release supports these trace files but other ways of using the trace file such as [`convert`](#dotnet-trace-convert) and [`report`](#dotnet-trace-report)may not work yet.
286
295
287
-
> [!NOTE]
288
-
> Currently supported Linux RIDs are linux-x64 and linux-arm64.
289
-
290
-
> [!NOTE]
291
-
> The generated NetTrace is not fully compatible with [`convert`](#dotnet-trace-convert) and [`report`](#dotnet-trace-report).
292
-
293
-
Collects diagnostic traces using perf_events, a Linux OS technology. `collect-linux` requires admin privileges to capture kernel- and user-mode events, and by default, captures events from all processes.
294
-
295
-
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.
296
-
297
-
### Default collection behavior
298
-
299
-
When `--providers`, `--profile`, `--clrevents`, and `--perf-events` aren’t specified, `collect-linux` enables the default `profile` providing the comprehensive composition:
-`cpu-sampling` — kernel CPU sampling (perf-based) via `Universal.Events/cpu`.
296
+
Collects diagnostic traces using perf_events, a Linux OS technology. `collect-linux` enables the following additional features over [`collect`](#dotnet-trace-collect).
303
297
304
-
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`.
305
-
306
-
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.
By default all processes on the machine will be traced. Use `-n, --name <name>` or `-p|--process-id <PID>` to trace only one process.
346
+
336
347
### Options
337
348
338
349
#### Provider/Event Specification Options
@@ -344,7 +355,7 @@ dotnet-trace collect-linux
344
355
This list of providers is in the form:
345
356
346
357
-`Provider[,Provider]`
347
-
-`Provider` is in the form: `KnownProviderName[:Flags[:Level][:KeyValueArgs]]`.
358
+
-`Provider` is in the form: `KnownProviderName[:Flags[:Level[:KeyValueArgs]]]`.
348
359
-`KeyValueArgs` is in the form: `[key1=value1][;key2=value2]`.
349
360
350
361
To learn more about some of the well-known providers in .NET, refer to [Well-known Event Providers](./well-known-event-providers.md).
@@ -413,15 +424,15 @@ dotnet-trace collect-linux
413
424
414
425
-**`--perf-events <list-of-perf-events>`**
415
426
416
-
A comma-separated list of perf events to include in the trace. Available events can be found under tracefs, which is typically mounted at `/sys/kernel/tracing`, through `available_events` for all available events or through the `events/` subdirectory for categorized events.
427
+
A comma-separated list of perf events to include in the trace. Available events can be found under [tracefs](https://lwn.net/Articles/630526/), which is typically mounted at `/sys/kernel/tracing`, through `available_events` for all available events or through the `events/` subdirectory for categorized events.
A comma-separated list of named, pre-defined set of provider configurations for common tracing scenarios. Providers configured through `--providers` will override the profile's configuration. Similarly, if any profile configures the CLR runtime provider, it will override any configurations prescribed through `--clrevents`.
433
+
In this context, a profile is a pre-defined set of provider configurations for common tracing scenarios. Multiple profiles can be specified at a time, delimited by commas. Providers configured through `--providers` will override the profile's configuration. Similarly, if any profile configures the CLR runtime provider, it will override any configurations prescribed through `--clrevents`.
423
434
424
-
Default behavior (when `--profile`, `--providers`, `--clrevents`, and `--perf-events` are omitted): dotnet-trace enables a useful, low-overhead composition: `dotnet-common`+`cpu-sampling`.
435
+
When `--profile`, `--providers`, `--clrevents`, and `--perf-events` are all omitted, `dotnet-trace collect-linux` enables profiles `dotnet-common`and`cpu-sampling` by default.
425
436
426
437
Available profiles:
427
438
@@ -675,9 +686,9 @@ However, when you want to gain a finer control over the lifetime of the app bein
675
686
> [!IMPORTANT]
676
687
> Launching your app with `dotnet run` can be problematic because the dotnet CLI may spawn many child processes that are not your app and they can connect to `dotnet-trace` before your app, leaving your app to be suspended at run time. It is recommended you directly use a self-contained version of the app or use `dotnet exec` to launch the application.
677
688
678
-
## (Linux-only) Collect a trace with Linux perf events using dotnet-trace
689
+
## (Linux-only) Collect a machine-wide trace using dotnet-trace
679
690
680
-
To collect traces using `dotnet-trace collect-linux`:
691
+
This example captures CPU samples for all processes on the machine. Any processes running .NET 10+ will also include some additional lightweight events describing GC, JIT, and Assembly loading behavior.
0 commit comments