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
> - When specifying a stopping event through the `--stopping-event-*` options, as the EventStream is being parsed asynchronously, there will be some events that pass through between the time a trace event matching the specified stopping event options is parsed and the EventPipeSession is stopped.
267
268
269
+
## dotnet-trace collect-linux
270
+
271
+
Collects diagnostic traces from .NET applications using Linux user_events as a transport layer. This command provides the same functionality as [`dotnet-trace collect`](#dotnet-trace-collect) but routes .NET runtime events through the Linux kernel's user_events subsystem before writing them to `.nettrace` files.
272
+
273
+
This transport approach enables automatic unification of user-space .NET events with kernel-space system events, since both are captured in the same kernel tracing infrastructure. Linux tools like `perf` and `ftrace` can monitor events in real-time while maintaining full compatibility with existing .NET profiling workflows.
274
+
275
+
### Prerequisites
276
+
277
+
- Linux kernel with `CONFIG_USER_EVENTS=y` support (kernel 6.4+)
278
+
- Appropriate permissions to access `/sys/kernel/tracing/user_events_data`
279
+
- .NET 10+
280
+
281
+
### Synopsis
282
+
283
+
```dotnetcli
284
+
dotnet-trace collect-linux
285
+
[--buffersize <size>]
286
+
[--clreventlevel <clreventlevel>]
287
+
[--clrevents <clrevents>]
288
+
[--format <Chromium|NetTrace|Speedscope>]
289
+
[-h|--help]
290
+
[--duration dd:hh:mm:ss]
291
+
[-n, --name <name>]
292
+
[--diagnostic-port]
293
+
[-o|--output <trace-file-path>]
294
+
[-p|--process-id <pid>]
295
+
[--profile <profile-name>]
296
+
[--providers <list-of-comma-separated-providers>]
297
+
[-- <command>] (for target applications running .NET 10 or later)
`dotnet-trace collect-linux` supports all the same options as [`dotnet-trace collect`](#dotnet-trace-collect), excluding `--dsrouter`, and additionally offers:
Defines the explicit mapping between EventPipe providers and kernel tracepoints. Each provider in `--providers` must have a corresponding entry in `--tracepoint-configs`
-`EventIds`: Plus-delimited event IDs to route to that tracepoint
322
+
323
+
> [!NOTE]
324
+
> All tracepoint names are automatically prefixed with the provider name to avoid collisions. For example, `gc_events` for the `Microsoft-Windows-DotNETRuntime` provider becomes `Microsoft_Windows_DotNETRuntime_gc_events`.
325
+
326
+
**Examples:**
327
+
```
328
+
# Scenario: All events from provider go to a default tracepoint
A comma-separated list of kernel event categories to include in the trace. These events are automatically grouped into kernel-named tracepoints. Available categories include:
346
+
347
+
| Category | Description | Linux Tracepoints |
348
+
|----------|-------------|-------------------|
349
+
|`syscalls`| System call entry/exit events |`syscalls:sys_enter_*`, `syscalls:sys_exit_*`|
350
+
|`sched`| Process scheduling events |`sched:sched_switch`, `sched:sched_wakeup`|
These events correspond to Linux kernel tracepoints documented in the [Linux kernel tracing documentation](https://www.kernel.org/doc/html/latest/trace/index.html). For more details on available tracepoints, see [ftrace](https://www.kernel.org/doc/html/latest/trace/ftrace.html) and [tracepoints](https://www.kernel.org/doc/html/latest/trace/tracepoints.html).
356
+
357
+
Example: `--kernel-events syscalls,sched,net`
358
+
359
+
### Linux Integration
360
+
361
+
**Tracepoint Configuration Requirements:**
362
+
363
+
-**Mandatory Mapping**: Every provider must be explicitly mapped to at least a default tracepoint and/or exclusive tracepoint sets via `--tracepoint-configs`
364
+
-**Tracepoint Isolation**: Each tracepoint can only receive events from one provider
365
+
-**Event Routing**: Different event IDs within a provider can be routed to different tracepoints for granular control
366
+
-**Automatic Prefixing**: All tracepoint names are prefixed with the provider name to avoid collisions
367
+
368
+
**Kernel Integration Points:**
369
+
370
+
The kernel tracepoints can be accessed through standard Linux tracing interfaces:
0 commit comments