+#include "ust-dynamic-type.h"
+
+/*
+ * Context value
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Additional selectors may be added in the future, mapping to new
+ * union fields, which means the overall size of this structure may
+ * increase. This means this structure should never be nested within a
+ * public structure interface, nor embedded in an array.
+ */
+
+struct lttng_ust_ctx_value {
+ enum lttng_ust_dynamic_type sel; /* Type selector */
+ union {
+ int64_t s64;
+ uint64_t u64;
+ const char *str;
+ double d;
+ } u;
+};
+
+/*
+ * Context field
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+
+struct lttng_ust_ctx_field {
+ uint32_t struct_size;
+ void *priv;
+
+ struct lttng_ust_event_field *event_field;
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset);
+ void (*record)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_lib_ring_buffer_ctx *ctx,
+ struct lttng_ust_channel_buffer *chan);
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value);
+ void (*destroy)(struct lttng_ust_ctx_field *field);
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
+};
+
+/*
+ * All context fields for a given event/channel
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+
+struct lttng_ust_ctx {
+ uint32_t struct_size;
+
+ struct lttng_ust_ctx_field **fields;
+ unsigned int nr_fields;
+ unsigned int allocated_fields;
+ unsigned int largest_align;
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
+};
+
+/*
+ * Context provider
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+