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
Copy file name to clipboardExpand all lines: documentation/design-docs/ipc-protocol.md
+36-63
Original file line number
Diff line number
Diff line change
@@ -336,58 +336,6 @@ For example, the Command to start a stream session with EventPipe would be `0x02
336
336
337
337
## EventPipe Commands
338
338
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
-
391
339
### EventPipe Command IDs
392
340
```c++
393
341
enumclassEventPipeCommandId : uint8_t
@@ -708,41 +656,66 @@ Followed by an Optional Continuation of a `nettrace` format stream of events.
708
656
709
657
Command Code: `0x0206`
710
658
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.
*`uint circularBufferMB`: The size of the circular buffer used for buffering event data
722
670
*`uint format`: 0 for the legacy NetPerf format and 1 for the NetTrace V4 format
723
671
*`ulong rundownKeyword`: Indicates the keyword for the rundown provider
724
672
*`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
726
674
727
-
The Streaming Session `provider_config` is composed of the following data:
675
+
The `streaming_provider_config` is composed of the following data:
728
676
*`ulong keywords`: The keywords to turn on with this provider
729
677
*`uint logLevel`: The level of information to turn on
730
678
*`string provider_name`: The name of the provider
731
679
*`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)
*`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
738
692
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:
740
694
*`ulong keywords`: The keywords to turn on with this provider
741
695
*`uint logLevel`: The level of information to turn on
742
696
*`string provider_name`: The name of the provider
743
697
*`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)
746
719
747
720
> See ETW documentation for a more detailed explanation of Keywords, Filters, and Log Level.
748
721
@@ -871,7 +844,7 @@ allow=1, event_ids=[1, 2, 3]: Allow only Event IDs 1, 2, and 3.
871
844
### Tracepoint_config
872
845
Example `tracepoint_config` serialization
873
846
```
874
-
Output_format=0, DO NOT encode bytes for tracepoint_config
847
+
Output_format=0, Streaming Sessions DO NOT encode bytes for tracepoint_config
875
848
Output_format=1, encode bytes for tracepoint_config
0 commit comments