Rename bt_ctf_X -> bt_X, maintain backward compat. for pre-2.0 CTF writer
[babeltrace.git] / lib / ctf-ir / trace.c
index 9482e097fd56ee9a7cf986a6c9e0c55df9a2f8ad..4a3027b48ec76517c055b5312e59f91c185a2bfa 100644 (file)
 #define DEFAULT_METADATA_STRING_SIZE 4096
 
 struct listener_wrapper {
-       bt_ctf_listener_cb listener;
+       bt_listener_cb listener;
        void *data;
 };
 
-struct bt_ctf_trace_is_static_listener_elem {
-       bt_ctf_trace_is_static_listener func;
-       bt_ctf_trace_listener_removed removed;
+struct bt_trace_is_static_listener_elem {
+       bt_trace_is_static_listener func;
+       bt_trace_listener_removed removed;
        void *data;
 };
 
 static
-void bt_ctf_trace_destroy(struct bt_object *obj);
+void bt_trace_destroy(struct bt_object *obj);
 static
-void bt_ctf_trace_freeze(struct bt_ctf_trace *trace);
+void bt_trace_freeze(struct bt_trace *trace);
 
 static
 const unsigned int field_type_aliases_alignments[] = {
@@ -91,19 +91,19 @@ const unsigned int field_type_aliases_sizes[] = {
        [FIELD_TYPE_ALIAS_UINT64_T] = 64,
 };
 
-struct bt_ctf_trace *bt_ctf_trace_create(void)
+struct bt_trace *bt_trace_create(void)
 {
-       struct bt_ctf_trace *trace = NULL;
+       struct bt_trace *trace = NULL;
 
-       trace = g_new0(struct bt_ctf_trace, 1);
+       trace = g_new0(struct bt_trace, 1);
        if (!trace) {
                BT_LOGE_STR("Failed to allocate one trace.");
                goto error;
        }
 
        BT_LOGD_STR("Creating trace object.");
-       trace->native_byte_order = BT_CTF_BYTE_ORDER_UNSPECIFIED;
-       bt_object_init(trace, bt_ctf_trace_destroy);
+       trace->native_byte_order = BT_BYTE_ORDER_UNSPECIFIED;
+       bt_object_init(trace, bt_trace_destroy);
        trace->clocks = g_ptr_array_new_with_free_func(
                (GDestroyNotify) bt_put);
        if (!trace->clocks) {
@@ -126,7 +126,7 @@ struct bt_ctf_trace *bt_ctf_trace_create(void)
        }
 
        /* Create the environment array object */
-       trace->environment = bt_ctf_attributes_create();
+       trace->environment = bt_attributes_create();
        if (!trace->environment) {
                BT_LOGE_STR("Cannot create empty attributes object.");
                goto error;
@@ -140,7 +140,7 @@ struct bt_ctf_trace *bt_ctf_trace_create(void)
        }
 
        trace->is_static_listeners = g_array_new(FALSE, TRUE,
-               sizeof(struct bt_ctf_trace_is_static_listener_elem));
+               sizeof(struct bt_trace_is_static_listener_elem));
        if (!trace->is_static_listeners) {
                BT_LOGE_STR("Failed to allocate one GArray.");
                goto error;
@@ -154,7 +154,7 @@ error:
        return trace;
 }
 
-const char *bt_ctf_trace_get_name(struct bt_ctf_trace *trace)
+const char *bt_trace_get_name(struct bt_trace *trace)
 {
        const char *name = NULL;
 
@@ -172,7 +172,7 @@ end:
        return name;
 }
 
-int bt_ctf_trace_set_name(struct bt_ctf_trace *trace, const char *name)
+int bt_trace_set_name(struct bt_trace *trace, const char *name)
 {
        int ret = 0;
 
@@ -191,7 +191,7 @@ int bt_ctf_trace_set_name(struct bt_ctf_trace *trace, const char *name)
        if (trace->frozen) {
                BT_LOGW("Invalid parameter: trace is frozen: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
@@ -210,12 +210,12 @@ end:
        return ret;
 }
 
-const unsigned char *bt_ctf_trace_get_uuid(struct bt_ctf_trace *trace)
+const unsigned char *bt_trace_get_uuid(struct bt_trace *trace)
 {
        return trace && trace->uuid_set ? trace->uuid : NULL;
 }
 
-int bt_ctf_trace_set_uuid(struct bt_ctf_trace *trace, const unsigned char *uuid)
+int bt_trace_set_uuid(struct bt_trace *trace, const unsigned char *uuid)
 {
        int ret = 0;
 
@@ -234,7 +234,7 @@ int bt_ctf_trace_set_uuid(struct bt_ctf_trace *trace, const unsigned char *uuid)
        if (trace->frozen) {
                BT_LOGW("Invalid parameter: trace is frozen: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
@@ -243,7 +243,7 @@ int bt_ctf_trace_set_uuid(struct bt_ctf_trace *trace, const unsigned char *uuid)
        trace->uuid_set = BT_TRUE;
        BT_LOGV("Set trace's UUID: addr=%p, name=\"%s\", "
                "uuid=\"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\"",
-               trace, bt_ctf_trace_get_name(trace),
+               trace, bt_trace_get_name(trace),
                (unsigned int) uuid[0],
                (unsigned int) uuid[1],
                (unsigned int) uuid[2],
@@ -265,14 +265,14 @@ end:
        return ret;
 }
 
-void bt_ctf_trace_destroy(struct bt_object *obj)
+void bt_trace_destroy(struct bt_object *obj)
 {
-       struct bt_ctf_trace *trace;
+       struct bt_trace *trace;
 
-       trace = container_of(obj, struct bt_ctf_trace, base);
+       trace = container_of(obj, struct bt_trace, base);
 
        BT_LOGD("Destroying trace object: addr=%p, name=\"%s\"",
-               trace, bt_ctf_trace_get_name(trace));
+               trace, bt_trace_get_name(trace));
 
        /*
         * Call remove listeners first so that everything else still
@@ -282,9 +282,9 @@ void bt_ctf_trace_destroy(struct bt_object *obj)
                size_t i;
 
                for (i = 0; i < trace->is_static_listeners->len; i++) {
-                       struct bt_ctf_trace_is_static_listener_elem elem =
+                       struct bt_trace_is_static_listener_elem elem =
                                g_array_index(trace->is_static_listeners,
-                                       struct bt_ctf_trace_is_static_listener_elem, i);
+                                       struct bt_trace_is_static_listener_elem, i);
 
                        if (elem.removed) {
                                elem.removed(trace, elem.data);
@@ -300,7 +300,7 @@ void bt_ctf_trace_destroy(struct bt_object *obj)
 
        if (trace->environment) {
                BT_LOGD_STR("Destroying environment attributes.");
-               bt_ctf_attributes_destroy(trace->environment);
+               bt_attributes_destroy(trace->environment);
        }
 
        if (trace->name) {
@@ -327,7 +327,7 @@ void bt_ctf_trace_destroy(struct bt_object *obj)
        g_free(trace);
 }
 
-int bt_ctf_trace_set_environment_field(struct bt_ctf_trace *trace,
+int bt_trace_set_environment_field(struct bt_trace *trace,
                const char *name, struct bt_value *value)
 {
        int ret = 0;
@@ -350,11 +350,11 @@ int bt_ctf_trace_set_environment_field(struct bt_ctf_trace *trace,
                goto end;
        }
 
-       if (bt_ctf_validate_identifier(name)) {
+       if (bt_identifier_is_valid(name)) {
                BT_LOGW("Invalid parameter: environment field's name is not a valid CTF identifier: "
                        "trace-addr=%p, trace-name=\"%s\", "
                        "env-name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace), name);
+                       trace, bt_trace_get_name(trace), name);
                ret = -1;
                goto end;
        }
@@ -363,7 +363,7 @@ int bt_ctf_trace_set_environment_field(struct bt_ctf_trace *trace,
                BT_LOGW("Invalid parameter: environment field's value is not an integer or string value: "
                        "trace-addr=%p, trace-name=\"%s\", "
                        "env-name=\"%s\", env-value-type=%s",
-                       trace, bt_ctf_trace_get_name(trace), name,
+                       trace, bt_trace_get_name(trace), name,
                        bt_value_type_string(bt_value_get_type(value)));
                ret = -1;
                goto end;
@@ -372,7 +372,7 @@ int bt_ctf_trace_set_environment_field(struct bt_ctf_trace *trace,
        if (trace->is_static) {
                BT_LOGW("Invalid parameter: trace is static: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
@@ -385,14 +385,14 @@ int bt_ctf_trace_set_environment_field(struct bt_ctf_trace *trace,
                 * The object passed is frozen like all other attributes.
                 */
                struct bt_value *attribute =
-                       bt_ctf_attributes_get_field_value_by_name(
+                       bt_attributes_get_field_value_by_name(
                                trace->environment, name);
 
                if (attribute) {
                        BT_LOGW("Invalid parameter: trace is frozen and environment field already exists with this name: "
                                "trace-addr=%p, trace-name=\"%s\", "
                                "env-name=\"%s\"",
-                               trace, bt_ctf_trace_get_name(trace), name);
+                               trace, bt_trace_get_name(trace), name);
                        BT_PUT(attribute);
                        ret = -1;
                        goto end;
@@ -401,25 +401,25 @@ int bt_ctf_trace_set_environment_field(struct bt_ctf_trace *trace,
                bt_value_freeze(value);
        }
 
-       ret = bt_ctf_attributes_set_field_value(trace->environment, name,
+       ret = bt_attributes_set_field_value(trace->environment, name,
                value);
        if (ret) {
                BT_LOGE("Cannot set environment field's value: "
                        "trace-addr=%p, trace-name=\"%s\", "
                        "env-name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace), name);
+                       trace, bt_trace_get_name(trace), name);
        } else {
                BT_LOGV("Set environment field's value: "
                        "trace-addr=%p, trace-name=\"%s\", "
                        "env-name=\"%s\", value-addr=%p",
-                       trace, bt_ctf_trace_get_name(trace), name, value);
+                       trace, bt_trace_get_name(trace), name, value);
        }
 
 end:
        return ret;
 }
 
-int bt_ctf_trace_set_environment_field_string(struct bt_ctf_trace *trace,
+int bt_trace_set_environment_field_string(struct bt_trace *trace,
                const char *name, const char *value)
 {
        int ret = 0;
@@ -438,8 +438,8 @@ int bt_ctf_trace_set_environment_field_string(struct bt_ctf_trace *trace,
                goto end;
        }
 
-       /* bt_ctf_trace_set_environment_field() logs errors */
-       ret = bt_ctf_trace_set_environment_field(trace, name,
+       /* bt_trace_set_environment_field() logs errors */
+       ret = bt_trace_set_environment_field(trace, name,
                env_value_string_obj);
 
 end:
@@ -447,7 +447,7 @@ end:
        return ret;
 }
 
-int bt_ctf_trace_set_environment_field_integer(struct bt_ctf_trace *trace,
+int bt_trace_set_environment_field_integer(struct bt_trace *trace,
                const char *name, int64_t value)
 {
        int ret = 0;
@@ -460,8 +460,8 @@ int bt_ctf_trace_set_environment_field_integer(struct bt_ctf_trace *trace,
                goto end;
        }
 
-       /* bt_ctf_trace_set_environment_field() logs errors */
-       ret = bt_ctf_trace_set_environment_field(trace, name,
+       /* bt_trace_set_environment_field() logs errors */
+       ret = bt_trace_set_environment_field(trace, name,
                env_value_integer_obj);
 
 end:
@@ -469,7 +469,7 @@ end:
        return ret;
 }
 
-int64_t bt_ctf_trace_get_environment_field_count(struct bt_ctf_trace *trace)
+int64_t bt_trace_get_environment_field_count(struct bt_trace *trace)
 {
        int64_t ret = 0;
 
@@ -479,7 +479,7 @@ int64_t bt_ctf_trace_get_environment_field_count(struct bt_ctf_trace *trace)
                goto end;
        }
 
-       ret = bt_ctf_attributes_get_count(trace->environment);
+       ret = bt_attributes_get_count(trace->environment);
        assert(ret >= 0);
 
 end:
@@ -487,7 +487,7 @@ end:
 }
 
 const char *
-bt_ctf_trace_get_environment_field_name_by_index(struct bt_ctf_trace *trace,
+bt_trace_get_environment_field_name_by_index(struct bt_trace *trace,
                uint64_t index)
 {
        const char *ret = NULL;
@@ -497,14 +497,14 @@ bt_ctf_trace_get_environment_field_name_by_index(struct bt_ctf_trace *trace,
                goto end;
        }
 
-       ret = bt_ctf_attributes_get_field_name(trace->environment, index);
+       ret = bt_attributes_get_field_name(trace->environment, index);
 
 end:
        return ret;
 }
 
-struct bt_value *bt_ctf_trace_get_environment_field_value_by_index(
-               struct bt_ctf_trace *trace, uint64_t index)
+struct bt_value *bt_trace_get_environment_field_value_by_index(
+               struct bt_trace *trace, uint64_t index)
 {
        struct bt_value *ret = NULL;
 
@@ -513,14 +513,14 @@ struct bt_value *bt_ctf_trace_get_environment_field_value_by_index(
                goto end;
        }
 
-       ret = bt_ctf_attributes_get_field_value(trace->environment, index);
+       ret = bt_attributes_get_field_value(trace->environment, index);
 
 end:
        return ret;
 }
 
-struct bt_value *bt_ctf_trace_get_environment_field_value_by_name(
-               struct bt_ctf_trace *trace, const char *name)
+struct bt_value *bt_trace_get_environment_field_value_by_name(
+               struct bt_trace *trace, const char *name)
 {
        struct bt_value *ret = NULL;
 
@@ -534,15 +534,15 @@ struct bt_value *bt_ctf_trace_get_environment_field_value_by_name(
                goto end;
        }
 
-       ret = bt_ctf_attributes_get_field_value_by_name(trace->environment,
+       ret = bt_attributes_get_field_value_by_name(trace->environment,
                name);
 
 end:
        return ret;
 }
 
-int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace,
-               struct bt_ctf_clock_class *clock_class)
+int bt_trace_add_clock_class(struct bt_trace *trace,
+               struct bt_clock_class *clock_class)
 {
        int ret = 0;
 
@@ -555,28 +555,28 @@ int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace,
        if (trace->is_static) {
                BT_LOGW("Invalid parameter: trace is static: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
 
-       if (!bt_ctf_clock_class_is_valid(clock_class)) {
+       if (!bt_clock_class_is_valid(clock_class)) {
                BT_LOGW("Invalid parameter: clock class is invalid: "
                        "trace-addr=%p, trace-name=\"%s\", "
                        "clock-class-addr=%p, clock-class-name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace),
-                       clock_class, bt_ctf_clock_class_get_name(clock_class));
+                       trace, bt_trace_get_name(trace),
+                       clock_class, bt_clock_class_get_name(clock_class));
                ret = -1;
                goto end;
        }
 
        /* Check for duplicate clock classes */
-       if (bt_ctf_trace_has_clock_class(trace, clock_class)) {
+       if (bt_trace_has_clock_class(trace, clock_class)) {
                BT_LOGW("Invalid parameter: clock class already exists in trace: "
                        "trace-addr=%p, trace-name=\"%s\", "
                        "clock-class-addr=%p, clock-class-name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace),
-                       clock_class, bt_ctf_clock_class_get_name(clock_class));
+                       trace, bt_trace_get_name(trace),
+                       clock_class, bt_clock_class_get_name(clock_class));
                ret = -1;
                goto end;
        }
@@ -586,20 +586,20 @@ int bt_ctf_trace_add_clock_class(struct bt_ctf_trace *trace,
 
        if (trace->frozen) {
                BT_LOGV_STR("Freezing added clock class because trace is frozen.");
-               bt_ctf_clock_class_freeze(clock_class);
+               bt_clock_class_freeze(clock_class);
        }
 
        BT_LOGV("Added clock class to trace: "
                "trace-addr=%p, trace-name=\"%s\", "
                "clock-class-addr=%p, clock-class-name=\"%s\"",
-               trace, bt_ctf_trace_get_name(trace),
-               clock_class, bt_ctf_clock_class_get_name(clock_class));
+               trace, bt_trace_get_name(trace),
+               clock_class, bt_clock_class_get_name(clock_class));
 
 end:
        return ret;
 }
 
-int64_t bt_ctf_trace_get_clock_class_count(struct bt_ctf_trace *trace)
+int64_t bt_trace_get_clock_class_count(struct bt_trace *trace)
 {
        int64_t ret = (int64_t) -1;
 
@@ -613,10 +613,10 @@ end:
        return ret;
 }
 
-struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_index(
-               struct bt_ctf_trace *trace, uint64_t index)
+struct bt_clock_class *bt_trace_get_clock_class_by_index(
+               struct bt_trace *trace, uint64_t index)
 {
-       struct bt_ctf_clock_class *clock_class = NULL;
+       struct bt_clock_class *clock_class = NULL;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -627,7 +627,7 @@ struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_index(
                BT_LOGW("Invalid parameter: index is out of bounds: "
                        "addr=%p, name=\"%s\", "
                        "index=%" PRIu64 ", count=%u",
-                       trace, bt_ctf_trace_get_name(trace),
+                       trace, bt_trace_get_name(trace),
                        index, trace->clocks->len);
                goto end;
        }
@@ -639,12 +639,12 @@ end:
 }
 
 static
-bool packet_header_field_type_is_valid(struct bt_ctf_trace *trace,
-               struct bt_ctf_field_type *packet_header_type)
+bool packet_header_field_type_is_valid(struct bt_trace *trace,
+               struct bt_field_type *packet_header_type)
 {
        int ret;
        bool is_valid = true;
-       struct bt_ctf_field_type *field_type = NULL;
+       struct bt_field_type *field_type = NULL;
 
        if (!packet_header_type) {
                /*
@@ -664,11 +664,11 @@ bool packet_header_field_type_is_valid(struct bt_ctf_trace *trace,
        }
 
        /* Packet header field type, if it exists, must be a structure */
-       if (!bt_ctf_field_type_is_structure(packet_header_type)) {
+       if (!bt_field_type_is_structure(packet_header_type)) {
                BT_LOGW("Invalid packet header field type: must be a structure field type if it exists: "
                        "ft-addr=%p, ft-id=%s",
                        packet_header_type,
-                       bt_ctf_field_type_id_string(packet_header_type->id));
+                       bt_field_type_id_string(packet_header_type->id));
                goto invalid;
        }
 
@@ -677,34 +677,34 @@ bool packet_header_field_type_is_valid(struct bt_ctf_trace *trace,
         * integer field type. Also it must be the first field of the
         * packet header field type.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_header_type, "magic");
        if (field_type) {
                const char *field_name;
 
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet header field type: `magic` field must be an integer field type: "
                                "magic-ft-addr=%p, magic-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet header field type: `magic` field must be an unsigned integer field type: "
                                "magic-ft-addr=%p", field_type);
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_get_size(field_type) != 32) {
+               if (bt_field_type_integer_get_size(field_type) != 32) {
                        BT_LOGW("Invalid packet header field type: `magic` field must be a 32-bit unsigned integer field type: "
                                "magic-ft-addr=%p, magic-ft-size=%u",
                                field_type,
-                               bt_ctf_field_type_integer_get_size(field_type));
+                               bt_field_type_integer_get_size(field_type));
                        goto invalid;
                }
 
-               ret = bt_ctf_field_type_structure_get_field_by_index(
+               ret = bt_field_type_structure_get_field_by_index(
                        packet_header_type, &field_name, NULL, 0);
                assert(ret == 0);
 
@@ -722,51 +722,51 @@ bool packet_header_field_type_is_valid(struct bt_ctf_trace *trace,
         * If there's a `uuid` field, it must be an array field type of
         * length 16 with an 8-bit unsigned integer element field type.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_header_type, "uuid");
        if (field_type) {
-               struct bt_ctf_field_type *elem_ft;
+               struct bt_field_type *elem_ft;
 
-               if (!bt_ctf_field_type_is_array(field_type)) {
+               if (!bt_field_type_is_array(field_type)) {
                        BT_LOGW("Invalid packet header field type: `uuid` field must be an array field type: "
                                "uuid-ft-addr=%p, uuid-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_array_get_length(field_type) != 16) {
+               if (bt_field_type_array_get_length(field_type) != 16) {
                        BT_LOGW("Invalid packet header field type: `uuid` array field type's length must be 16: "
                                "uuid-ft-addr=%p, uuid-ft-length=%" PRId64,
                                field_type,
-                               bt_ctf_field_type_array_get_length(field_type));
+                               bt_field_type_array_get_length(field_type));
                        goto invalid;
                }
 
-               elem_ft = bt_ctf_field_type_array_get_element_type(field_type);
+               elem_ft = bt_field_type_array_get_element_type(field_type);
                assert(elem_ft);
 
-               if (!bt_ctf_field_type_is_integer(elem_ft)) {
+               if (!bt_field_type_is_integer(elem_ft)) {
                        BT_LOGW("Invalid packet header field type: `uuid` field's element field type must be an integer field type: "
                                "elem-ft-addr=%p, elem-ft-id=%s",
                                elem_ft,
-                               bt_ctf_field_type_id_string(elem_ft->id));
+                               bt_field_type_id_string(elem_ft->id));
                        bt_put(elem_ft);
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(elem_ft)) {
+               if (bt_field_type_integer_is_signed(elem_ft)) {
                        BT_LOGW("Invalid packet header field type: `uuid` field's element field type must be an unsigned integer field type: "
                                "elem-ft-addr=%p", elem_ft);
                        bt_put(elem_ft);
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_get_size(elem_ft) != 8) {
+               if (bt_field_type_integer_get_size(elem_ft) != 8) {
                        BT_LOGW("Invalid packet header field type: `uuid` field's element field type must be an 8-bit unsigned integer field type: "
                                "elem-ft-addr=%p, elem-ft-size=%u",
                                elem_ft,
-                               bt_ctf_field_type_integer_get_size(elem_ft));
+                               bt_field_type_integer_get_size(elem_ft));
                        bt_put(elem_ft);
                        goto invalid;
                }
@@ -779,7 +779,7 @@ bool packet_header_field_type_is_valid(struct bt_ctf_trace *trace,
         * The `stream_id` field must exist if there's more than one
         * stream classes in the trace.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_header_type, "stream_id");
 
        if (!field_type && trace->stream_classes->len >= 1) {
@@ -793,15 +793,15 @@ bool packet_header_field_type_is_valid(struct bt_ctf_trace *trace,
         * integer field type.
         */
        if (field_type) {
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet header field type: `stream_id` field must be an integer field type: "
                                "stream-id-ft-addr=%p, stream-id-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet header field type: `stream_id` field must be an unsigned integer field type: "
                                "stream-id-ft-addr=%p", field_type);
                        goto invalid;
@@ -814,18 +814,18 @@ bool packet_header_field_type_is_valid(struct bt_ctf_trace *trace,
         * If there's a `packet_seq_num` field, it must be an unsigned
         * integer field type.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_header_type, "packet_seq_num");
        if (field_type) {
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet header field type: `packet_seq_num` field must be an integer field type: "
                                "stream-id-ft-addr=%p, packet-seq-num-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet header field type: `packet_seq_num` field must be an unsigned integer field type: "
                                "packet-seq-num-ft-addr=%p", field_type);
                        goto invalid;
@@ -845,12 +845,12 @@ end:
 }
 
 static
-bool packet_context_field_type_is_valid(struct bt_ctf_trace *trace,
-               struct bt_ctf_stream_class *stream_class,
-               struct bt_ctf_field_type *packet_context_type)
+bool packet_context_field_type_is_valid(struct bt_trace *trace,
+               struct bt_stream_class *stream_class,
+               struct bt_field_type *packet_context_type)
 {
        bool is_valid = true;
-       struct bt_ctf_field_type *field_type = NULL;
+       struct bt_field_type *field_type = NULL;
 
        if (!packet_context_type) {
                /* No packet context field type: valid at this point */
@@ -858,11 +858,11 @@ bool packet_context_field_type_is_valid(struct bt_ctf_trace *trace,
        }
 
        /* Packet context field type, if it exists, must be a structure */
-       if (!bt_ctf_field_type_is_structure(packet_context_type)) {
+       if (!bt_field_type_is_structure(packet_context_type)) {
                BT_LOGW("Invalid packet context field type: must be a structure field type if it exists: "
                        "ft-addr=%p, ft-id=%s",
                        packet_context_type,
-                       bt_ctf_field_type_id_string(packet_context_type->id));
+                       bt_field_type_id_string(packet_context_type->id));
                goto invalid;
        }
 
@@ -870,18 +870,18 @@ bool packet_context_field_type_is_valid(struct bt_ctf_trace *trace,
         * If there's a `packet_size` field, it must be an unsigned
         * integer field type.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_context_type, "packet_size");
        if (field_type) {
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet context field type: `packet_size` field must be an integer field type: "
                                "packet-size-ft-addr=%p, packet-size-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet context field type: `packet_size` field must be an unsigned integer field type: "
                                "packet-size-ft-addr=%p", field_type);
                        goto invalid;
@@ -894,18 +894,18 @@ bool packet_context_field_type_is_valid(struct bt_ctf_trace *trace,
         * If there's a `content_size` field, it must be an unsigned
         * integer field type.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_context_type, "content_size");
        if (field_type) {
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet context field type: `content_size` field must be an integer field type: "
                                "content-size-ft-addr=%p, content-size-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet context field type: `content_size` field must be an unsigned integer field type: "
                                "content-size-ft-addr=%p", field_type);
                        goto invalid;
@@ -918,18 +918,18 @@ bool packet_context_field_type_is_valid(struct bt_ctf_trace *trace,
         * If there's a `events_discarded` field, it must be an unsigned
         * integer field type.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_context_type, "events_discarded");
        if (field_type) {
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet context field type: `events_discarded` field must be an integer field type: "
                                "events-discarded-ft-addr=%p, events-discarded-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet context field type: `events_discarded` field must be an unsigned integer field type: "
                                "events-discarded-ft-addr=%p", field_type);
                        goto invalid;
@@ -944,26 +944,26 @@ bool packet_context_field_type_is_valid(struct bt_ctf_trace *trace,
         * trace, then we cannot automatically set the mapped clock
         * class of this field, so it must have a mapped clock class.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_context_type, "timestamp_begin");
        if (field_type) {
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet context field type: `timestamp_begin` field must be an integer field type: "
                                "timestamp-begin-ft-addr=%p, timestamp-begin-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet context field type: `timestamp_begin` field must be an unsigned integer field type: "
                                "timestamp-begin-ft-addr=%p", field_type);
                        goto invalid;
                }
 
                if (!trace->is_created_by_writer) {
-                       struct bt_ctf_clock_class *clock_class =
-                               bt_ctf_field_type_integer_get_mapped_clock_class(
+                       struct bt_clock_class *clock_class =
+                               bt_field_type_integer_get_mapped_clock_class(
                                        field_type);
 
                        bt_put(clock_class);
@@ -983,26 +983,26 @@ bool packet_context_field_type_is_valid(struct bt_ctf_trace *trace,
         * trace, then we cannot automatically set the mapped clock
         * class of this field, so it must have a mapped clock class.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                packet_context_type, "timestamp_end");
        if (field_type) {
-               if (!bt_ctf_field_type_is_integer(field_type)) {
+               if (!bt_field_type_is_integer(field_type)) {
                        BT_LOGW("Invalid packet context field type: `timestamp_end` field must be an integer field type: "
                                "timestamp-end-ft-addr=%p, timestamp-end-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
-               if (bt_ctf_field_type_integer_is_signed(field_type)) {
+               if (bt_field_type_integer_is_signed(field_type)) {
                        BT_LOGW("Invalid packet context field type: `timestamp_end` field must be an unsigned integer field type: "
                                "timestamp-end-ft-addr=%p", field_type);
                        goto invalid;
                }
 
                if (!trace->is_created_by_writer) {
-                       struct bt_ctf_clock_class *clock_class =
-                               bt_ctf_field_type_integer_get_mapped_clock_class(
+                       struct bt_clock_class *clock_class =
+                               bt_field_type_integer_get_mapped_clock_class(
                                        field_type);
 
                        bt_put(clock_class);
@@ -1027,12 +1027,12 @@ end:
 }
 
 static
-bool event_header_field_type_is_valid(struct bt_ctf_trace *trace,
-               struct bt_ctf_stream_class *stream_class,
-               struct bt_ctf_field_type *event_header_type)
+bool event_header_field_type_is_valid(struct bt_trace *trace,
+               struct bt_stream_class *stream_class,
+               struct bt_field_type *event_header_type)
 {
        bool is_valid = true;
-       struct bt_ctf_field_type *field_type = NULL;
+       struct bt_field_type *field_type = NULL;
 
        /*
         * We do not validate that the `timestamp` field exists here
@@ -1045,7 +1045,7 @@ bool event_header_field_type_is_valid(struct bt_ctf_trace *trace,
                 * No event header field type: stream class must have
                 * only one event class.
                 */
-               if (bt_ctf_stream_class_get_event_class_count(stream_class) > 1) {
+               if (bt_stream_class_get_event_class_count(stream_class) > 1) {
                        BT_LOGW_STR("Invalid event header field type: "
                                "event header field type does not exist but there's more than one event class in the stream class.");
                        goto invalid;
@@ -1056,11 +1056,11 @@ bool event_header_field_type_is_valid(struct bt_ctf_trace *trace,
        }
 
        /* Event header field type, if it exists, must be a structure */
-       if (!bt_ctf_field_type_is_structure(event_header_type)) {
+       if (!bt_field_type_is_structure(event_header_type)) {
                BT_LOGW("Invalid event header field type: must be a structure field type if it exists: "
                        "ft-addr=%p, ft-id=%s",
                        event_header_type,
-                       bt_ctf_field_type_id_string(event_header_type->id));
+                       bt_field_type_id_string(event_header_type->id));
                goto invalid;
        }
 
@@ -1069,26 +1069,26 @@ bool event_header_field_type_is_valid(struct bt_ctf_trace *trace,
         * field type or an enumeration field type with an unsigned
         * integer container field type.
         */
-       field_type = bt_ctf_field_type_structure_get_field_type_by_name(
+       field_type = bt_field_type_structure_get_field_type_by_name(
                event_header_type, "id");
        if (field_type) {
-               struct bt_ctf_field_type *int_ft;
+               struct bt_field_type *int_ft;
 
-               if (bt_ctf_field_type_is_integer(field_type)) {
+               if (bt_field_type_is_integer(field_type)) {
                        int_ft = bt_get(field_type);
-               } else if (bt_ctf_field_type_is_enumeration(field_type)) {
-                       int_ft = bt_ctf_field_type_enumeration_get_container_type(
+               } else if (bt_field_type_is_enumeration(field_type)) {
+                       int_ft = bt_field_type_enumeration_get_container_type(
                                field_type);
                } else {
                        BT_LOGW("Invalid event header field type: `id` field must be an integer or enumeration field type: "
                                "id-ft-addr=%p, id-ft-id=%s",
                                field_type,
-                               bt_ctf_field_type_id_string(field_type->id));
+                               bt_field_type_id_string(field_type->id));
                        goto invalid;
                }
 
                assert(int_ft);
-               if (bt_ctf_field_type_integer_is_signed(int_ft)) {
+               if (bt_field_type_integer_is_signed(int_ft)) {
                        BT_LOGW("Invalid event header field type: `id` field must be an unsigned integer or enumeration field type: "
                                "id-ft-addr=%p", int_ft);
                        goto invalid;
@@ -1108,25 +1108,25 @@ end:
        return is_valid;
 }
 
-int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
-               struct bt_ctf_stream_class *stream_class)
+int bt_trace_add_stream_class(struct bt_trace *trace,
+               struct bt_stream_class *stream_class)
 {
        int ret;
        int64_t i;
        int64_t stream_id;
-       struct bt_ctf_validation_output trace_sc_validation_output = { 0 };
-       struct bt_ctf_validation_output *ec_validation_outputs = NULL;
-       const enum bt_ctf_validation_flag trace_sc_validation_flags =
-               BT_CTF_VALIDATION_FLAG_TRACE |
-               BT_CTF_VALIDATION_FLAG_STREAM;
-       const enum bt_ctf_validation_flag ec_validation_flags =
-               BT_CTF_VALIDATION_FLAG_EVENT;
-       struct bt_ctf_field_type *packet_header_type = NULL;
-       struct bt_ctf_field_type *packet_context_type = NULL;
-       struct bt_ctf_field_type *event_header_type = NULL;
-       struct bt_ctf_field_type *stream_event_ctx_type = NULL;
+       struct bt_validation_output trace_sc_validation_output = { 0 };
+       struct bt_validation_output *ec_validation_outputs = NULL;
+       const enum bt_validation_flag trace_sc_validation_flags =
+               BT_VALIDATION_FLAG_TRACE |
+               BT_VALIDATION_FLAG_STREAM;
+       const enum bt_validation_flag ec_validation_flags =
+               BT_VALIDATION_FLAG_EVENT;
+       struct bt_field_type *packet_header_type = NULL;
+       struct bt_field_type *packet_context_type = NULL;
+       struct bt_field_type *event_header_type = NULL;
+       struct bt_field_type *stream_event_ctx_type = NULL;
        int64_t event_class_count;
-       struct bt_ctf_trace *current_parent_trace = NULL;
+       struct bt_trace *current_parent_trace = NULL;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -1150,28 +1150,28 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                "trace-addr=%p, trace-name=\"%s\", "
                "stream-class-addr=%p, stream-class-name=\"%s\", "
                "stream-class-id=%" PRId64,
-               trace, bt_ctf_trace_get_name(trace),
-               stream_class, bt_ctf_stream_class_get_name(stream_class),
-               bt_ctf_stream_class_get_id(stream_class));
+               trace, bt_trace_get_name(trace),
+               stream_class, bt_stream_class_get_name(stream_class),
+               bt_stream_class_get_id(stream_class));
 
-       current_parent_trace = bt_ctf_stream_class_get_trace(stream_class);
+       current_parent_trace = bt_stream_class_get_trace(stream_class);
        if (current_parent_trace) {
                /* Stream class is already associated to a trace, abort. */
                BT_LOGW("Invalid parameter: stream class is already part of a trace: "
                        "stream-class-trace-addr=%p, "
                        "stream-class-trace-name=\"%s\"",
                        current_parent_trace,
-                       bt_ctf_trace_get_name(current_parent_trace));
+                       bt_trace_get_name(current_parent_trace));
                ret = -1;
                goto end;
        }
 
        event_class_count =
-               bt_ctf_stream_class_get_event_class_count(stream_class);
+               bt_stream_class_get_event_class_count(stream_class);
        assert(event_class_count >= 0);
 
        if (stream_class->clock) {
-               struct bt_ctf_clock_class *stream_clock_class =
+               struct bt_clock_class *stream_clock_class =
                        stream_class->clock->clock_class;
 
                if (trace->is_created_by_writer) {
@@ -1195,7 +1195,7 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                                BT_LOGW("Stream class's clock's class is not part of the trace: "
                                        "clock-class-addr=%p, clock-class-name=\"%s\"",
                                        stream_clock_class,
-                                       bt_ctf_clock_class_get_name(stream_clock_class));
+                                       bt_clock_class_get_name(stream_clock_class));
                                ret = -1;
                                goto end;
                        }
@@ -1210,7 +1210,7 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                        BT_LOGW("Cannot add stream class with a clock to a trace which was not created by a CTF writer object: "
                                "clock-class-addr=%p, clock-class-name=\"%s\"",
                                stream_clock_class,
-                               bt_ctf_clock_class_get_name(stream_clock_class));
+                               bt_clock_class_get_name(stream_clock_class));
                        ret = -1;
                        goto end;
                }
@@ -1228,16 +1228,16 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
         * class of this stream class can be validated individually.
         */
        packet_header_type =
-               bt_ctf_trace_get_packet_header_type(trace);
+               bt_trace_get_packet_header_type(trace);
        packet_context_type =
-               bt_ctf_stream_class_get_packet_context_type(stream_class);
+               bt_stream_class_get_packet_context_type(stream_class);
        event_header_type =
-               bt_ctf_stream_class_get_event_header_type(stream_class);
+               bt_stream_class_get_event_header_type(stream_class);
        stream_event_ctx_type =
-               bt_ctf_stream_class_get_event_context_type(stream_class);
+               bt_stream_class_get_event_context_type(stream_class);
 
        BT_LOGD("Validating trace and stream class field types.");
-       ret = bt_ctf_validate_class_types(trace->environment,
+       ret = bt_validate_class_types(trace->environment,
                packet_header_type, packet_context_type, event_header_type,
                stream_event_ctx_type, NULL, NULL, trace->valid,
                stream_class->valid, 1, &trace_sc_validation_output,
@@ -1269,7 +1269,7 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
        }
 
        if (event_class_count > 0) {
-               ec_validation_outputs = g_new0(struct bt_ctf_validation_output,
+               ec_validation_outputs = g_new0(struct bt_validation_output,
                        event_class_count);
                if (!ec_validation_outputs) {
                        BT_LOGE_STR("Failed to allocate one validation output structure.");
@@ -1280,16 +1280,16 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
 
        /* Validate each event class individually */
        for (i = 0; i < event_class_count; i++) {
-               struct bt_ctf_event_class *event_class =
-                       bt_ctf_stream_class_get_event_class_by_index(
+               struct bt_event_class *event_class =
+                       bt_stream_class_get_event_class_by_index(
                                stream_class, i);
-               struct bt_ctf_field_type *event_context_type = NULL;
-               struct bt_ctf_field_type *event_payload_type = NULL;
+               struct bt_field_type *event_context_type = NULL;
+               struct bt_field_type *event_payload_type = NULL;
 
                event_context_type =
-                       bt_ctf_event_class_get_context_type(event_class);
+                       bt_event_class_get_context_type(event_class);
                event_payload_type =
-                       bt_ctf_event_class_get_payload_type(event_class);
+                       bt_event_class_get_payload_type(event_class);
 
                /*
                 * It is important to use the field types returned by
@@ -1298,9 +1298,9 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                 */
                BT_LOGD("Validating event class's field types: "
                        "addr=%p, name=\"%s\", id=%" PRId64,
-                       event_class, bt_ctf_event_class_get_name(event_class),
-                       bt_ctf_event_class_get_id(event_class));
-               ret = bt_ctf_validate_class_types(trace->environment,
+                       event_class, bt_event_class_get_name(event_class),
+                       bt_event_class_get_id(event_class));
+               ret = bt_validate_class_types(trace->environment,
                        trace_sc_validation_output.packet_header_type,
                        trace_sc_validation_output.packet_context_type,
                        trace_sc_validation_output.event_header_type,
@@ -1329,7 +1329,7 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                }
        }
 
-       stream_id = bt_ctf_stream_class_get_id(stream_class);
+       stream_id = bt_stream_class_get_id(stream_class);
        if (stream_id < 0) {
                stream_id = trace->next_stream_id++;
                if (stream_id < 0) {
@@ -1340,7 +1340,7 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
 
                /* Try to assign a new stream id */
                for (i = 0; i < trace->stream_classes->len; i++) {
-                       if (stream_id == bt_ctf_stream_class_get_id(
+                       if (stream_id == bt_stream_class_get_id(
                                trace->stream_classes->pdata[i])) {
                                /* Duplicate stream id found */
                                BT_LOGW("Duplicate stream class ID: "
@@ -1350,7 +1350,7 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
                        }
                }
 
-               if (bt_ctf_stream_class_set_id_no_check(stream_class,
+               if (bt_stream_class_set_id_no_check(stream_class,
                                stream_id)) {
                        /* TODO Should retry with a different stream id */
                        BT_LOGE("Cannot set stream class's ID: "
@@ -1398,7 +1398,7 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
         * to map those field types to other clock classes.
         */
        if (trace->is_created_by_writer) {
-               if (bt_ctf_stream_class_map_clock_class(stream_class,
+               if (bt_stream_class_map_clock_class(stream_class,
                                trace_sc_validation_output.packet_context_type,
                                trace_sc_validation_output.event_header_type)) {
                        BT_LOGW_STR("Cannot automatically map selected stream class's field types to stream class's clock's class.");
@@ -1418,49 +1418,49 @@ int bt_ctf_trace_add_stream_class(struct bt_ctf_trace *trace,
         * all the event classes of the stream class and mark them as
         * valid.
         */
-       bt_ctf_validation_replace_types(trace, stream_class, NULL,
+       bt_validation_replace_types(trace, stream_class, NULL,
                &trace_sc_validation_output, trace_sc_validation_flags);
        trace->valid = 1;
        stream_class->valid = 1;
 
        /*
-        * Put what was not moved in bt_ctf_validation_replace_types().
+        * Put what was not moved in bt_validation_replace_types().
         */
-       bt_ctf_validation_output_put_types(&trace_sc_validation_output);
+       bt_validation_output_put_types(&trace_sc_validation_output);
 
        for (i = 0; i < event_class_count; i++) {
-               struct bt_ctf_event_class *event_class =
-                       bt_ctf_stream_class_get_event_class_by_index(
+               struct bt_event_class *event_class =
+                       bt_stream_class_get_event_class_by_index(
                                stream_class, i);
 
-               bt_ctf_validation_replace_types(NULL, NULL, event_class,
+               bt_validation_replace_types(NULL, NULL, event_class,
                        &ec_validation_outputs[i], ec_validation_flags);
                event_class->valid = 1;
                BT_PUT(event_class);
 
                /*
                 * Put what was not moved in
-                * bt_ctf_validation_replace_types().
+                * bt_validation_replace_types().
                 */
-               bt_ctf_validation_output_put_types(&ec_validation_outputs[i]);
+               bt_validation_output_put_types(&ec_validation_outputs[i]);
        }
 
        /*
         * Freeze the trace and the stream class.
         */
-       bt_ctf_stream_class_freeze(stream_class);
-       bt_ctf_trace_freeze(trace);
+       bt_stream_class_freeze(stream_class);
+       bt_trace_freeze(trace);
 
        /* Notifiy listeners of the trace's schema modification. */
-       bt_ctf_stream_class_visit(stream_class,
-                       bt_ctf_trace_object_modification, trace);
+       bt_stream_class_visit(stream_class,
+                       bt_trace_object_modification, trace);
        BT_LOGD("Added stream class to trace: "
                "trace-addr=%p, trace-name=\"%s\", "
                "stream-class-addr=%p, stream-class-name=\"%s\", "
                "stream-class-id=%" PRId64,
-               trace, bt_ctf_trace_get_name(trace),
-               stream_class, bt_ctf_stream_class_get_name(stream_class),
-               bt_ctf_stream_class_get_id(stream_class));
+               trace, bt_trace_get_name(trace),
+               stream_class, bt_stream_class_get_name(stream_class),
+               bt_stream_class_get_id(stream_class));
 
 end:
        if (ret) {
@@ -1468,14 +1468,14 @@ end:
 
                if (ec_validation_outputs) {
                        for (i = 0; i < event_class_count; i++) {
-                               bt_ctf_validation_output_put_types(
+                               bt_validation_output_put_types(
                                        &ec_validation_outputs[i]);
                        }
                }
        }
 
        g_free(ec_validation_outputs);
-       bt_ctf_validation_output_put_types(&trace_sc_validation_output);
+       bt_validation_output_put_types(&trace_sc_validation_output);
        bt_put(current_parent_trace);
        assert(!packet_header_type);
        assert(!packet_context_type);
@@ -1484,7 +1484,7 @@ end:
        return ret;
 }
 
-int64_t bt_ctf_trace_get_stream_count(struct bt_ctf_trace *trace)
+int64_t bt_trace_get_stream_count(struct bt_trace *trace)
 {
        int64_t ret;
 
@@ -1500,11 +1500,11 @@ end:
        return ret;
 }
 
-struct bt_ctf_stream *bt_ctf_trace_get_stream_by_index(
-               struct bt_ctf_trace *trace,
+struct bt_stream *bt_trace_get_stream_by_index(
+               struct bt_trace *trace,
                uint64_t index)
 {
-       struct bt_ctf_stream *stream = NULL;
+       struct bt_stream *stream = NULL;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -1515,7 +1515,7 @@ struct bt_ctf_stream *bt_ctf_trace_get_stream_by_index(
                BT_LOGW("Invalid parameter: index is out of bounds: "
                        "addr=%p, name=\"%s\", "
                        "index=%" PRIu64 ", count=%u",
-                       trace, bt_ctf_trace_get_name(trace),
+                       trace, bt_trace_get_name(trace),
                        index, trace->streams->len);
                goto end;
        }
@@ -1526,7 +1526,7 @@ end:
        return stream;
 }
 
-int64_t bt_ctf_trace_get_stream_class_count(struct bt_ctf_trace *trace)
+int64_t bt_trace_get_stream_class_count(struct bt_trace *trace)
 {
        int64_t ret;
 
@@ -1541,10 +1541,10 @@ end:
        return ret;
 }
 
-struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_index(
-               struct bt_ctf_trace *trace, uint64_t index)
+struct bt_stream_class *bt_trace_get_stream_class_by_index(
+               struct bt_trace *trace, uint64_t index)
 {
-       struct bt_ctf_stream_class *stream_class = NULL;
+       struct bt_stream_class *stream_class = NULL;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -1555,7 +1555,7 @@ struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_index(
                BT_LOGW("Invalid parameter: index is out of bounds: "
                        "addr=%p, name=\"%s\", "
                        "index=%" PRIu64 ", count=%u",
-                       trace, bt_ctf_trace_get_name(trace),
+                       trace, bt_trace_get_name(trace),
                        index, trace->stream_classes->len);
                goto end;
        }
@@ -1566,11 +1566,11 @@ end:
        return stream_class;
 }
 
-struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id(
-               struct bt_ctf_trace *trace, uint64_t id_param)
+struct bt_stream_class *bt_trace_get_stream_class_by_id(
+               struct bt_trace *trace, uint64_t id_param)
 {
        int i;
-       struct bt_ctf_stream_class *stream_class = NULL;
+       struct bt_stream_class *stream_class = NULL;
        int64_t id = (int64_t) id_param;
 
        if (!trace) {
@@ -1581,17 +1581,17 @@ struct bt_ctf_stream_class *bt_ctf_trace_get_stream_class_by_id(
        if (id < 0) {
                BT_LOGW("Invalid parameter: invalid stream class's ID: "
                        "trace-addr=%p, trace-name=\"%s\", id=%" PRIu64,
-                       trace, bt_ctf_trace_get_name(trace), id_param);
+                       trace, bt_trace_get_name(trace), id_param);
                goto end;
        }
 
        for (i = 0; i < trace->stream_classes->len; i++) {
-               struct bt_ctf_stream_class *stream_class_candidate;
+               struct bt_stream_class *stream_class_candidate;
 
                stream_class_candidate =
                        g_ptr_array_index(trace->stream_classes, i);
 
-               if (bt_ctf_stream_class_get_id(stream_class_candidate) ==
+               if (bt_stream_class_get_id(stream_class_candidate) ==
                                (int64_t) id) {
                        stream_class = stream_class_candidate;
                        bt_get(stream_class);
@@ -1603,11 +1603,11 @@ end:
        return stream_class;
 }
 
-struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_name(
-               struct bt_ctf_trace *trace, const char *name)
+struct bt_clock_class *bt_trace_get_clock_class_by_name(
+               struct bt_trace *trace, const char *name)
 {
        size_t i;
-       struct bt_ctf_clock_class *clock_class = NULL;
+       struct bt_clock_class *clock_class = NULL;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -1620,9 +1620,9 @@ struct bt_ctf_clock_class *bt_ctf_trace_get_clock_class_by_name(
        }
 
        for (i = 0; i < trace->clocks->len; i++) {
-               struct bt_ctf_clock_class *cur_clk =
+               struct bt_clock_class *cur_clk =
                        g_ptr_array_index(trace->clocks, i);
-               const char *cur_clk_name = bt_ctf_clock_class_get_name(cur_clk);
+               const char *cur_clk_name = bt_clock_class_get_name(cur_clk);
 
                if (!cur_clk_name) {
                        goto end;
@@ -1640,8 +1640,8 @@ end:
 }
 
 BT_HIDDEN
-bt_bool bt_ctf_trace_has_clock_class(struct bt_ctf_trace *trace,
-               struct bt_ctf_clock_class *clock_class)
+bt_bool bt_trace_has_clock_class(struct bt_trace *trace,
+               struct bt_clock_class *clock_class)
 {
        struct search_query query = { .value = clock_class, .found = 0 };
 
@@ -1653,18 +1653,18 @@ bt_bool bt_ctf_trace_has_clock_class(struct bt_ctf_trace *trace,
 }
 
 BT_HIDDEN
-const char *get_byte_order_string(enum bt_ctf_byte_order byte_order)
+const char *get_byte_order_string(enum bt_byte_order byte_order)
 {
        const char *string;
 
        switch (byte_order) {
-       case BT_CTF_BYTE_ORDER_LITTLE_ENDIAN:
+       case BT_BYTE_ORDER_LITTLE_ENDIAN:
                string = "le";
                break;
-       case BT_CTF_BYTE_ORDER_BIG_ENDIAN:
+       case BT_BYTE_ORDER_BIG_ENDIAN:
                string = "be";
                break;
-       case BT_CTF_BYTE_ORDER_NATIVE:
+       case BT_BYTE_ORDER_NATIVE:
                string = "native";
                break;
        default:
@@ -1675,18 +1675,18 @@ const char *get_byte_order_string(enum bt_ctf_byte_order byte_order)
 }
 
 static
-int append_trace_metadata(struct bt_ctf_trace *trace,
+int append_trace_metadata(struct bt_trace *trace,
                struct metadata_context *context)
 {
        unsigned char *uuid = trace->uuid;
        int ret = 0;
 
-       if (trace->native_byte_order == BT_CTF_BYTE_ORDER_NATIVE ||
-                       trace->native_byte_order == BT_CTF_BYTE_ORDER_UNSPECIFIED) {
-               BT_LOGW("Invalid parameter: trace's byte order cannot be BT_CTF_BYTE_ORDER_NATIVE or BT_CTF_BYTE_ORDER_UNSPECIFIED at this point; "
-                       "set it with bt_ctf_trace_set_native_byte_order(): "
+       if (trace->native_byte_order == BT_BYTE_ORDER_NATIVE ||
+                       trace->native_byte_order == BT_BYTE_ORDER_UNSPECIFIED) {
+               BT_LOGW("Invalid parameter: trace's byte order cannot be BT_BYTE_ORDER_NATIVE or BT_BYTE_ORDER_UNSPECIFIED at this point; "
+                       "set it with bt_trace_set_native_byte_order(): "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
@@ -1694,9 +1694,9 @@ int append_trace_metadata(struct bt_ctf_trace *trace,
        g_string_append(context->string, "trace {\n");
        g_string_append(context->string, "\tmajor = 1;\n");
        g_string_append(context->string, "\tminor = 8;\n");
-       assert(trace->native_byte_order == BT_CTF_BYTE_ORDER_LITTLE_ENDIAN ||
-               trace->native_byte_order == BT_CTF_BYTE_ORDER_BIG_ENDIAN ||
-               trace->native_byte_order == BT_CTF_BYTE_ORDER_NETWORK);
+       assert(trace->native_byte_order == BT_BYTE_ORDER_LITTLE_ENDIAN ||
+               trace->native_byte_order == BT_BYTE_ORDER_BIG_ENDIAN ||
+               trace->native_byte_order == BT_BYTE_ORDER_NETWORK);
 
        if (trace->uuid_set) {
                g_string_append_printf(context->string,
@@ -1715,7 +1715,7 @@ int append_trace_metadata(struct bt_ctf_trace *trace,
                context->current_indentation_level++;
                g_string_assign(context->field_name, "");
                BT_LOGD_STR("Serializing trace's packet header field type's metadata.");
-               ret = bt_ctf_field_type_serialize(trace->packet_header_type,
+               ret = bt_field_type_serialize(trace->packet_header_type,
                        context);
                if (ret) {
                        goto end;
@@ -1729,13 +1729,13 @@ end:
 }
 
 static
-void append_env_metadata(struct bt_ctf_trace *trace,
+void append_env_metadata(struct bt_trace *trace,
                struct metadata_context *context)
 {
        int64_t i;
        int64_t env_size;
 
-       env_size = bt_ctf_attributes_get_count(trace->environment);
+       env_size = bt_attributes_get_count(trace->environment);
        if (env_size <= 0) {
                return;
        }
@@ -1746,9 +1746,9 @@ void append_env_metadata(struct bt_ctf_trace *trace,
                struct bt_value *env_field_value_obj = NULL;
                const char *entry_name;
 
-               entry_name = bt_ctf_attributes_get_field_name(
+               entry_name = bt_attributes_get_field_name(
                        trace->environment, i);
-               env_field_value_obj = bt_ctf_attributes_get_field_value(
+               env_field_value_obj = bt_attributes_get_field_value(
                        trace->environment, i);
 
                assert(entry_name);
@@ -1800,7 +1800,7 @@ loop_next:
        g_string_append(context->string, "};\n\n");
 }
 
-char *bt_ctf_trace_get_metadata_string(struct bt_ctf_trace *trace)
+char *bt_trace_get_metadata_string(struct bt_trace *trace)
 {
        char *metadata = NULL;
        struct metadata_context *context = NULL;
@@ -1827,14 +1827,14 @@ char *bt_ctf_trace_get_metadata_string(struct bt_ctf_trace *trace)
        }
        append_env_metadata(trace, context);
        g_ptr_array_foreach(trace->clocks,
-               (GFunc)bt_ctf_clock_class_serialize, context);
+               (GFunc)bt_clock_class_serialize, context);
 
        for (i = 0; i < trace->stream_classes->len; i++) {
-               /* bt_ctf_stream_class_serialize() logs details */
-               err = bt_ctf_stream_class_serialize(
+               /* bt_stream_class_serialize() logs details */
+               err = bt_stream_class_serialize(
                        trace->stream_classes->pdata[i], context);
                if (err) {
-                       /* bt_ctf_stream_class_serialize() logs errors */
+                       /* bt_stream_class_serialize() logs errors */
                        goto error;
                }
        }
@@ -1850,10 +1850,10 @@ end:
        return metadata;
 }
 
-enum bt_ctf_byte_order bt_ctf_trace_get_native_byte_order(
-               struct bt_ctf_trace *trace)
+enum bt_byte_order bt_trace_get_native_byte_order(
+               struct bt_trace *trace)
 {
-       enum bt_ctf_byte_order ret = BT_CTF_BYTE_ORDER_UNKNOWN;
+       enum bt_byte_order ret = BT_BYTE_ORDER_UNKNOWN;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -1866,8 +1866,8 @@ end:
        return ret;
 }
 
-int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace,
-               enum bt_ctf_byte_order byte_order)
+int bt_trace_set_native_byte_order(struct bt_trace *trace,
+               enum bt_byte_order byte_order)
 {
        int ret = 0;
 
@@ -1880,27 +1880,27 @@ int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace,
        if (trace->frozen) {
                BT_LOGW("Invalid parameter: trace is frozen: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
 
        if (trace->is_created_by_writer &&
-                       byte_order == BT_CTF_BYTE_ORDER_UNSPECIFIED) {
-               BT_LOGW("Invalid parameter: BT_CTF_BYTE_ORDER_UNSPECIFIED byte order is not allowed for a CTF writer trace: "
+                       byte_order == BT_BYTE_ORDER_UNSPECIFIED) {
+               BT_LOGW("Invalid parameter: BT_BYTE_ORDER_UNSPECIFIED byte order is not allowed for a CTF writer trace: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
 
-       if (byte_order != BT_CTF_BYTE_ORDER_LITTLE_ENDIAN &&
-                       byte_order != BT_CTF_BYTE_ORDER_BIG_ENDIAN &&
-                       byte_order != BT_CTF_BYTE_ORDER_NETWORK) {
+       if (byte_order != BT_BYTE_ORDER_LITTLE_ENDIAN &&
+                       byte_order != BT_BYTE_ORDER_BIG_ENDIAN &&
+                       byte_order != BT_BYTE_ORDER_NETWORK) {
                BT_LOGW("Invalid parameter: invalid byte order: "
                        "addr=%p, name=\"%s\", bo=%s",
-                       trace, bt_ctf_trace_get_name(trace),
-                       bt_ctf_byte_order_string(byte_order));
+                       trace, bt_trace_get_name(trace),
+                       bt_byte_order_string(byte_order));
                ret = -1;
                goto end;
        }
@@ -1908,17 +1908,17 @@ int bt_ctf_trace_set_native_byte_order(struct bt_ctf_trace *trace,
        trace->native_byte_order = byte_order;
        BT_LOGV("Set trace's native byte order: "
                "addr=%p, name=\"%s\", bo=%s",
-               trace, bt_ctf_trace_get_name(trace),
-               bt_ctf_byte_order_string(byte_order));
+               trace, bt_trace_get_name(trace),
+               bt_byte_order_string(byte_order));
 
 end:
        return ret;
 }
 
-struct bt_ctf_field_type *bt_ctf_trace_get_packet_header_type(
-               struct bt_ctf_trace *trace)
+struct bt_field_type *bt_trace_get_packet_header_type(
+               struct bt_trace *trace)
 {
-       struct bt_ctf_field_type *field_type = NULL;
+       struct bt_field_type *field_type = NULL;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -1931,8 +1931,8 @@ end:
        return field_type;
 }
 
-int bt_ctf_trace_set_packet_header_type(struct bt_ctf_trace *trace,
-               struct bt_ctf_field_type *packet_header_type)
+int bt_trace_set_packet_header_type(struct bt_trace *trace,
+               struct bt_field_type *packet_header_type)
 {
        int ret = 0;
 
@@ -1945,19 +1945,19 @@ int bt_ctf_trace_set_packet_header_type(struct bt_ctf_trace *trace,
        if (trace->frozen) {
                BT_LOGW("Invalid parameter: trace is frozen: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                ret = -1;
                goto end;
        }
 
        /* packet_header_type must be a structure. */
        if (packet_header_type &&
-                       !bt_ctf_field_type_is_structure(packet_header_type)) {
+                       !bt_field_type_is_structure(packet_header_type)) {
                BT_LOGW("Invalid parameter: packet header field type must be a structure field type if it exists: "
                        "addr=%p, name=\"%s\", ft-addr=%p, ft-id=%s",
-                       trace, bt_ctf_trace_get_name(trace),
+                       trace, bt_trace_get_name(trace),
                        packet_header_type,
-                       bt_ctf_field_type_id_string(packet_header_type->id));
+                       bt_field_type_id_string(packet_header_type->id));
                ret = -1;
                goto end;
        }
@@ -1966,7 +1966,7 @@ int bt_ctf_trace_set_packet_header_type(struct bt_ctf_trace *trace,
        trace->packet_header_type = bt_get(packet_header_type);
        BT_LOGV("Set trace's packet header field type: "
                "addr=%p, name=\"%s\", packet-context-ft-addr=%p",
-               trace, bt_ctf_trace_get_name(trace), packet_header_type);
+               trace, bt_trace_get_name(trace), packet_header_type);
 end:
        return ret;
 }
@@ -1974,29 +1974,31 @@ end:
 static
 int64_t get_stream_class_count(void *element)
 {
-       return bt_ctf_trace_get_stream_class_count(
-                       (struct bt_ctf_trace *) element);
+       return bt_trace_get_stream_class_count(
+                       (struct bt_trace *) element);
 }
 
 static
 void *get_stream_class(void *element, int i)
 {
-       return bt_ctf_trace_get_stream_class_by_index(
-                       (struct bt_ctf_trace *) element, i);
+       return bt_trace_get_stream_class_by_index(
+                       (struct bt_trace *) element, i);
 }
 
 static
-int visit_stream_class(void *object, bt_ctf_visitor visitor,void *data)
+int visit_stream_class(void *object, bt_visitor visitor,void *data)
 {
-       return bt_ctf_stream_class_visit(object, visitor, data);
+       return bt_stream_class_visit(object, visitor, data);
 }
 
-int bt_ctf_trace_visit(struct bt_ctf_trace *trace,
-               bt_ctf_visitor visitor, void *data)
+int bt_trace_visit(struct bt_trace *trace,
+               bt_visitor visitor, void *data)
 {
        int ret;
-       struct bt_ctf_object obj =
-                       { .object = trace, .type = BT_CTF_OBJECT_TYPE_TRACE };
+       struct bt_visitor_object obj = {
+               .object = trace,
+               .type = BT_VISITOR_OBJECT_TYPE_TRACE
+       };
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -2011,7 +2013,7 @@ int bt_ctf_trace_visit(struct bt_ctf_trace *trace,
        }
 
        BT_LOGV("Visiting trace: addr=%p, name=\"%s\"",
-               trace, bt_ctf_trace_get_name(trace));
+               trace, bt_trace_get_name(trace));
        ret = visitor_helper(&obj, get_stream_class_count,
                        get_stream_class, visit_stream_class, visitor, data);
 end:
@@ -2019,7 +2021,7 @@ end:
 }
 
 static
-int invoke_listener(struct bt_ctf_object *object, void *data)
+int invoke_listener(struct bt_visitor_object *object, void *data)
 {
        struct listener_wrapper *listener_wrapper = data;
 
@@ -2028,8 +2030,8 @@ int invoke_listener(struct bt_ctf_object *object, void *data)
 }
 
 // TODO: add logging to this function once we use it internally.
-int bt_ctf_trace_add_listener(struct bt_ctf_trace *trace,
-               bt_ctf_listener_cb listener, void *listener_data)
+int bt_trace_add_listener(struct bt_trace *trace,
+               bt_listener_cb listener, void *listener_data)
 {
        int ret = 0;
        struct listener_wrapper *listener_wrapper =
@@ -2044,7 +2046,7 @@ int bt_ctf_trace_add_listener(struct bt_ctf_trace *trace,
        listener_wrapper->data = listener_data;
 
        /* Visit the current schema. */
-       ret = bt_ctf_trace_visit(trace, invoke_listener, listener_wrapper);
+       ret = bt_trace_visit(trace, invoke_listener, listener_wrapper);
        if (ret) {
                goto error;
        }
@@ -2061,11 +2063,11 @@ error:
 }
 
 BT_HIDDEN
-int bt_ctf_trace_object_modification(struct bt_ctf_object *object,
+int bt_trace_object_modification(struct bt_visitor_object *object,
                void *trace_ptr)
 {
        size_t i;
-       struct bt_ctf_trace *trace = trace_ptr;
+       struct bt_trace *trace = trace_ptr;
 
        assert(trace);
        assert(object);
@@ -2085,11 +2087,11 @@ end:
 }
 
 BT_HIDDEN
-struct bt_ctf_field_type *get_field_type(enum field_type_alias alias)
+struct bt_field_type *get_field_type(enum field_type_alias alias)
 {
        int ret;
        unsigned int alignment, size;
-       struct bt_ctf_field_type *field_type = NULL;
+       struct bt_field_type *field_type = NULL;
 
        if (alias >= NR_FIELD_TYPE_ALIAS) {
                goto end;
@@ -2097,8 +2099,8 @@ struct bt_ctf_field_type *get_field_type(enum field_type_alias alias)
 
        alignment = field_type_aliases_alignments[alias];
        size = field_type_aliases_sizes[alias];
-       field_type = bt_ctf_field_type_integer_create(size);
-       ret = bt_ctf_field_type_set_alignment(field_type, alignment);
+       field_type = bt_field_type_integer_create(size);
+       ret = bt_field_type_set_alignment(field_type, alignment);
        if (ret) {
                BT_PUT(field_type);
        }
@@ -2107,7 +2109,7 @@ end:
 }
 
 static
-void bt_ctf_trace_freeze(struct bt_ctf_trace *trace)
+void bt_trace_freeze(struct bt_trace *trace)
 {
        int i;
 
@@ -2116,27 +2118,27 @@ void bt_ctf_trace_freeze(struct bt_ctf_trace *trace)
        }
 
        BT_LOGD("Freezing trace: addr=%p, name=\"%s\"",
-               trace, bt_ctf_trace_get_name(trace));
+               trace, bt_trace_get_name(trace));
        BT_LOGD_STR("Freezing packet header field type.");
-       bt_ctf_field_type_freeze(trace->packet_header_type);
+       bt_field_type_freeze(trace->packet_header_type);
        BT_LOGD_STR("Freezing environment attributes.");
-       bt_ctf_attributes_freeze(trace->environment);
+       bt_attributes_freeze(trace->environment);
 
        if (trace->clocks->len > 0) {
                BT_LOGD_STR("Freezing clock classes.");
        }
 
        for (i = 0; i < trace->clocks->len; i++) {
-               struct bt_ctf_clock_class *clock_class =
+               struct bt_clock_class *clock_class =
                        g_ptr_array_index(trace->clocks, i);
 
-               bt_ctf_clock_class_freeze(clock_class);
+               bt_clock_class_freeze(clock_class);
        }
 
        trace->frozen = 1;
 }
 
-bt_bool bt_ctf_trace_is_static(struct bt_ctf_trace *trace)
+bt_bool bt_trace_is_static(struct bt_trace *trace)
 {
        bt_bool is_static = BT_FALSE;
 
@@ -2151,7 +2153,7 @@ end:
        return is_static;
 }
 
-int bt_ctf_trace_set_is_static(struct bt_ctf_trace *trace)
+int bt_trace_set_is_static(struct bt_trace *trace)
 {
        int ret = 0;
        size_t i;
@@ -2163,15 +2165,15 @@ int bt_ctf_trace_set_is_static(struct bt_ctf_trace *trace)
        }
 
        trace->is_static = BT_TRUE;
-       bt_ctf_trace_freeze(trace);
+       bt_trace_freeze(trace);
        BT_LOGV("Set trace static: addr=%p, name=\"%s\"",
-               trace, bt_ctf_trace_get_name(trace));
+               trace, bt_trace_get_name(trace));
 
        /* Call all the "trace is static" listeners */
        for (i = 0; i < trace->is_static_listeners->len; i++) {
-               struct bt_ctf_trace_is_static_listener_elem elem =
+               struct bt_trace_is_static_listener_elem elem =
                        g_array_index(trace->is_static_listeners,
-                               struct bt_ctf_trace_is_static_listener_elem, i);
+                               struct bt_trace_is_static_listener_elem, i);
 
                if (elem.func) {
                        elem.func(trace, elem.data);
@@ -2182,12 +2184,12 @@ end:
        return ret;
 }
 
-int bt_ctf_trace_add_is_static_listener(struct bt_ctf_trace *trace,
-               bt_ctf_trace_is_static_listener listener,
-               bt_ctf_trace_listener_removed listener_removed, void *data)
+int bt_trace_add_is_static_listener(struct bt_trace *trace,
+               bt_trace_is_static_listener listener,
+               bt_trace_listener_removed listener_removed, void *data)
 {
        int i;
-       struct bt_ctf_trace_is_static_listener_elem new_elem = {
+       struct bt_trace_is_static_listener_elem new_elem = {
                .func = listener,
                .removed = listener_removed,
                .data = data,
@@ -2208,7 +2210,7 @@ int bt_ctf_trace_add_is_static_listener(struct bt_ctf_trace *trace,
        if (trace->is_static) {
                BT_LOGW("Invalid parameter: trace is already static: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                i = -1;
                goto end;
        }
@@ -2216,16 +2218,16 @@ int bt_ctf_trace_add_is_static_listener(struct bt_ctf_trace *trace,
        if (trace->in_remove_listener) {
                BT_LOGW("Cannot call this function during the execution of a remove listener: "
                        "addr=%p, name=\"%s\"",
-                       trace, bt_ctf_trace_get_name(trace));
+                       trace, bt_trace_get_name(trace));
                i = -1;
                goto end;
        }
 
        /* Find the next available spot */
        for (i = 0; i < trace->is_static_listeners->len; i++) {
-               struct bt_ctf_trace_is_static_listener_elem elem =
+               struct bt_trace_is_static_listener_elem elem =
                        g_array_index(trace->is_static_listeners,
-                               struct bt_ctf_trace_is_static_listener_elem, i);
+                               struct bt_trace_is_static_listener_elem, i);
 
                if (!elem.func) {
                        break;
@@ -2241,17 +2243,17 @@ int bt_ctf_trace_add_is_static_listener(struct bt_ctf_trace *trace,
        BT_LOGV("Added \"trace is static\" listener: "
                "trace-addr=%p, trace-name=\"%s\", func-addr=%p, "
                "data-addr=%p, listener-id=%d",
-               trace, bt_ctf_trace_get_name(trace), listener, data, i);
+               trace, bt_trace_get_name(trace), listener, data, i);
 
 end:
        return i;
 }
 
-int bt_ctf_trace_remove_is_static_listener(
-               struct bt_ctf_trace *trace, int listener_id)
+int bt_trace_remove_is_static_listener(
+               struct bt_trace *trace, int listener_id)
 {
        int ret = 0;
-       struct bt_ctf_trace_is_static_listener_elem *elem;
+       struct bt_trace_is_static_listener_elem *elem;
 
        if (!trace) {
                BT_LOGW_STR("Invalid parameter: trace is NULL.");
@@ -2262,7 +2264,7 @@ int bt_ctf_trace_remove_is_static_listener(
        if (trace->in_remove_listener) {
                BT_LOGW("Cannot call this function during the execution of a remove listener: "
                        "addr=%p, name=\"%s\", listener-id=%d",
-                       trace, bt_ctf_trace_get_name(trace),
+                       trace, bt_trace_get_name(trace),
                        listener_id);
                ret = -1;
                goto end;
@@ -2278,19 +2280,19 @@ int bt_ctf_trace_remove_is_static_listener(
        if (listener_id >= trace->is_static_listeners->len) {
                BT_LOGW("Invalid parameter: no listener with this listener ID: "
                        "addr=%p, name=\"%s\", listener-id=%d",
-                       trace, bt_ctf_trace_get_name(trace),
+                       trace, bt_trace_get_name(trace),
                        listener_id);
                ret = -1;
                goto end;
        }
 
        elem = &g_array_index(trace->is_static_listeners,
-                       struct bt_ctf_trace_is_static_listener_elem,
+                       struct bt_trace_is_static_listener_elem,
                        listener_id);
        if (!elem->func) {
                BT_LOGW("Invalid parameter: no listener with this listener ID: "
                        "addr=%p, name=\"%s\", listener-id=%d",
-                       trace, bt_ctf_trace_get_name(trace),
+                       trace, bt_trace_get_name(trace),
                        listener_id);
                ret = -1;
                goto end;
@@ -2300,7 +2302,7 @@ int bt_ctf_trace_remove_is_static_listener(
                /* Call remove listener */
                BT_LOGV("Calling remove listener: "
                        "trace-addr=%p, trace-name=\"%s\", "
-                       "listener-id=%d", trace, bt_ctf_trace_get_name(trace),
+                       "listener-id=%d", trace, bt_trace_get_name(trace),
                        listener_id);
                trace->in_remove_listener = BT_TRUE;
                elem->removed(trace, elem->data);
@@ -2312,7 +2314,7 @@ int bt_ctf_trace_remove_is_static_listener(
        elem->data = NULL;
        BT_LOGV("Removed \"trace is static\" listener: "
                "trace-addr=%p, trace-name=\"%s\", "
-               "listener-id=%d", trace, bt_ctf_trace_get_name(trace),
+               "listener-id=%d", trace, bt_trace_get_name(trace),
                listener_id);
 
 end:
This page took 0.057418 seconds and 4 git commands to generate.