#include <babeltrace/ctf-writer/functor-internal.h>
#include <babeltrace/ctf-ir/event-types-internal.h>
#include <babeltrace/ctf-ir/attributes-internal.h>
+#include <babeltrace/ctf-ir/visitor-internal.h>
#include <babeltrace/ctf-ir/utils.h>
#include <babeltrace/compiler.h>
#include <babeltrace/objects.h>
static
int init_trace_packet_header(struct bt_ctf_trace *trace);
static
-void bt_ctf_trace_freeze(struct bt_ctf_trace *trace);
+int bt_ctf_trace_freeze(struct bt_ctf_trace *trace);
static
const unsigned int field_type_aliases_alignments[] = {
}
}
+ ret = bt_ctf_stream_class_resolve_types(stream_class, trace);
+ if (ret) {
+ goto end;
+ }
+
stream_id = bt_ctf_stream_class_get_id(stream_class);
if (stream_id < 0) {
stream_id = trace->next_stream_id++;
}
bt_ctf_stream_class_freeze(stream_class);
- bt_ctf_trace_freeze(trace);
+ if (!trace->frozen) {
+ ret = bt_ctf_trace_freeze(trace);
+ goto end;
+ }
end:
if (ret) {
(void) bt_ctf_stream_class_set_trace(stream_class, NULL);
}
static
-void bt_ctf_trace_freeze(struct bt_ctf_trace *trace)
+int bt_ctf_trace_freeze(struct bt_ctf_trace *trace)
{
+ int ret = 0;
+
+ ret = bt_ctf_trace_resolve_types(trace);
+ if (ret) {
+ goto end;
+ }
+
bt_ctf_attributes_freeze(trace->environment);
trace->frozen = 1;
+end:
+ return ret;
}
static