Skip to content

Commit efe387a

Browse files
committed
Confine CollectTracing5 details to its section
1 parent 8b5bf46 commit efe387a

File tree

1 file changed

+36
-63
lines changed

1 file changed

+36
-63
lines changed

documentation/design-docs/ipc-protocol.md

+36-63
Original file line numberDiff line numberDiff line change
@@ -336,58 +336,6 @@ For example, the Command to start a stream session with EventPipe would be `0x02
336336

337337
## EventPipe Commands
338338

339-
The EventPipe CommandSet enables Clients to create/start or stop [EventPipe](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe) Sessions. Two session types are currently supported through this protocol.
340-
341-
### Streaming Session
342-
343-
The latest CommandID [`CollectTracing5`](#collecttracing5) supports configuring the following streaming EventPipe session options:
344-
* `uint circularBufferMB`: The size of the circular buffer used for buffering event data
345-
* `uint format`: 0 for the legacy NetPerf format and 1 for the NetTrace V4 format
346-
* `ulong rundownKeyword`: Indicates the keyword for the rundown provider
347-
* `bool requestStackwalk`: Indicates whether stacktrace information should be recorded.
348-
* `array<provider_config> providers`: The providers to turn on for the session
349-
350-
### User_events Session
351-
352-
The latest CommandID [`CollectTracing5`](#collecttracing5) supports configuring the following user_events EventPipe session options:
353-
354-
Payload:
355-
* `ulong rundownKeyword`: Indicates the keyword for the rundown provider
356-
* `array<provider_config> providers`: The providers to turn on for the session
357-
358-
### Session Providers
359-
360-
The `provider_config` is composed of the following data:
361-
* `ulong keywords`: The keywords to turn on with this provider
362-
* `uint logLevel`: The level of information to turn on
363-
* `string provider_name`: The name of the provider
364-
* `string filter_data`: (Callback filter information) or (length = `0`)
365-
* `event_filter filter`: Rules for filtering this provider's Event IDs, applied after `keyword`/`logLevel`, using an allow/deny list or (length = `0`). See [details](#event-filter).
366-
367-
For user_events EventPipe Session Providers, another `provider_config` field is configurable:
368-
* `tracepoint_config config`: Maps Event IDs to tracepoints. If an Event ID is excluded by `event_filter`, it will not be written to any tracepoint. See [details](#tracepoint-config)
369-
370-
#### Event Filter
371-
An `event_filter` is comprised of the following data:
372-
* `bool allow`: 0 for deny list, 1 for allow list
373-
* `array<uint> event_ids`: List of Event IDs to deny or allow.
374-
375-
See [event_filter serialization examples](#event_filter)
376-
377-
#### Tracepoint Config
378-
A `tracepoint_config` is comprised of the following data:
379-
* `string default_tracepoint_name`: (The default tracepoint filtered Event IDs will be written to unless otherwise specified by `tracepoints`) or (length = `0` to only write to tracepoints specified in `tracepoints`)
380-
* `array<tracepoint_set> tracepoints`: Specifies alternate tracepoints for a set of Event IDs to be written to instead of the default tracepoint or (length = `0`).
381-
382-
A `tracepoint_set` is comprised of the following data:
383-
* `string tracepoint_name`: The tracepoint that the following subset of Event IDs should be written to.
384-
* `array<uint> event_ids`: The Event IDs to be written to `tracepoint_name`.
385-
386-
With a user_events session, atleast one of `default_tracepoint_name` and `tracepoints` must be specified. An error will be returned through the stream if both are length = `0`.
387-
Event IDs specified in `tracepoint_set`s must be exclusive. If an Event ID is detected in different `tracepoint_set`s of the provider, an error will be returned through the stream.
388-
389-
See [tracepoint_config serialization examples](#tracepoint_config)
390-
391339
### EventPipe Command IDs
392340
```c++
393341
enum class EventPipeCommandId : uint8_t
@@ -708,41 +656,66 @@ Followed by an Optional Continuation of a `nettrace` format stream of events.
708656

709657
Command Code: `0x0206`
710658

