Fix: src.ctf.lttng-live: decode metadata even on _STATUS_CLOSED
[babeltrace.git] / src / plugins / ctf / lttng-live / lttng-live.h
index 1447cc5d2815ea7bb16a65a6f934b36191b8d2c5..58131f8208640668134a9e9f2ea68fff0cbff817 100644 (file)
@@ -129,14 +129,32 @@ struct lttng_live_metadata {
        bt_logging_level log_level;
        bt_self_component *self_comp;
 
-       /* Weak reference. */
-       struct lttng_live_trace *trace;
-
        uint64_t stream_id;
        /* Weak reference. */
        struct ctf_metadata_decoder *decoder;
 };
 
+enum lttng_live_metadata_stream_state {
+       /*
+        * The metadata needs to be updated. This is either because we just
+        * created the trace and haven't asked yet, or the relay specifically
+        * told us that new metadata is available.
+        */
+       LTTNG_LIVE_METADATA_STREAM_STATE_NEEDED,
+       /*
+        * The metadata was updated and the relay has not told us we need to
+        * update it yet.
+        */
+       LTTNG_LIVE_METADATA_STREAM_STATE_NOT_NEEDED,
+       /*
+        * The relay has closed this metadata stream. We set this in reaction
+        * to a LTTNG_VIEWER_METADATA_ERR reply to a LTTNG_VIEWER_GET_METADATA
+        * command to the relay. If this field is set, we have received all the
+        * metadata that we are ever going to get for that metadata stream.
+        */
+       LTTNG_LIVE_METADATA_STREAM_STATE_CLOSED,
+};
+
 struct lttng_live_trace {
        bt_logging_level log_level;
        bt_self_component *self_comp;
@@ -161,7 +179,7 @@ struct lttng_live_trace {
        /* Owned by this. */
        GPtrArray *stream_iterators;
 
-       bool new_metadata_needed;
+       enum lttng_live_metadata_stream_state metadata_stream_state;
 };
 
 struct lttng_live_session {
This page took 0.023827 seconds and 4 git commands to generate.