Fix: various fixes for ctf-traces/succeed test cases
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 9 Jun 2017 22:38:36 +0000 (18:38 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Jun 2017 23:15:16 +0000 (19:15 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/event.c
plugins/ctf/common/notif-iter/notif-iter.c
plugins/ctf/fs-src/data-stream-file.c
plugins/ctf/fs-src/fs.c

index 9a552e7b09773682f13618ae5a28464b6cfaaebb..d1a7f777658b0cc2b010d89842d7942fc453d067 100644 (file)
@@ -98,9 +98,6 @@ struct bt_ctf_event *bt_ctf_event_create(struct bt_ctf_event_class *event_class)
                goto error;
        }
 
                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);
 
        /* The event class was frozen when added to its stream class */
        assert(event_class->frozen);
 
index 0409ac01a90fbaa44214aa246dcccff96dfe3b63..87e0581ddb63ef2f6b3ccf15eb582818ad92cdb1 100644 (file)
@@ -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;
 
        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");
 
        packet_size_field = bt_ctf_field_structure_get_field(
                notit->dscopes.stream_packet_context, "packet_size");
index 51908e0a8dfb2c70fceff85920a81415f7ba496d..52954bd247d7677f0c52e52b1d46c3f180bfafef 100644 (file)
@@ -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_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;
        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_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");
 
        timestamp_field = bt_ctf_field_structure_get_field_by_name(
                        packet_context_field, "timestamp_end");
index 8738f233bf12c6399088eb3cc65c33840b1ff30b..0af063140392ce2472a4be1e36756ea0f892c9bb 100644 (file)
@@ -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) {
        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,
        }
 
        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) {
                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;
                                file->path->str);
                        ctf_fs_file_destroy(file);
                        goto error;
This page took 0.028559 seconds and 4 git commands to generate.