711-
The `CollectTracing5` command is an extension of the `CollectTracing4` command. It has all the capabilities of `CollectTracing4` and introduces new fields to enable a Linux-only user_events-based eventpipe session and to prescribe an allow/deny list for Event IDs. When the user_events-based eventpipe session is enabled, the file descriptor and SCM_RIGHTS of the `user_events_data` file must be sent through the optional continuation stream as [described](#passing_file_descriptor). The runtime will register tracepoints based on the provider configurations passed in, and runtime events will be written directly to the `user_events_data` file descriptor. The allow/deny list of Event IDs will apply after the keyword/level filter to determine whether or not that provider's event will be written. When using this command, even without leveraging the new user_events-based eventpipe session option, the new fields must be serialized.
659+
The `CollectTracing5` command is an extension of the `CollectTracing4` command. It has all the capabilities of `CollectTracing4` and introduces new fields to enable a Linux-only user_events-based eventpipe session and to prescribe an allow/deny list for Event IDs. When the user_events-based eventpipe session is enabled, the file descriptor and SCM_RIGHTS of the `user_events_data` file must be sent through the optional continuation stream as [described](#passing_file_descriptor). The runtime will register tracepoints based on the provider configurations passed in, and runtime events will be written directly to the `user_events_data` file descriptor. The allow/deny list of Event IDs will apply after the keyword/level filter to determine whether or not that provider's event will be written.
712660

713661
> Note available for .NET 10.0 and later.
714662
715663
#### Inputs:
716664

717665
Header: `{ Magic; 20 + Payload Size; 0x0206; 0x0000 }`
718666

719-
#### [Streaming Session](#streaming-session) Payload:
667+
#### Streaming Session Payload:
720668
* `uint output_format`: 0
721669
* `uint circularBufferMB`: The size of the circular buffer used for buffering event data
722670
* `uint format`: 0 for the legacy NetPerf format and 1 for the NetTrace V4 format
723671
* `ulong rundownKeyword`: Indicates the keyword for the rundown provider
724672
* `bool requestStackwalk`: Indicates whether stacktrace information should be recorded.
725-
* `array<provider_config> providers`: The providers to turn on for the session
673+
* `array<streaming_provider_config> providers`: The providers to turn on for the session
726674

727-
The Streaming Session `provider_config` is composed of the following data:
675+
The `streaming_provider_config` is composed of the following data:
728676
* `ulong keywords`: The keywords to turn on with this provider
729677
* `uint logLevel`: The level of information to turn on
730678
* `string provider_name`: The name of the provider
731679
* `string filter_data`: (Callback filter information) or (length = `0`)
732-
* `event_filter filter`: Rules for filtering this provider's Event IDs, applied after `keyword`/`logLevel`, using an allow/deny list or (length = `0`). See [details](#event-filter).
680+
* `event_filter filter`: Rules for filtering this provider's Event IDs, applied after `keyword`/`logLevel`, using an allow/deny list or (length = `0`).
681+
682+
An `event_filter` is comprised of the following data:
683+
* `bool allow`: 0 for deny list, 1 for allow list
684+
* `array<uint> event_ids`: List of Event IDs to deny or allow.
685+
686+
See [event_filter serialization examples](#event_filter)
733687

734-
#### [User_events Session](#user_events-session) Payload:
688+
#### User_events Session Payload:
735689
* `uint output_format`: 1
736690
* `ulong rundownKeyword`: Indicates the keyword for the rundown provider
737-
* `array<provider_config> providers`: The providers to turn on for the session
691+
* `array<user_events_provider_config> providers`: The providers to turn on for the session
738692

739-
The User_events Session `provider_config` is composed of the following data:
693+
The `user_events_provider_config` is composed of the following data:
740694
* `ulong keywords`: The keywords to turn on with this provider
741695
* `uint logLevel`: The level of information to turn on
742696
* `string provider_name`: The name of the provider
743697
* `string filter_data`: (Callback filter information) or (length = `0`)
744-
* `event_filter filter`: Rules for filtering this provider's Event IDs, applied after `keyword`/`logLevel`, using an allow/deny list or (length = `0`). See [details](#event-filter).
745-
* `tracepoint_config config`: Maps Event IDs to tracepoints. If an Event ID is excluded by `event_filter`, it will not be written to any tracepoint. See [details](#tracepoint-config)
698+
* `event_filter filter`: Rules for filtering this provider's Event IDs, applied after `keyword`/`logLevel`, using an allow/deny list or (length = `0`).
699+
* `tracepoint_config config`: Maps Event IDs to tracepoints. If an Event ID is excluded by `event_filter`, it will not be written to any tracepoint.
700+
701+
An `event_filter` is comprised of the following data:
702+
* `bool allow`: 0 for deny list, 1 for allow list
703+
* `array<uint> event_ids`: List of Event IDs to deny or allow.
704+
705+
See [event_filter serialization examples](#event_filter)
706+
707+
A `tracepoint_config` is comprised of the following data:
708+
* `string default_tracepoint_name`: (The default tracepoint filtered Event IDs will be written to unless otherwise specified by `tracepoints`) or (length = `0` to only write to tracepoints specified in `tracepoints`)
709+
* `array<tracepoint_set> tracepoints`: Specifies alternate tracepoints for a set of Event IDs to be written to instead of the default tracepoint or (length = `0`).
710+
711+
A `tracepoint_set` is comprised of the following data:
712+
* `string tracepoint_name`: The tracepoint that the following subset of Event IDs should be written to.
713+
* `array<uint> event_ids`: The Event IDs to be written to `tracepoint_name`.
714+
715+
With a user_events session, atleast one of `default_tracepoint_name` and `tracepoints` must be specified. An error will be returned through the stream if both are length = `0`.
716+
Event IDs specified in `tracepoint_set`s must be exclusive. If an Event ID is detected in different `tracepoint_set`s of the provider, an error will be returned through the stream.
717+
718+
See [tracepoint_config serialization examples](#tracepoint_config)
746719

747720
> See ETW documentation for a more detailed explanation of Keywords, Filters, and Log Level.
748721
@@ -871,7 +844,7 @@ allow=1, event_ids=[1, 2, 3]: Allow only Event IDs 1, 2, and 3.
871844
### Tracepoint_config
872845
Example `tracepoint_config` serialization
873846
```
874-
Output_format=0, DO NOT encode bytes for tracepoint_config
847+
Output_format=0, Streaming Sessions DO NOT encode bytes for tracepoint_config
875848
Output_format=1, encode bytes for tracepoint_config
876849
```
877850

0 commit comments

Comments
 (0)