#define BT_LOG_TAG "PLUGIN-CTF-FS-SINK-STREAM"
#include "logging.h"
-#include <babeltrace/babeltrace.h>
+#include <babeltrace2/babeltrace.h>
#include <stdio.h>
#include <stdbool.h>
#include <glib.h>
-#include <babeltrace/assert-internal.h>
-#include <babeltrace/ctfser-internal.h>
-#include <babeltrace/endian-internal.h>
+#include <babeltrace2/assert-internal.h>
+#include <babeltrace2/ctfser-internal.h>
+#include <babeltrace2/endian-internal.h>
#include "fs-sink-trace.h"
#include "fs-sink-stream.h"
goto end;
}
- if (stream->sc->default_clock_class) {
+ if (stream->sc->packets_have_ts_begin) {
/* Beginning time */
ret = bt_ctfser_write_byte_aligned_unsigned_int(&stream->ctfser,
stream->packet_state.beginning_cs, 8, 64, BYTE_ORDER);
if (ret) {
goto end;
}
+ }
+ if (stream->sc->packets_have_ts_end) {
/* End time */
ret = bt_ctfser_write_byte_aligned_unsigned_int(&stream->ctfser,
stream->packet_state.end_cs, 8, 64, BYTE_ORDER);
}
}
- /* Discarded event counter */
- ret = bt_ctfser_write_byte_aligned_unsigned_int(&stream->ctfser,
- stream->packet_state.discarded_events_counter, 8, 64,
- BYTE_ORDER);
- if (ret) {
- goto end;
+ if (stream->sc->has_discarded_events) {
+ /* Discarded event counter */
+ ret = bt_ctfser_write_byte_aligned_unsigned_int(&stream->ctfser,
+ stream->packet_state.discarded_events_counter, 8, 64,
+ BYTE_ORDER);
+ if (ret) {
+ goto end;
+ }
}
/* Sequence number */