-
Notifications
You must be signed in to change notification settings - Fork 376
[IPC Protocol] Add specification to configure a user_events eventpipe session #5454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[IPC Protocol] Add specification to configure a user_events eventpipe session #5454
Conversation
722afa6
to
4094fe9
Compare
* `uint format`: 0 for the legacy NetPerf format and 1 for the NetTrace V4 format | ||
* `ulong rundownKeyword`: Indicates the keyword for the rundown provider | ||
* `bool requestStackwalk`: Indicates whether stacktrace information should be recorded. | ||
* `int output_format`: 0 for streaming, 1 for writing to `user_events` tracepoints specified by `provider_config` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to document the format of the user_event payload as well. Unsure if it should be here directly or a link, but needs to be documented.
Update CommandSets Command IDs Move EventPipe StopTracing to beginning Fix sample payload serialization Clarify Header Size and NetTrace format version Clarify that filter_data can be 0 length to avoid confusion with optional meaning that encoding can be skipped
c30b773
to
8b5bf46
Compare
1ba9499
to
87902f0
Compare
|
||
Once the runtime has received the configured tracepoint names as detailed under [tracepoint_config](#user_events-session-payload), it uses the [file descriptor passed in the continuation stream](#passing_file_descriptor) to register the prescribed tracepoint names following the [user_events registering protocol](https://docs.kernel.org/trace/user_events.html#registering). The runtime will construct a `user_reg` struct for every tracepoint name, defaulting to using none of the `user_reg` flags, so the resulting command format will be as follows: | ||
|
||
`<tracepoint_name> u16 event_id; __rel_loc char[] payload; __rel_loc char[] meta` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should use u8[] vs char[] for payload and meta given the offline conversation we had around implicit string decoding types. That would make it more clear that these payloads are binary vs strings for some decoding tools. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
u8[] makes sense to me
In .NET 10, the EventPipe infrastructure will be leveraged to support user_events.
This PR documents the protocol for enabling a user_events-based EventPipe Session through the Diagnostics IPC protocol, where a new EventPipe Command ID
CollectTracing5
will accept necessary tracepoint configuration.As the user_events EventPipe session is not streaming based, the payload is expected to first encode a
uint output_format
to denote the session format (streaming vs user_events). Afterwards, only relevant session configuration options are to be encoded, outlined at the top of theEventPipe Commands
section in theStreaming Session
section,User_events Session
section, andSession Providers
section.For user_events EventPipe sessions, an additional tracepoint_config is to be encoded, to map Event IDs to tracepoints.
This protocol expects the Client to have access to the
user_events_data
file in order to enable configuring auser_event
EventPipe session, and expects the SCM_RIGHTS to theuser_events_data
file descriptor to be sent in the continuation stream.Additionally, as
user_events
does not support callbacks, a new event_filter config is expected to be encoded inCollectTracing5
, to act as an allow/deny list of Event IDs that will apply post keyword/level filter.