Refactoring: Channel structures
[lttng-ust.git] / include / ust-context-provider.h
index 3b41a66e5322f610dac233565b9a912dab54afec..094e9fd97ed5b359a9e2d41b71e22860be34459f 100644 (file)
  * Context value
  *
  * 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.
+ * 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 {
-       uint32_t struct_size;
-
-       enum lttng_ust_dynamic_type sel;
+       enum lttng_ust_dynamic_type sel;        /* Type selector */
        union {
                int64_t s64;
                uint64_t u64;
                const char *str;
                double d;
        } u;
-
-       /* End of base ABI. Fields below should be used after checking struct_size. */
 };
 
 /*
@@ -63,11 +57,10 @@ struct lttng_ust_ctx_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_channel *chan);
+                      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);
-       char *field_name;       /* Has ownership, dynamically allocated. */
 
        /* End of base ABI. Fields below should be used after checking struct_size. */
 };
@@ -114,7 +107,7 @@ struct lttng_ust_context_provider {
        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_channel *chan);
+                      struct lttng_ust_channel_buffer *chan);
        void (*get_value)(struct lttng_ust_ctx_field *field,
                         struct lttng_ust_ctx_value *value);
        struct cds_hlist_node node;
@@ -129,7 +122,7 @@ void lttng_ust_context_set_session_provider(const char *name,
                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_channel *chan),
+                       struct lttng_ust_channel_buffer *chan),
                void (*get_value)(struct lttng_ust_ctx_field *field,
                        struct lttng_ust_ctx_value *value));
 
@@ -139,7 +132,7 @@ int lttng_ust_context_set_provider_rcu(struct lttng_ust_ctx **_ctx,
                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_channel *chan),
+                       struct lttng_ust_channel_buffer *chan),
                void (*get_value)(struct lttng_ust_ctx_field *field,
                        struct lttng_ust_ctx_value *value));
 
This page took 0.023987 seconds and 4 git commands to generate.