+struct lttng_event_context_comm {
+ uint32_t type;
+ /*
+ * Depending on the type.
+ * For:
+ * - LTTNG_EVENT_CONTEXT_APP_CONTEXT.
+ *
+ * -> struct lttng_event_context_app_comm
+ *
+ * For
+ * - LTTNG_EVENT_CONTEXT_PERF_COUNTER,
+ * - LTTNG_EVENT_CONTEXT_PERF_CPU_COUNTER,
+ * - LTTNG_EVENT_CONTEXT_PERF_THREAD_COUNTER.
+ *
+ * -> struct lttng_event_context_perf_counter_comm
+ *
+ * Other type -> no payload.
+ */
+ char payload[];
+} LTTNG_PACKED;
+
+struct lttng_event_context_perf_counter_comm {
+ uint32_t type;
+ uint64_t config;
+ /* Includes terminator `\0`. */
+ uint32_t name_len;
+ /*
+ * char name [name_len]
+ */
+ char payload[];
+} LTTNG_PACKED;
+
+struct lttng_event_context_app_comm {
+ /* Includes terminator `\0`. */
+ uint32_t provider_name_len;
+ /* Includes terminator `\0`. */
+ uint32_t ctx_name_len;
+ /*
+ * provider name [provider_name_len]
+ * ctx name [ctx_name_len]
+ */
+ char payload[];
+} LTTNG_PACKED;
+
+struct lttng_event_field_comm {
+ uint8_t type;
+ uint8_t nowrite;
+ /* Includes terminator `\0`. */
+ uint32_t name_len;
+ uint32_t event_len;
+
+ /*
+ * - name [name_len]
+ * - lttng_event object
+ */
+ char payload[];
+} LTTNG_PACKED;
+