From: Philippe Proulx Date: Thu, 1 Jun 2017 21:05:11 +0000 (-0400) Subject: ir: do not create empty structure for optional scope field types X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=838ea4d566e23e9e1610c95a8683f44866f94851;p=deliverable%2Fbabeltrace.git ir: do not create empty structure for optional scope field types Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/lib/ctf-ir/event-class.c b/lib/ctf-ir/event-class.c index 3fc606031..9f82e176d 100644 --- a/lib/ctf-ir/event-class.c +++ b/lib/ctf-ir/event-class.c @@ -79,12 +79,6 @@ struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name) 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."); diff --git a/lib/ctf-ir/stream-class.c b/lib/ctf-ir/stream-class.c index a9f1c12a0..52be6fcda 100644 --- a/lib/ctf-ir/stream-class.c +++ b/lib/ctf-ir/stream-class.c @@ -124,24 +124,6 @@ struct bt_ctf_stream_class *bt_ctf_stream_class_create_empty(const char *name) 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); diff --git a/lib/ctf-ir/trace.c b/lib/ctf-ir/trace.c index 6515dfe8c..34b459df7 100644 --- a/lib/ctf-ir/trace.c +++ b/lib/ctf-ir/trace.c @@ -93,7 +93,6 @@ const unsigned int field_type_aliases_sizes[] = { 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) { @@ -125,13 +124,6 @@ struct bt_ctf_trace *bt_ctf_trace_create(void) 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) { @@ -158,7 +150,6 @@ struct bt_ctf_trace *bt_ctf_trace_create(void) error: BT_PUT(trace); - bt_put(packet_header_type); return trace; }