void bt_ctf_writer_destroy(struct bt_object *obj);
static
-int init_trace_packet_header(struct bt_ctf_trace *trace)
+int init_trace_packet_header(struct bt_trace *trace)
{
int ret = 0;
- struct bt_ctf_field *magic = NULL, *uuid_array = NULL;
- struct bt_ctf_field_type *_uint32_t =
+ struct bt_field *magic = NULL, *uuid_array = NULL;
+ struct bt_field_type *_uint32_t =
get_field_type(FIELD_TYPE_ALIAS_UINT32_T);
- struct bt_ctf_field_type *_uint8_t =
+ struct bt_field_type *_uint8_t =
get_field_type(FIELD_TYPE_ALIAS_UINT8_T);
- struct bt_ctf_field_type *trace_packet_header_type =
- bt_ctf_field_type_structure_create();
- struct bt_ctf_field_type *uuid_array_type =
- bt_ctf_field_type_array_create(_uint8_t, 16);
+ struct bt_field_type *trace_packet_header_type =
+ bt_field_type_structure_create();
+ struct bt_field_type *uuid_array_type =
+ bt_field_type_array_create(_uint8_t, 16);
if (!trace_packet_header_type || !uuid_array_type) {
ret = -1;
goto end;
}
- ret = bt_ctf_field_type_structure_add_field(trace_packet_header_type,
+ ret = bt_field_type_structure_add_field(trace_packet_header_type,
_uint32_t, "magic");
if (ret) {
goto end;
}
- ret = bt_ctf_field_type_structure_add_field(trace_packet_header_type,
+ ret = bt_field_type_structure_add_field(trace_packet_header_type,
uuid_array_type, "uuid");
if (ret) {
goto end;
}
- ret = bt_ctf_field_type_structure_add_field(trace_packet_header_type,
+ ret = bt_field_type_structure_add_field(trace_packet_header_type,
_uint32_t, "stream_id");
if (ret) {
goto end;
}
- ret = bt_ctf_trace_set_packet_header_type(trace,
+ ret = bt_trace_set_packet_header_type(trace,
trace_packet_header_type);
if (ret) {
goto end;
goto error_destroy;
}
- writer->trace = bt_ctf_trace_create();
+ writer->trace = bt_trace_create();
if (!writer->trace) {
goto error_destroy;
}
goto error_destroy;
}
- ret = bt_ctf_trace_set_uuid(writer->trace, uuid);
+ ret = bt_trace_set_uuid(writer->trace, uuid);
if (ret) {
goto error_destroy;
}
bt_put(writer->trace);
/* Default to little-endian */
- ret = bt_ctf_writer_set_byte_order(writer, BT_CTF_BYTE_ORDER_NATIVE);
+ ret = bt_ctf_writer_set_byte_order(writer, BT_BYTE_ORDER_NATIVE);
assert(ret == 0);
/* Create trace directory if necessary and open a metadata file */
g_free(writer);
}
-struct bt_ctf_trace *bt_ctf_writer_get_trace(struct bt_ctf_writer *writer)
+struct bt_trace *bt_ctf_writer_get_trace(struct bt_ctf_writer *writer)
{
- struct bt_ctf_trace *trace = NULL;
+ struct bt_trace *trace = NULL;
if (!writer) {
goto end;
return trace;
}
-struct bt_ctf_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer,
- struct bt_ctf_stream_class *stream_class)
+struct bt_stream *bt_ctf_writer_create_stream(struct bt_ctf_writer *writer,
+ struct bt_stream_class *stream_class)
{
- struct bt_ctf_stream *stream = NULL;
+ struct bt_stream *stream = NULL;
int stream_class_count;
bt_bool stream_class_found = BT_FALSE;
int i;
}
/* Make sure the stream class is part of the writer's trace */
- stream_class_count = bt_ctf_trace_get_stream_class_count(writer->trace);
+ stream_class_count = bt_trace_get_stream_class_count(writer->trace);
if (stream_class_count < 0) {
goto error;
}
for (i = 0; i < stream_class_count; i++) {
- struct bt_ctf_stream_class *existing_stream_class =
- bt_ctf_trace_get_stream_class_by_index(
+ struct bt_stream_class *existing_stream_class =
+ bt_trace_get_stream_class_by_index(
writer->trace, i);
if (existing_stream_class == stream_class) {
}
if (!stream_class_found) {
- int ret = bt_ctf_trace_add_stream_class(writer->trace,
+ int ret = bt_trace_add_stream_class(writer->trace,
stream_class);
if (ret) {
}
}
- stream = bt_ctf_stream_create(stream_class, NULL);
+ stream = bt_stream_create(stream_class, NULL);
if (!stream) {
goto error;
}
goto end;
}
- ret = bt_ctf_trace_set_environment_field_string(writer->trace,
+ ret = bt_trace_set_environment_field_string(writer->trace,
name, value);
end:
return ret;
goto end;
}
- ret = bt_ctf_trace_set_environment_field_integer(writer->trace, name,
+ ret = bt_trace_set_environment_field_integer(writer->trace, name,
value);
end:
return ret;
goto end;
}
- ret = bt_ctf_trace_add_clock_class(writer->trace, clock->clock_class);
+ ret = bt_trace_add_clock_class(writer->trace, clock->clock_class);
end:
return ret;
}
goto end;
}
- metadata_string = bt_ctf_trace_get_metadata_string(
+ metadata_string = bt_trace_get_metadata_string(
writer->trace);
end:
return metadata_string;
goto end;
}
- metadata_string = bt_ctf_trace_get_metadata_string(
+ metadata_string = bt_trace_get_metadata_string(
writer->trace);
if (!metadata_string) {
goto end;
}
int bt_ctf_writer_set_byte_order(struct bt_ctf_writer *writer,
- enum bt_ctf_byte_order byte_order)
+ enum bt_byte_order byte_order)
{
int ret = 0;
goto end;
}
- if (byte_order == BT_CTF_BYTE_ORDER_NATIVE) {
- byte_order = BT_CTF_MY_BYTE_ORDER;
+ if (byte_order == BT_BYTE_ORDER_NATIVE) {
+ byte_order = BT_MY_BYTE_ORDER;
}
- ret = bt_ctf_trace_set_native_byte_order(writer->trace,
+ ret = bt_trace_set_native_byte_order(writer->trace,
byte_order);
end:
return ret;