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
+33
Original file line number
Diff line number
Diff line change
@@ -1013,6 +1013,39 @@ struct cmsghdr {
1013
1013
1014
1014
For parsing the file descriptor passed with SCM_RIGHTS, the runtime will `recvmsg` the message and only care about the control message containing ancillary data. It will read one byte from the `msg_iov` buffer just to receive the ancillary data, but it will disregard the contents of the `msg_iov` buffers.
1015
1015
1016
+
### User_events format
1017
+
1018
+
When writing events to their mapped user_events tracepoints prescribed by the `tracepoint_config` in the [User_events session payload](#user_events-session-payload), the runtime will adapt the [user_events writing protocol](https://docs.kernel.org/trace/user_events.html#writing-data) to write the event as:
1019
+
1020
+
```
1021
+
struct iovec io[5];
1022
+
1023
+
io[0].iov_base = &myTracepointIndex; // __u32 from event_reg
1024
+
io[0].iov_len = sizeof(myTracepointIndex);
1025
+
io[1].iov_base = &event_id // EventID defined by EventSource/native manifest
The `__rel_loc` is the relative dynamic array attribute described [here](https://lwn.net/Articles/876682/).
1038
+
1039
+
The payload points at a blob of data with the same format as an EventPipe payload – the concatenated encoded values for all the parameters
1040
+
1041
+
The metadata either points at nothing if the event doesn’t have metadata, or it points at a metadata blob matching the NetTrace version 5 formatting convention. Specifically it is the data that would be stored inside the PayloadBytes area of an event blob within a MetadataBlock described [here](https://github.com/microsoft/perfview/blob/main/src/TraceEvent/EventPipe/NetTraceFormat_v5.md#metadata-event-encoding).
1042
+
1043
+
> NOTE: V5 and V6 metadata formats have the same info, but they aren’t formatted identically. Parsing and reserialization is required to convert between the two.
1044
+
1045
+
### Which events have metadata?
1046
+
1047
+
The runtime will keep track per-session whether it has sent a particular event before. The first time each event is sent during a session, metadata will be included, and otherwise, it will be left empty. As a special case, runtime events currently implemented in native code will never send metadata.
0 commit comments