Move to kernel style SPDX license identifiers
[babeltrace.git] / src / ctf-writer / fields.c
index b37b04299dddc9588fce120350d4da382e1310b8..587ed14fd1047cb728274118b77694ef19827e76 100644 (file)
@@ -1,25 +1,7 @@
 /*
- * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+ * SPDX-License-Identifier: MIT
  *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
  */
 
 #define BT_LOG_TAG "CTF-WRITER/FIELDS"
@@ -27,9 +9,10 @@
 
 #include <float.h>
 #include <inttypes.h>
+#include <stdbool.h>
 #include <stdlib.h>
 
-#include <babeltrace2/ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/object.h>
 
 #include "common/align.h"
 #include "common/assert.h"
@@ -55,8 +38,8 @@ struct bt_ctf_field_common *bt_ctf_field_common_copy(struct bt_ctf_field_common
        struct bt_ctf_field_common *copy = NULL;
 
        BT_CTF_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT(field_type_common_has_known_id(field->type));
-       BT_ASSERT(field->methods->copy);
+       BT_ASSERT_DBG(field_type_common_has_known_id(field->type));
+       BT_ASSERT_DBG(field->methods->copy);
        copy = field->methods->copy(field);
        if (!copy) {
                BT_LOGW("Cannot create field: ft-addr=%p", field->type);
@@ -91,19 +74,19 @@ int bt_ctf_field_common_structure_initialize(struct bt_ctf_field_common *field,
 
        /* Create all fields contained in the structure field. */
        for (i = 0; i < structure_type->fields->len; i++) {
-               struct bt_ctf_field_common *field;
+               struct bt_ctf_field_common *member_field;
                struct bt_ctf_field_type_common_structure_field *struct_field =
                        BT_CTF_FIELD_TYPE_COMMON_STRUCTURE_FIELD_AT_INDEX(
                                structure_type, i);
-               field = field_create_func(struct_field->type);
-               if (!field) {
+               member_field = field_create_func(struct_field->type);
+               if (!member_field) {
                        BT_LOGE("Failed to create structure field's member: name=\"%s\", index=%zu",
                                g_quark_to_string(struct_field->name), i);
                        ret = -1;
                        goto end;
                }
 
-               g_ptr_array_index(structure->fields, i) = field;
+               g_ptr_array_index(structure->fields, i) = member_field;
        }
 
        BT_LOGD("Initialized common structure field object: addr=%p, ft-addr=%p",
@@ -142,20 +125,20 @@ int bt_ctf_field_common_variant_initialize(struct bt_ctf_field_common *field,
 
        /* Create all fields contained in the variant field. */
        for (i = 0; i < variant_type->choices->len; i++) {
-               struct bt_ctf_field_common *field;
+               struct bt_ctf_field_common *member_field;
                struct bt_ctf_field_type_common_variant_choice *var_choice =
                        BT_CTF_FIELD_TYPE_COMMON_VARIANT_CHOICE_AT_INDEX(
                                variant_type, i);
 
-               field = field_create_func(var_choice->type);
-               if (!field) {
+               member_field = field_create_func(var_choice->type);
+               if (!member_field) {
                        BT_LOGE("Failed to create variant field's member: name=\"%s\", index=%zu",
                                g_quark_to_string(var_choice->name), i);
                        ret = -1;
                        goto end;
                }
 
-               g_ptr_array_index(variant->fields, i) = field;
+               g_ptr_array_index(variant->fields, i) = member_field;
        }
 
        BT_LOGD("Initialized common variant field object: addr=%p, ft-addr=%p",
@@ -206,7 +189,7 @@ int bt_ctf_field_common_array_initialize(struct bt_ctf_field_common *field,
        uint64_t i;
 
        BT_LOGD("Initializing common array field object: ft-addr=%p", type);
-       BT_ASSERT(type);
+       BT_ASSERT_DBG(type);
        bt_ctf_field_common_initialize(field, type, is_shared,
                release_func, methods);
        array_length = array_type->length;
@@ -246,7 +229,7 @@ int bt_ctf_field_common_sequence_initialize(struct bt_ctf_field_common *field,
        int ret = 0;
 
        BT_LOGD("Initializing common sequence field object: ft-addr=%p", type);
-       BT_ASSERT(type);
+       BT_ASSERT_DBG(type);
        bt_ctf_field_common_initialize(field, type, is_shared,
                release_func, methods);
        sequence->elements = g_ptr_array_new();
@@ -276,7 +259,7 @@ int bt_ctf_field_common_structure_validate_recursive(struct bt_ctf_field_common
        int ret = 0;
        struct bt_ctf_field_common_structure *structure = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < structure->fields->len; i++) {
                ret = bt_ctf_field_common_validate_recursive(
@@ -288,7 +271,7 @@ int bt_ctf_field_common_structure_validate_recursive(struct bt_ctf_field_common
 
                        this_ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
                                field->type, &name, NULL, i);
-                       BT_ASSERT(this_ret == 0);
+                       BT_ASSERT_DBG(this_ret == 0);
                        BT_CTF_ASSERT_PRE_MSG("Invalid structure field's field: "
                                "struct-field-addr=%p, field-name=\"%s\", "
                                "index=%" PRId64 ", field-addr=%p",
@@ -307,7 +290,7 @@ int bt_ctf_field_common_variant_validate_recursive(struct bt_ctf_field_common *f
        int ret = 0;
        struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        if (!variant->current_field) {
                ret = -1;
@@ -327,7 +310,7 @@ int bt_ctf_field_common_array_validate_recursive(struct bt_ctf_field_common *fie
        int ret = 0;
        struct bt_ctf_field_common_array *array = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < array->elements->len; i++) {
                ret = bt_ctf_field_common_validate_recursive((void *) array->elements->pdata[i]);
@@ -351,7 +334,7 @@ int bt_ctf_field_common_sequence_validate_recursive(struct bt_ctf_field_common *
        int ret = 0;
        struct bt_ctf_field_common_sequence *sequence = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < sequence->elements->len; i++) {
                ret = bt_ctf_field_common_validate_recursive(
@@ -371,7 +354,7 @@ end:
 BT_HIDDEN
 void bt_ctf_field_common_generic_reset(struct bt_ctf_field_common *field)
 {
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
        field->payload_set = false;
 }
 
@@ -381,7 +364,7 @@ void bt_ctf_field_common_structure_reset_recursive(struct bt_ctf_field_common *f
        int64_t i;
        struct bt_ctf_field_common_structure *structure = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < structure->fields->len; i++) {
                struct bt_ctf_field_common *member = structure->fields->pdata[i];
@@ -404,7 +387,7 @@ void bt_ctf_field_common_variant_reset_recursive(struct bt_ctf_field_common *fie
 {
        struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
        variant->current_field = NULL;
 }
 
@@ -414,7 +397,7 @@ void bt_ctf_field_common_array_reset_recursive(struct bt_ctf_field_common *field
        size_t i;
        struct bt_ctf_field_common_array *array = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < array->elements->len; i++) {
                struct bt_ctf_field_common *member = array->elements->pdata[i];
@@ -437,7 +420,7 @@ void bt_ctf_field_common_sequence_reset_recursive(struct bt_ctf_field_common *fi
        struct bt_ctf_field_common_sequence *sequence = BT_CTF_FROM_COMMON(field);
        uint64_t i;
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < sequence->elements->len; i++) {
                if (sequence->elements->pdata[i]) {
@@ -555,8 +538,8 @@ void _bt_ctf_field_common_set_is_frozen_recursive(struct bt_ctf_field_common *fi
 
        BT_LOGD("Setting field object's frozen state: addr=%p, is-frozen=%d",
                field, is_frozen);
-       BT_ASSERT(field_type_common_has_known_id(field->type));
-       BT_ASSERT(field->methods->set_is_frozen);
+       BT_ASSERT_DBG(field_type_common_has_known_id(field->type));
+       BT_ASSERT_DBG(field->methods->set_is_frozen);
        field->methods->set_is_frozen(field, is_frozen);
 
 end:
@@ -564,20 +547,20 @@ end:
 }
 
 BT_HIDDEN
-bt_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_generic_is_set(struct bt_ctf_field_common *field)
 {
        return field && field->payload_set;
 }
 
 BT_HIDDEN
-bt_bool bt_ctf_field_common_structure_is_set_recursive(
+bt_ctf_bool bt_ctf_field_common_structure_is_set_recursive(
                struct bt_ctf_field_common *field)
 {
-       bt_bool is_set = BT_FALSE;
+       bt_ctf_bool is_set = BT_CTF_FALSE;
        size_t i;
        struct bt_ctf_field_common_structure *structure = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < structure->fields->len; i++) {
                is_set = bt_ctf_field_common_is_set_recursive(
@@ -592,12 +575,12 @@ end:
 }
 
 BT_HIDDEN
-bt_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common *field)
 {
        struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field);
-       bt_bool is_set = BT_FALSE;
+       bt_ctf_bool is_set = BT_CTF_FALSE;
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        if (variant->current_field) {
                is_set = bt_ctf_field_common_is_set_recursive(
@@ -608,13 +591,13 @@ bt_bool bt_ctf_field_common_variant_is_set_recursive(struct bt_ctf_field_common
 }
 
 BT_HIDDEN
-bt_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_array_is_set_recursive(struct bt_ctf_field_common *field)
 {
        size_t i;
-       bt_bool is_set = BT_FALSE;
+       bt_ctf_bool is_set = BT_CTF_FALSE;
        struct bt_ctf_field_common_array *array = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        for (i = 0; i < array->elements->len; i++) {
                is_set = bt_ctf_field_common_is_set_recursive(array->elements->pdata[i]);
@@ -628,13 +611,13 @@ end:
 }
 
 BT_HIDDEN
-bt_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_common_sequence_is_set_recursive(struct bt_ctf_field_common *field)
 {
        size_t i;
-       bt_bool is_set = BT_FALSE;
+       bt_ctf_bool is_set = BT_CTF_FALSE;
        struct bt_ctf_field_common_sequence *sequence = BT_CTF_FROM_COMMON(field);
 
-       BT_ASSERT(field);
+       BT_ASSERT_DBG(field);
 
        if (!sequence->elements) {
                goto end;
@@ -676,7 +659,7 @@ static
 int bt_ctf_field_enumeration_validate_recursive(struct bt_ctf_field_common *field);
 
 static
-bt_bool bt_ctf_field_enumeration_is_set_recursive(
+bt_ctf_bool bt_ctf_field_enumeration_is_set_recursive(
                struct bt_ctf_field_common *field);
 
 static
@@ -730,7 +713,7 @@ static
 int bt_ctf_field_variant_validate_recursive(struct bt_ctf_field_common *field);
 
 static
-bt_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field);
+bt_ctf_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field);
 
 static
 void bt_ctf_field_variant_reset_recursive(struct bt_ctf_field_common *field);
@@ -865,9 +848,9 @@ int bt_ctf_field_serialize_recursive(struct bt_ctf_field *field,
        struct bt_ctf_field_common *field_common = (void *) field;
        bt_ctf_field_serialize_recursive_func serialize_func;
 
-       BT_ASSERT(ctfser);
+       BT_ASSERT_DBG(ctfser);
        BT_CTF_ASSERT_PRE_NON_NULL(field, "Field");
-       BT_ASSERT(field_common->spec.writer.serialize_func);
+       BT_ASSERT_DBG(field_common->spec.writer.serialize_func);
        serialize_func = field_common->spec.writer.serialize_func;
        return serialize_func(field_common, ctfser,
                native_byte_order);
@@ -886,7 +869,7 @@ int bt_ctf_field_integer_serialize(struct bt_ctf_field_common *field,
        enum bt_ctf_byte_order byte_order;
 
        BT_CTF_ASSERT_PRE_CTF_FIELD_COMMON_IS_SET(field, "Integer field");
-       BT_LOGV("Serializing CTF writer integer field: addr=%p, native-bo=%s",
+       BT_LOGT("Serializing CTF writer integer field: addr=%p, native-bo=%s",
                field,
                bt_ctf_byte_order_string(native_byte_order));
        byte_order = int_type->user_byte_order;
@@ -924,9 +907,9 @@ int bt_ctf_field_enumeration_serialize_recursive(
 {
        struct bt_ctf_field_enumeration *enumeration = (void *) field;
 
-       BT_LOGV("Serializing enumeration field: addr=%p, native-bo=%s",
+       BT_LOGT("Serializing enumeration field: addr=%p, native-bo=%s",
                field, bt_ctf_byte_order_string(native_byte_order));
-       BT_LOGV_STR("Serializing enumeration field's payload field.");
+       BT_LOGT_STR("Serializing enumeration field's payload field.");
        return bt_ctf_field_serialize_recursive(
                (void *) enumeration->container, ctfser, native_byte_order);
 }
@@ -943,7 +926,7 @@ int bt_ctf_field_floating_point_serialize(struct bt_ctf_field_common *field,
        enum bt_ctf_byte_order byte_order;
 
        BT_CTF_ASSERT_PRE_CTF_FIELD_COMMON_IS_SET(field, "Floating point number field");
-       BT_LOGV("Serializing floating point number field: "
+       BT_LOGT("Serializing floating point number field: "
                "addr=%p, native-bo=%s", field,
                bt_ctf_byte_order_string(native_byte_order));
 
@@ -963,7 +946,7 @@ int bt_ctf_field_floating_point_serialize(struct bt_ctf_field_common *field,
                        byte_order == BT_CTF_BYTE_ORDER_LITTLE_ENDIAN ?
                                LITTLE_ENDIAN : BIG_ENDIAN);
        } else {
-               abort();
+               bt_common_abort();
        }
 
        if (G_UNLIKELY(ret)) {
@@ -985,7 +968,7 @@ int bt_ctf_field_structure_serialize_recursive(struct bt_ctf_field_common *field
        int ret;
        struct bt_ctf_field_common_structure *structure = BT_CTF_FROM_COMMON(field);
 
-       BT_LOGV("Serializing structure field: addr=%p, native-bo=%s",
+       BT_LOGT("Serializing structure field: addr=%p, native-bo=%s",
                field, bt_ctf_byte_order_string(native_byte_order));
        ret = bt_ctfser_align_offset_in_current_packet(ctfser,
                field->type->alignment);
@@ -1000,7 +983,7 @@ int bt_ctf_field_structure_serialize_recursive(struct bt_ctf_field_common *field
                        structure->fields, i);
                const char *field_name = NULL;
 
-               BT_LOGV("Serializing structure field's field: ser-offset=%" PRIu64 ", "
+               BT_LOGT("Serializing structure field's field: ser-offset=%" PRIu64 ", "
                        "field-addr=%p, index=%" PRIu64,
                        bt_ctfser_get_offset_in_current_packet_bits(ctfser),
                        member, i);
@@ -1008,7 +991,7 @@ int bt_ctf_field_structure_serialize_recursive(struct bt_ctf_field_common *field
                if (G_UNLIKELY(!member)) {
                        ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
                                field->type, &field_name, NULL, i);
-                       BT_ASSERT(ret == 0);
+                       BT_ASSERT_DBG(ret == 0);
                        BT_LOGW("Cannot serialize structure field's field: field is not set: "
                                "struct-field-addr=%p, "
                                "field-name=\"%s\", index=%" PRId64,
@@ -1022,7 +1005,7 @@ int bt_ctf_field_structure_serialize_recursive(struct bt_ctf_field_common *field
                if (G_UNLIKELY(ret)) {
                        ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
                                field->type, &field_name, NULL, i);
-                       BT_ASSERT(ret == 0);
+                       BT_ASSERT_DBG(ret == 0);
                        BT_LOGW("Cannot serialize structure field's field: "
                                "struct-field-addr=%p, field-addr=%p, "
                                "field-name=\"%s\", index=%" PRId64,
@@ -1042,9 +1025,9 @@ int bt_ctf_field_variant_serialize_recursive(struct bt_ctf_field_common *field,
 {
        struct bt_ctf_field_common_variant *variant = BT_CTF_FROM_COMMON(field);
 
-       BT_LOGV("Serializing variant field: addr=%p, native-bo=%s",
+       BT_LOGT("Serializing variant field: addr=%p, native-bo=%s",
                field, bt_ctf_byte_order_string(native_byte_order));
-       BT_LOGV_STR("Serializing variant field's payload field.");
+       BT_LOGT_STR("Serializing variant field's payload field.");
        return bt_ctf_field_serialize_recursive(
                (void *) variant->current_field, ctfser, native_byte_order);
 }
@@ -1058,14 +1041,14 @@ int bt_ctf_field_array_serialize_recursive(struct bt_ctf_field_common *field,
        int ret = 0;
        struct bt_ctf_field_common_array *array = BT_CTF_FROM_COMMON(field);
 
-       BT_LOGV("Serializing array field: addr=%p, native-bo=%s",
+       BT_LOGT("Serializing array field: addr=%p, native-bo=%s",
                field, bt_ctf_byte_order_string(native_byte_order));
 
        for (i = 0; i < array->elements->len; i++) {
                struct bt_ctf_field_common *elem_field =
                        g_ptr_array_index(array->elements, i);
 
-               BT_LOGV("Serializing array field's element field: "
+               BT_LOGT("Serializing array field's element field: "
                        "ser-offset=%" PRIu64 ", field-addr=%p, index=%" PRId64,
                        bt_ctfser_get_offset_in_current_packet_bits(ctfser),
                        elem_field, i);
@@ -1092,14 +1075,14 @@ int bt_ctf_field_sequence_serialize_recursive(struct bt_ctf_field_common *field,
        int ret = 0;
        struct bt_ctf_field_common_sequence *sequence = BT_CTF_FROM_COMMON(field);
 
-       BT_LOGV("Serializing sequence field: addr=%p, native-bo=%s",
+       BT_LOGT("Serializing sequence field: addr=%p, native-bo=%s",
                field, bt_ctf_byte_order_string(native_byte_order));
 
        for (i = 0; i < sequence->elements->len; i++) {
                struct bt_ctf_field_common *elem_field =
                        g_ptr_array_index(sequence->elements, i);
 
-               BT_LOGV("Serializing sequence field's element field: "
+               BT_LOGT("Serializing sequence field's element field: "
                        "ser-offset=%" PRIu64 ", field-addr=%p, index=%" PRId64,
                        bt_ctfser_get_offset_in_current_packet_bits(ctfser),
                        elem_field, i);
@@ -1126,7 +1109,7 @@ int bt_ctf_field_string_serialize(struct bt_ctf_field_common *field,
        struct bt_ctf_field_common_string *string = BT_CTF_FROM_COMMON(field);
 
        BT_CTF_ASSERT_PRE_CTF_FIELD_COMMON_IS_SET(field, "String field");
-       BT_LOGV("Serializing string field: addr=%p, native-bo=%s",
+       BT_LOGT("Serializing string field: addr=%p, native-bo=%s",
                field, bt_ctf_byte_order_string((int) native_byte_order));
        ret = bt_ctfser_write_string(ctfser, (const char *) string->buf->data);
        if (G_UNLIKELY(ret)) {
@@ -1144,7 +1127,7 @@ struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type)
        enum bt_ctf_field_type_id type_id;
 
        BT_CTF_ASSERT_PRE_NON_NULL(type, "Field type");
-       BT_ASSERT(field_type_common_has_known_id((void *) type));
+       BT_ASSERT_DBG(field_type_common_has_known_id((void *) type));
        BT_CTF_ASSERT_PRE(bt_ctf_field_type_common_validate((void *) type) == 0,
                "Field type is invalid: ft-addr=%p", type);
        type_id = bt_ctf_field_type_get_type_id(type);
@@ -1194,7 +1177,7 @@ int bt_ctf_field_sequence_set_length(struct bt_ctf_field *field,
        }
 
        ret = bt_ctf_field_integer_unsigned_get_value(length_field, &length);
-       BT_ASSERT(ret == 0);
+       BT_ASSERT_DBG(ret == 0);
        return bt_ctf_field_common_sequence_set_length((void *) field,
                length, (bt_ctf_field_common_create_func) bt_ctf_field_create);
 }
@@ -1235,7 +1218,7 @@ struct bt_ctf_field *bt_ctf_field_variant_get_field(struct bt_ctf_field *field,
        struct bt_ctf_field_type_common_variant *variant_ft;
        struct bt_ctf_field_type_common_enumeration *tag_ft;
        struct bt_ctf_field *current_field = NULL;
-       bt_bool is_signed;
+       bt_ctf_bool is_signed;
        uint64_t tag_uval;
        int ret;
 
@@ -1271,7 +1254,7 @@ struct bt_ctf_field *bt_ctf_field_variant_get_field(struct bt_ctf_field *field,
                        (void *) enum_field->container, &tag_uval);
        }
 
-       BT_ASSERT(ret == 0);
+       BT_ASSERT_DBG(ret == 0);
        ret = bt_ctf_field_common_variant_set_tag((void *) field, tag_uval,
                is_signed);
        if (ret) {
@@ -1281,7 +1264,7 @@ struct bt_ctf_field *bt_ctf_field_variant_get_field(struct bt_ctf_field *field,
        bt_ctf_object_put_ref(variant_field->tag);
        variant_field->tag = bt_ctf_object_get_ref(tag_field);
        current_field = bt_ctf_field_variant_get_current_field(field);
-       BT_ASSERT(current_field);
+       BT_ASSERT_DBG(current_field);
 
 end:
        return current_field;
@@ -1303,7 +1286,7 @@ struct bt_ctf_field *bt_ctf_field_enumeration_borrow_container(
        BT_CTF_ASSERT_PRE_NON_NULL(field, "Enumeration field");
        BT_CTF_ASSERT_PRE_CTF_FIELD_COMMON_HAS_TYPE_ID((struct bt_ctf_field_common *) field,
                BT_CTF_FIELD_TYPE_ID_ENUM, "Field");
-       BT_ASSERT(enumeration->container);
+       BT_ASSERT_DBG(enumeration->container);
        return (void *) enumeration->container;
 }
 
@@ -1593,7 +1576,7 @@ struct bt_ctf_field *bt_ctf_field_array_create(struct bt_ctf_field_type *type)
        int ret;
 
        BT_LOGD("Creating CTF writer array field object: ft-addr=%p", type);
-       BT_ASSERT(type);
+       BT_ASSERT_DBG(type);
 
        if (!array) {
                BT_LOGE_STR("Failed to allocate one array field.");
@@ -1701,9 +1684,9 @@ int bt_ctf_field_enumeration_validate_recursive(struct bt_ctf_field_common *fiel
 }
 
 static
-bt_bool bt_ctf_field_enumeration_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_enumeration_is_set_recursive(struct bt_ctf_field_common *field)
 {
-       bt_bool is_set = BT_FALSE;
+       bt_ctf_bool is_set = BT_CTF_FALSE;
        struct bt_ctf_field_enumeration *enumeration = (void *) field;
 
        if (enumeration->container) {
@@ -1763,9 +1746,9 @@ end:
 }
 
 static
-bt_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field)
+bt_ctf_bool bt_ctf_field_variant_is_set_recursive(struct bt_ctf_field_common *field)
 {
-       bt_bool is_set;
+       bt_ctf_bool is_set;
        struct bt_ctf_field_variant *variant = (void *) field;
 
        if (variant->tag) {
@@ -1847,7 +1830,7 @@ int bt_ctf_field_structure_set_field_by_name(struct bt_ctf_field *field,
        if (!g_hash_table_lookup_extended(field_name_to_index,
                        GUINT_TO_POINTER(field_quark), NULL,
                        (gpointer *) &index)) {
-               BT_LOGV("Invalid parameter: no such field in structure field's type: "
+               BT_LOGT("Invalid parameter: no such field in structure field's type: "
                        "struct-field-addr=%p, struct-ft-addr=%p, "
                        "field-ft-addr=%p, name=\"%s\"",
                        field, common_field->type, common_value->type, name);
This page took 0.033158 seconds and 4 git commands to generate.