X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Ffs-sink%2Ffs-sink.c;h=da3307feac63dc59225ab7ffee4c6065aafc2312;hb=649934d212dbc58e6d11dbd9eae6bdb931e65522;hp=83742ed1240eedc13173d4040291823aa561f203;hpb=f06a3e4792a03eeb61f23640229c77945ca5eaf3;p=babeltrace.git diff --git a/plugins/ctf/fs-sink/fs-sink.c b/plugins/ctf/fs-sink/fs-sink.c index 83742ed1..da3307fe 100644 --- a/plugins/ctf/fs-sink/fs-sink.c +++ b/plugins/ctf/fs-sink/fs-sink.c @@ -516,8 +516,44 @@ bt_self_component_status handle_stream_beginning_msg( bt_self_component_status status = BT_SELF_COMPONENT_STATUS_OK; const bt_stream *ir_stream = bt_message_stream_beginning_borrow_stream_const(msg); + const bt_stream_class *ir_sc = + bt_stream_borrow_class_const(ir_stream); struct fs_sink_stream *stream; + /* + * Temporary: if the stream's class has a default clock class, + * make sure packet beginning and end messages have default + * clock snapshots until the support for not having them is + * implemented. + */ + if (bt_stream_class_borrow_default_clock_class_const(ir_sc)) { + if (!bt_stream_class_packets_have_default_beginning_clock_snapshot( + ir_sc)) { + BT_LOGE("Unsupported stream: packets have " + "no beginning clock snapshot: " + "stream-addr=%p, " + "stream-id=%" PRIu64 ", " + "stream-name=\"%s\"", + ir_stream, bt_stream_get_id(ir_stream), + bt_stream_get_name(ir_stream)); + status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR; + goto end; + } + + if (!bt_stream_class_packets_have_default_end_clock_snapshot( + ir_sc)) { + BT_LOGE("Unsupported stream: packets have " + "no end clock snapshot: " + "stream-addr=%p, " + "stream-id=%" PRIu64 ", " + "stream-name=\"%s\"", + ir_stream, bt_stream_get_id(ir_stream), + bt_stream_get_name(ir_stream)); + status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR; + goto end; + } + } + stream = borrow_stream(fs_sink, ir_stream); if (!stream) { status = BT_SELF_COMPONENT_STATUS_ERROR;