goto error;
}
- event_class->context = bt_ctf_field_type_structure_create();
- if (!event_class->context) {
- BT_LOGE_STR("Cannot create event class's initial context field type object.");
- goto error;
- }
-
event_class->attributes = bt_ctf_attributes_create();
if (!event_class->attributes) {
BT_LOGE_STR("Cannot create event class's attributes object.");
goto error;
}
- stream_class->packet_context_type = bt_ctf_field_type_structure_create();
- if (!stream_class->packet_context_type) {
- BT_LOGE_STR("Cannot create stream class's initial packet context field type.");
- goto error;
- }
-
- stream_class->event_header_type = bt_ctf_field_type_structure_create();
- if (!stream_class->event_header_type) {
- BT_LOGE_STR("Cannot create stream class's initial event header field type.");
- goto error;
- }
-
- stream_class->event_context_type = bt_ctf_field_type_structure_create();
- if (!stream_class->event_context_type) {
- BT_LOGE_STR("Cannot create stream class's initial event context field type.");
- goto error;
- }
-
bt_object_init(stream_class, bt_ctf_stream_class_destroy);
BT_LOGD("Created empty stream class object: addr=%p, name=\"%s\"",
stream_class, name);
struct bt_ctf_trace *bt_ctf_trace_create(void)
{
struct bt_ctf_trace *trace = NULL;
- struct bt_ctf_field_type *packet_header_type = NULL;
trace = g_new0(struct bt_ctf_trace, 1);
if (!trace) {
goto error;
}
- packet_header_type = bt_ctf_field_type_structure_create();
- if (!packet_header_type) {
- goto error;
- }
-
- BT_MOVE(trace->packet_header_type, packet_header_type);
-
/* Create the environment array object */
trace->environment = bt_ctf_attributes_create();
if (!trace->environment) {
error:
BT_PUT(trace);
- bt_put(packet_header_type);
return trace;
}