ctf: add internal ctf_metadata_decoder_get_trace_class_uuid()
[babeltrace.git] / src / plugins / ctf / lttng-live / metadata.c
index b31cd96adbabfcdd2d254ae7988eb58a8b28a9ab..0061565ee219c3e20851d84f00810f61a506fccd 100644 (file)
@@ -27,7 +27,7 @@
 #define BT_COMP_LOG_SELF_COMP self_comp
 #define BT_LOG_OUTPUT_LEVEL log_level
 #define BT_LOG_TAG "PLUGIN/SRC.CTF.LTTNG-LIVE/META"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
 
 #include <stdio.h>
 #include <stdint.h>
@@ -217,10 +217,11 @@ enum lttng_live_iterator_status lttng_live_metadata_update(
        }
 
        /*
-        * The call to ctf_metadata_decoder_decode will append new metadata to
-        * our current trace class.
+        * The call to ctf_metadata_decoder_append_content() will append
+        * new metadata to our current trace class.
         */
-       decoder_status = ctf_metadata_decoder_decode(metadata->decoder, fp);
+       decoder_status = ctf_metadata_decoder_append_content(
+               metadata->decoder, fp);
        switch (decoder_status) {
        case CTF_METADATA_DECODER_STATUS_OK:
                if (!trace->trace_class) {
@@ -254,9 +255,7 @@ enum lttng_live_iterator_status lttng_live_metadata_update(
        case CTF_METADATA_DECODER_STATUS_INCOMPLETE:
                status = LTTNG_LIVE_ITERATOR_STATUS_AGAIN;
                break;
-       case CTF_METADATA_DECODER_STATUS_ERROR:
-       case CTF_METADATA_DECODER_STATUS_INVAL_VERSION:
-       case CTF_METADATA_DECODER_STATUS_IR_VISITOR_ERROR:
+       default:
                goto error;
        }
 
@@ -283,12 +282,12 @@ int lttng_live_metadata_create_stream(struct lttng_live_session *session,
 {
        struct lttng_live_metadata *metadata = NULL;
        struct lttng_live_trace *trace;
-       const char *match;
        struct ctf_metadata_decoder_config cfg = {
                .log_level = session->log_level,
                .self_comp = session->self_comp,
                .clock_class_offset_s = 0,
                .clock_class_offset_ns = 0,
+               .create_trace_class = true,
        };
 
        metadata = g_new0(struct lttng_live_metadata, 1);
@@ -299,11 +298,6 @@ int lttng_live_metadata_create_stream(struct lttng_live_session *session,
        metadata->self_comp = session->self_comp;
        metadata->stream_id = stream_id;
 
-       match = strstr(trace_name, session->session_name->str);
-       if (!match) {
-               goto error;
-       }
-
        metadata->decoder = ctf_metadata_decoder_create(&cfg);
        if (!metadata->decoder) {
                goto error;
This page took 0.024656 seconds and 4 git commands to generate.