tap-driver.sh: flush stdout after each test result
[babeltrace.git] / plugins / ctf / common / metadata / ctf-meta-translate.c
index 608db66fd95fd82493b6da8dd38bc0a9c7212b75..ca3069aee13bd1ab8091b6b9f5078247ad2d890a 100644 (file)
@@ -15,9 +15,9 @@
 #define BT_LOG_TAG "PLUGIN-CTF-METADATA-META-TRANSLATE"
 #include "logging.h"
 
-#include <babeltrace/babeltrace.h>
-#include <babeltrace/babeltrace-internal.h>
-#include <babeltrace/assert-internal.h>
+#include <babeltrace2/babeltrace.h>
+#include <babeltrace2/babeltrace-internal.h>
+#include <babeltrace2/assert-internal.h>
 #include <glib.h>
 #include <stdint.h>
 #include <string.h>
@@ -326,6 +326,16 @@ bool ctf_field_class_struct_has_immediate_member_in_ir(
        uint64_t i;
        bool has_immediate_member_in_ir = false;
 
+       /*
+        * If the structure field class has no members at all, then it
+        * was an empty structure in the beginning, so leave it existing
+        * and empty.
+        */
+       if (fc->members->len == 0) {
+               has_immediate_member_in_ir = true;
+               goto end;
+       }
+
        for (i = 0; i < fc->members->len; i++) {
                struct ctf_named_field_class *named_fc =
                        ctf_field_class_struct_borrow_member_by_index(fc, i);
@@ -477,6 +487,16 @@ void ctf_stream_class_to_ir(struct ctx *ctx)
                BT_ASSERT(ret == 0);
        }
 
+       bt_stream_class_set_packets_have_beginning_default_clock_snapshot(
+               ctx->ir_sc, ctx->sc->packets_have_ts_begin);
+       bt_stream_class_set_packets_have_end_default_clock_snapshot(
+               ctx->ir_sc, ctx->sc->packets_have_ts_end);
+       bt_stream_class_set_supports_discarded_events(ctx->ir_sc,
+               ctx->sc->has_discarded_events,
+               ctx->sc->discarded_events_have_default_cs);
+       bt_stream_class_set_supports_discarded_packets(ctx->ir_sc,
+               ctx->sc->has_discarded_packets,
+               ctx->sc->discarded_packets_have_default_cs);
        ctx->sc->is_translated = true;
        ctx->sc->ir_sc = ctx->ir_sc;
 
This page took 0.024362 seconds and 4 git commands to generate.