tap-driver.sh: flush stdout after each test result
[babeltrace.git] / plugins / text / dmesg / dmesg.c
index 29cef2f59d1e782f0c2565ca76f665e035ace1d8..b10c94252201c2a040bb22e932ce2475411fd5d9 100644 (file)
 #include <string.h>
 #include <ctype.h>
 #include <stdio.h>
-#include <babeltrace/assert-internal.h>
-#include <babeltrace/common-internal.h>
-#include <babeltrace/babeltrace.h>
-#include <babeltrace/value-internal.h>
-#include <babeltrace/compat/utc-internal.h>
-#include <babeltrace/compat/stdio-internal.h>
+#include <babeltrace2/assert-internal.h>
+#include <babeltrace2/common-internal.h>
+#include <babeltrace2/babeltrace.h>
+#include <babeltrace2/value-internal.h>
+#include <babeltrace2/compat/utc-internal.h>
+#include <babeltrace2/compat/stdio-internal.h>
 #include <glib.h>
 
 #define NSEC_PER_USEC 1000UL
@@ -141,17 +141,18 @@ int create_meta(struct dmesg_component *dmesg_comp, bool has_ts)
 
        if (has_ts) {
                dmesg_comp->clock_class = bt_clock_class_create(
-                       dmesg_comp->trace_class);
+                               bt_self_component_source_as_self_component(
+                                       dmesg_comp->self_comp));
                if (!dmesg_comp->clock_class) {
                        BT_LOGE_STR("Cannot create clock class.");
                        goto error;
                }
 
                /*
-                * The `dmesg` timestamp is not absolute, it's relative
-                * to the boot time.
+                * The `dmesg` timestamp's origin is not the Unix epoch,
+                * it's the boot time.
                 */
-               bt_clock_class_set_is_absolute(dmesg_comp->clock_class,
+               bt_clock_class_set_origin_is_unix_epoch(dmesg_comp->clock_class,
                        BT_FALSE);
 
                ret = bt_stream_class_set_default_clock_class(
@@ -160,6 +161,11 @@ int create_meta(struct dmesg_component *dmesg_comp, bool has_ts)
                        BT_LOGE_STR("Cannot set stream class's default clock class.");
                        goto error;
                }
+
+               bt_stream_class_set_packets_have_beginning_default_clock_snapshot(
+                       dmesg_comp->stream_class, BT_TRUE);
+               bt_stream_class_set_packets_have_end_default_clock_snapshot(
+                       dmesg_comp->stream_class, BT_TRUE);
        }
 
        dmesg_comp->event_class = bt_event_class_create(
@@ -298,12 +304,6 @@ int create_packet_and_stream_and_trace(struct dmesg_component *dmesg_comp)
                goto error;
        }
 
-       ret = bt_trace_make_static(dmesg_comp->trace);
-       if (ret) {
-               BT_LOGE_STR("Cannot make trace static.");
-               goto error;
-       }
-
        goto end;
 
 error:
This page took 0.025293 seconds and 4 git commands to generate.