From: Mathieu Desnoyers Date: Fri, 9 Jun 2017 22:38:36 +0000 (-0400) Subject: Fix: various fixes for ctf-traces/succeed test cases X-Git-Tag: v2.0.0-pre1~3 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=89b08333996aedb3378fc37939d489a0768bd955 Fix: various fixes for ctf-traces/succeed test cases Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/lib/ctf-ir/event.c b/lib/ctf-ir/event.c index 9a552e7b..d1a7f777 100644 --- a/lib/ctf-ir/event.c +++ b/lib/ctf-ir/event.c @@ -98,9 +98,6 @@ struct bt_ctf_event *bt_ctf_event_create(struct bt_ctf_event_class *event_class) goto error; } - /* A stream class should always have an existing event header type */ - assert(stream_class->event_header_type); - /* The event class was frozen when added to its stream class */ assert(event_class->frozen); diff --git a/plugins/ctf/common/notif-iter/notif-iter.c b/plugins/ctf/common/notif-iter/notif-iter.c index 0409ac01..87e0581d 100644 --- a/plugins/ctf/common/notif-iter/notif-iter.c +++ b/plugins/ctf/common/notif-iter/notif-iter.c @@ -1048,7 +1048,9 @@ enum bt_ctf_notif_iter_status set_current_packet_content_sizes( struct bt_ctf_field *content_size_field = NULL; uint64_t content_size = -1, packet_size = -1; - assert(notit->dscopes.stream_packet_context); + if (!notit->dscopes.stream_packet_context) { + goto end; + } packet_size_field = bt_ctf_field_structure_get_field( notit->dscopes.stream_packet_context, "packet_size"); diff --git a/plugins/ctf/fs-src/data-stream-file.c b/plugins/ctf/fs-src/data-stream-file.c index 51908e0a..52954bd2 100644 --- a/plugins/ctf/fs-src/data-stream-file.c +++ b/plugins/ctf/fs-src/data-stream-file.c @@ -255,7 +255,7 @@ int get_ds_file_packet_bounds_clock_classes(struct ctf_fs_ds_file *ds_file, struct bt_ctf_clock_class **_timestamp_end_cc) { int ret; - struct bt_ctf_field *timestamp_field; + struct bt_ctf_field *timestamp_field = NULL; struct bt_ctf_field *packet_context_field = NULL; struct bt_ctf_clock_class *timestamp_begin_cc = NULL; struct bt_ctf_clock_class *timestamp_end_cc = NULL; @@ -283,7 +283,7 @@ int get_ds_file_packet_bounds_clock_classes(struct ctf_fs_ds_file *ds_file, BT_LOGD("Cannot retrieve the clock mapped to timestamp_begin of stream \'%s\'", ds_file->file->path->str); } - bt_put(timestamp_field); + BT_PUT(timestamp_field); timestamp_field = bt_ctf_field_structure_get_field_by_name( packet_context_field, "timestamp_end"); diff --git a/plugins/ctf/fs-src/fs.c b/plugins/ctf/fs-src/fs.c index 8738f233..0af06314 100644 --- a/plugins/ctf/fs-src/fs.c +++ b/plugins/ctf/fs-src/fs.c @@ -393,7 +393,7 @@ struct bt_ctf_stream_class *stream_class_from_packet_header( stream_id_field = bt_ctf_field_structure_get_field_by_name( packet_header_field, "stream_id"); if (!stream_id_field) { - goto end; + goto single_stream_class; } ret = bt_ctf_field_unsigned_integer_get_value(stream_id_field, @@ -835,7 +835,7 @@ int create_ds_file_groups(struct ctf_fs_trace *ctf_fs_trace) ret = add_ds_file_to_ds_file_group(ctf_fs_trace, file->path->str); if (ret) { - BT_LOGD("Cannot add stream file `%s` to stream file group", + BT_LOGE("Cannot add stream file `%s` to stream file group", file->path->str); ctf_fs_file_destroy(file); goto error;