/*
- * 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/FIELD-TYPES"
#include <float.h>
#include <inttypes.h>
+#include <stdbool.h>
#include <stdlib.h>
-#include <babeltrace2/ctf-writer/fields.h>
-#include <babeltrace2/ctf-writer/field-types.h>
-#include <babeltrace2/ctf-writer/object.h>
-#include <babeltrace2/ctf-writer/utils.h>
+#include <babeltrace2-ctf-writer/fields.h>
+#include <babeltrace2-ctf-writer/field-types.h>
+#include <babeltrace2-ctf-writer/object.h>
+#include <babeltrace2-ctf-writer/utils.h>
#include "common/assert.h"
#include "compat/compiler.h"
g_free(mapping);
}
-BT_HIDDEN
void bt_ctf_field_type_common_initialize(struct bt_ctf_field_type_common *ft,
bool init_bo, bt_ctf_object_release_func release_func,
struct bt_ctf_field_type_common_methods *methods)
{
- BT_ASSERT(ft && (ft->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN) &&
+ BT_ASSERT_DBG(ft && (ft->id > BT_CTF_FIELD_TYPE_ID_UNKNOWN) &&
(ft->id < BT_CTF_FIELD_TYPE_ID_NR));
bt_ctf_object_init_shared(&ft->base, release_func);
BT_LOGD("Setting initial field type's byte order: bo=%s",
bt_ctf_byte_order_string(bo));
ret = bt_ctf_field_type_common_set_byte_order(ft, bo);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
}
ft->alignment = 1;
}
-BT_HIDDEN
void bt_ctf_field_type_common_integer_initialize(
struct bt_ctf_field_type_common *ft,
unsigned int size, bt_ctf_object_release_func release_func,
{
struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
- BT_ASSERT(size > 0);
+ BT_ASSERT_DBG(size > 0);
BT_LOGD("Initializing common integer field type object: size=%u",
size);
ft->id = BT_CTF_FIELD_TYPE_ID_INTEGER;
ft, size);
}
-BT_HIDDEN
void bt_ctf_field_type_common_floating_point_initialize(
struct bt_ctf_field_type_common *ft,
bt_ctf_object_release_func release_func,
flt_ft->mant_dig);
}
-BT_HIDDEN
void bt_ctf_field_type_common_enumeration_initialize(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *container_ft,
{
struct bt_ctf_field_type_common_enumeration *enum_ft = BT_CTF_FROM_COMMON(ft);
- BT_ASSERT(container_ft);
+ BT_ASSERT_DBG(container_ft);
BT_LOGD("Initializing common enumeration field type object: int-ft-addr=%p",
container_ft);
ft->id = BT_CTF_FIELD_TYPE_ID_ENUM;
bt_ctf_field_type_common_integer_get_size(container_ft));
}
-BT_HIDDEN
void bt_ctf_field_type_common_string_initialize(
struct bt_ctf_field_type_common *ft,
bt_ctf_object_release_func release_func,
BT_LOGD("Initialized common string field type object: addr=%p", ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_structure_initialize(
struct bt_ctf_field_type_common *ft,
bt_ctf_object_release_func release_func,
BT_LOGD("Initialized common structure field type object: addr=%p", ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_array_initialize(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *element_ft,
{
struct bt_ctf_field_type_common_array *array_ft = BT_CTF_FROM_COMMON(ft);
- BT_ASSERT(element_ft);
+ BT_ASSERT_DBG(element_ft);
BT_LOGD("Initializing common array field type object: element-ft-addr=%p, "
"length=%u", element_ft, length);
ft->id = BT_CTF_FIELD_TYPE_ID_ARRAY;
"element-ft-addr=%p, length=%u", ft, element_ft, length);
}
-BT_HIDDEN
void bt_ctf_field_type_common_sequence_initialize(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *element_ft,
{
struct bt_ctf_field_type_common_sequence *seq_ft = BT_CTF_FROM_COMMON(ft);
- BT_ASSERT(element_ft);
- BT_ASSERT(length_field_name);
- BT_ASSERT(bt_ctf_identifier_is_valid(length_field_name));
+ BT_ASSERT_DBG(element_ft);
+ BT_ASSERT_DBG(length_field_name);
+ BT_ASSERT_DBG(bt_ctf_identifier_is_valid(length_field_name));
BT_LOGD("Initializing common sequence field type object: element-ft-addr=%p, "
"length-field-name=\"%s\"", element_ft, length_field_name);
ft->id = BT_CTF_FIELD_TYPE_ID_SEQUENCE;
ft, element_ft, length_field_name);
}
-BT_HIDDEN
void bt_ctf_field_type_common_variant_initialize(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *tag_ft,
{
struct bt_ctf_field_type_common_variant *var_ft = BT_CTF_FROM_COMMON(ft);
- BT_ASSERT(!tag_name || bt_ctf_identifier_is_valid(tag_name));
+ BT_ASSERT_DBG(!tag_name || bt_ctf_identifier_is_valid(tag_name));
BT_LOGD("Initializing common variant field type object: "
"tag-ft-addr=%p, tag-field-name=\"%s\"",
tag_ft, tag_name);
ft, tag_ft, tag_name);
}
-BT_HIDDEN
void bt_ctf_field_type_common_integer_destroy(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_integer *ft = (void *) obj;
g_free(ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_floating_point_destroy(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_floating_point *ft = (void *) obj;
g_free(ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_enumeration_destroy_recursive(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_enumeration *ft = (void *) obj;
g_free(ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_string_destroy(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_string *ft = (void *) obj;
bt_ctf_object_put_ref(field->type);
}
-BT_HIDDEN
void bt_ctf_field_type_common_structure_destroy_recursive(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_structure *ft = (void *) obj;
g_free(ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_array_destroy_recursive(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_array *ft = (void *) obj;
g_free(ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_sequence_destroy_recursive(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_sequence *ft = (void *) obj;
}
}
-BT_HIDDEN
void bt_ctf_field_type_common_variant_destroy_recursive(struct bt_ctf_object *obj)
{
struct bt_ctf_field_type_common_variant *ft = (void *) obj;
mapping->string == overlap_query->mapping_name;
if (overlap_query->overlaps) {
- BT_LOGV("Overlapping enumeration field type mappings: "
+ BT_LOGT("Overlapping enumeration field type mappings: "
"mapping-name=\"%s\", "
"mapping-a-range-start=%" PRId64 ", "
"mapping-a-range-end=%" PRId64 ", "
if (is_variant) {
struct bt_ctf_field_type_common_variant_choice *choice =
- &g_array_index(members,
+ &bt_g_array_index(members,
struct bt_ctf_field_type_common_variant_choice,
members->len - 1);
member_ft = &choice->type;
member_name = &choice->name;
- BT_ASSERT(!choice->ranges);
+ BT_ASSERT_DBG(!choice->ranges);
choice->ranges = g_array_new(FALSE, TRUE,
sizeof(struct bt_ctf_field_type_common_variant_choice_range));
- BT_ASSERT(choice->ranges);
+ BT_ASSERT_DBG(choice->ranges);
} else {
struct bt_ctf_field_type_common_structure_field *field =
- &g_array_index(members,
+ &bt_g_array_index(members,
struct bt_ctf_field_type_common_structure_field,
members->len - 1);
g_hash_table_insert(field_name_to_index,
GUINT_TO_POINTER(name_quark),
GUINT_TO_POINTER(members->len - 1));
- BT_LOGV("Added structure/variant field type member: member-ft-addr=%p, "
+ BT_LOGT("Added structure/variant field type member: member-ft-addr=%p, "
"member-name=\"%s\"", field_type, field_name);
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_validate(struct bt_ctf_field_type_common *ft)
{
int ret = 0;
return iter;
}
-BT_HIDDEN
struct bt_ctf_field_type_enumeration_mapping_iterator *
bt_ctf_field_type_common_enumeration_find_mappings_by_name(
struct bt_ctf_field_type_common *ft, const char *name)
return mapping;
}
-BT_HIDDEN
int bt_ctf_field_type_enumeration_mapping_iterator_next(
struct bt_ctf_field_type_enumeration_mapping_iterator *iter)
{
default:
BT_LOGF("Invalid enumeration field type mapping iterator type: "
"type=%d", iter->type);
- abort();
+ bt_common_abort();
}
}
return ret;
}
-BT_HIDDEN
struct bt_ctf_field_type_enumeration_mapping_iterator *
bt_ctf_field_type_common_enumeration_signed_find_mappings_by_value(
struct bt_ctf_field_type_common *ft, int64_t value)
return NULL;
}
-BT_HIDDEN
struct bt_ctf_field_type_enumeration_mapping_iterator *
bt_ctf_field_type_common_enumeration_unsigned_find_mappings_by_value(
struct bt_ctf_field_type_common *ft, uint64_t value)
return NULL;
}
-BT_HIDDEN
int bt_ctf_field_type_enumeration_mapping_iterator_signed_get(
struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
const char **mapping_name, int64_t *range_begin,
mapping_name, range_begin, range_end);
}
-BT_HIDDEN
int bt_ctf_field_type_enumeration_mapping_iterator_unsigned_get(
struct bt_ctf_field_type_enumeration_mapping_iterator *iter,
const char **mapping_name, uint64_t *range_begin,
int64_t i, j, len;
int is_signed;
- BT_LOGV("Setting enumeration field type's overlap flag: addr=%p",
+ BT_LOGT("Setting enumeration field type's overlap flag: addr=%p",
ft);
len = ft->entries->len;
is_signed = bt_ctf_field_type_common_integer_is_signed(
<= mapping[1]->range_end._signed
&& mapping[0]->range_end._signed
>= mapping[1]->range_start._signed) {
- ft->has_overlapping_ranges = BT_TRUE;
+ ft->has_overlapping_ranges = BT_CTF_TRUE;
goto end;
}
} else {
<= mapping[1]->range_end._unsigned
&& mapping[0]->range_end._unsigned
>= mapping[1]->range_start._unsigned) {
- ft->has_overlapping_ranges = BT_TRUE;
+ ft->has_overlapping_ranges = BT_CTF_TRUE;
goto end;
}
}
end:
if (ft->has_overlapping_ranges) {
- BT_LOGV_STR("Enumeration field type has overlapping ranges.");
+ BT_LOGT_STR("Enumeration field type has overlapping ranges.");
} else {
- BT_LOGV_STR("Enumeration field type has no overlapping ranges.");
+ BT_LOGT_STR("Enumeration field type has no overlapping ranges.");
}
}
-BT_HIDDEN
int bt_ctf_field_type_common_enumeration_validate_recursive(
struct bt_ctf_field_type_common *ft)
{
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_sequence_validate_recursive(
struct bt_ctf_field_type_common *ft)
{
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_array_validate_recursive(
struct bt_ctf_field_type_common *ft)
{
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_structure_validate_recursive(
struct bt_ctf_field_type_common *ft)
{
bt_ctf_field_type_common_structure_get_field_count(ft);
int64_t i;
- BT_ASSERT(field_count >= 0);
+ BT_ASSERT_DBG(field_count >= 0);
for (i = 0; i < field_count; ++i) {
const char *field_name;
ret = bt_ctf_field_type_common_structure_borrow_field_by_index(ft,
&field_name, &child_ft, i);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
ret = bt_ctf_field_type_common_validate(child_ft);
if (ret) {
BT_LOGW("Invalid structure field type: "
}
static
-bt_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges(
+bt_ctf_bool bt_ctf_field_type_common_enumeration_has_overlapping_ranges(
struct bt_ctf_field_type_common_enumeration *enum_ft)
{
if (!enum_ft->common.frozen) {
return enum_ft->has_overlapping_ranges;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_validate_recursive(
struct bt_ctf_field_type_common *ft)
{
ret = bt_ctf_field_type_common_variant_borrow_field_by_index(ft,
&field_name, &child_ft, i);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
ret = bt_ctf_field_type_common_validate(child_ft);
if (ret) {
BT_LOGW("Invalid variant field type: "
* of the given field type and the properties of its children if
* applicable.
*/
-BT_HIDDEN
int bt_ctf_field_type_common_validate(struct bt_ctf_field_type_common *ft)
{
int ret = 0;
- BT_ASSERT(ft);
+ BT_ASSERT_DBG(ft);
if (ft->valid) {
/* Already marked as valid */
if (ret == 0 && ft->frozen) {
/* Field type is valid */
- BT_LOGV("Marking field type as valid: addr=%p", ft);
+ BT_LOGT("Marking field type as valid: addr=%p", ft);
ft->valid = 1;
}
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_get_size(struct bt_ctf_field_type_common *ft)
{
struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
return (int) int_ft->size;
}
-BT_HIDDEN
-bt_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft)
+bt_ctf_bool bt_ctf_field_type_common_integer_is_signed(struct bt_ctf_field_type_common *ft)
{
struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
return int_ft->is_signed;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_set_is_signed(struct bt_ctf_field_type_common *ft,
- bt_bool is_signed)
+ bt_ctf_bool is_signed)
{
int ret = 0;
struct bt_ctf_field_type_common_integer *int_ft = BT_CTF_FROM_COMMON(ft);
}
int_ft->is_signed = !!is_signed;
- BT_LOGV("Set integer field type's signedness: addr=%p, is-signed=%d",
+ BT_LOGT("Set integer field type's signedness: addr=%p, is-signed=%d",
ft, is_signed);
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_set_size(struct bt_ctf_field_type_common *ft,
unsigned int size)
{
}
int_ft->size = size;
- BT_LOGV("Set integer field type's size: addr=%p, size=%u",
+ BT_LOGT("Set integer field type's size: addr=%p, size=%u",
ft, size);
end:
return ret;
}
-BT_HIDDEN
enum bt_ctf_integer_base bt_ctf_field_type_common_integer_get_base(
struct bt_ctf_field_type_common *ft)
{
return int_ft->base;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_set_base(struct bt_ctf_field_type_common *ft,
enum bt_ctf_integer_base base)
{
ret = -1;
}
- BT_LOGV("Set integer field type's base: addr=%p, base=%s",
+ BT_LOGT("Set integer field type's base: addr=%p, base=%s",
ft, bt_ctf_integer_base_string(base));
end:
return ret;
}
-BT_HIDDEN
enum bt_ctf_string_encoding bt_ctf_field_type_common_integer_get_encoding(
struct bt_ctf_field_type_common *ft)
{
return int_ft->encoding;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_set_encoding(struct bt_ctf_field_type_common *ft,
enum bt_ctf_string_encoding encoding)
{
}
int_ft->encoding = encoding;
- BT_LOGV("Set integer field type's encoding: addr=%p, encoding=%s",
+ BT_LOGT("Set integer field type's encoding: addr=%p, encoding=%s",
ft, bt_ctf_string_encoding_string(encoding));
end:
return ret;
}
-BT_HIDDEN
struct bt_ctf_clock_class *bt_ctf_field_type_common_integer_borrow_mapped_clock_class(
struct bt_ctf_field_type_common *ft)
{
return int_ft->mapped_clock_class;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_set_mapped_clock_class_no_check_frozen(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_clock_class *clock_class)
bt_ctf_object_put_ref(int_ft->mapped_clock_class);
int_ft->mapped_clock_class = bt_ctf_object_get_ref(clock_class);
- BT_LOGV("Set integer field type's mapped clock class: ft-addr=%p, "
+ BT_LOGT("Set integer field type's mapped clock class: ft-addr=%p, "
"clock-class-addr=%p, clock-class-name=\"%s\"",
ft, clock_class, bt_ctf_clock_class_get_name(clock_class));
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_set_mapped_clock_class(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_clock_class *clock_class)
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_enumeration_signed_get_mapping_by_index(
struct bt_ctf_field_type_common *ft, uint64_t index,
const char **mapping_name, int64_t *range_begin,
if (mapping_name) {
*mapping_name = g_quark_to_string(mapping->string);
- BT_ASSERT(*mapping_name);
+ BT_ASSERT_DBG(*mapping_name);
}
if (range_begin) {
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_enumeration_unsigned_get_mapping_by_index(
struct bt_ctf_field_type_common *ft, uint64_t index,
const char **mapping_name, uint64_t *range_begin,
if (mapping_name) {
*mapping_name = g_quark_to_string(mapping->string);
- BT_ASSERT(*mapping_name);
+ BT_ASSERT_DBG(*mapping_name);
}
if (range_begin) {
return ret;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *
bt_ctf_field_type_common_enumeration_borrow_container_field_type(
struct bt_ctf_field_type_common *ft)
return BT_CTF_TO_COMMON(enum_ft->container_ft);
}
-BT_HIDDEN
int bt_ctf_field_type_common_enumeration_signed_add_mapping(
struct bt_ctf_field_type_common *ft, const char *string,
int64_t range_start, int64_t range_end)
g_ptr_array_add(enum_ft->entries, mapping);
g_ptr_array_sort(enum_ft->entries,
(GCompareFunc) compare_enumeration_mappings_signed);
- BT_LOGV("Added mapping to signed enumeration field type: addr=%p, "
+ BT_LOGT("Added mapping to signed enumeration field type: addr=%p, "
"name=\"%s\", range-start=%" PRId64 ", "
"range-end=%" PRId64,
ft, string, range_start, range_end);
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_enumeration_unsigned_add_mapping(
struct bt_ctf_field_type_common *ft, const char *string,
uint64_t range_start, uint64_t range_end)
g_ptr_array_add(enum_ft->entries, mapping);
g_ptr_array_sort(enum_ft->entries,
(GCompareFunc) compare_enumeration_mappings_unsigned);
- BT_LOGV("Added mapping to unsigned enumeration field type: addr=%p, "
+ BT_LOGT("Added mapping to unsigned enumeration field type: addr=%p, "
"name=\"%s\", range-start=%" PRIu64 ", "
"range-end=%" PRIu64,
ft, string, range_start, range_end);
return ret;
}
-BT_HIDDEN
int64_t bt_ctf_field_type_common_enumeration_get_mapping_count(
struct bt_ctf_field_type_common *ft)
{
return (int64_t) enum_ft->entries->len;
}
-BT_HIDDEN
int bt_ctf_field_type_common_floating_point_get_exponent_digits(
struct bt_ctf_field_type_common *ft)
{
return (int) flt_ft->exp_dig;
}
-BT_HIDDEN
int bt_ctf_field_type_common_floating_point_set_exponent_digits(
struct bt_ctf_field_type_common *ft,
unsigned int exponent_digits)
}
flt_ft->exp_dig = exponent_digits;
- BT_LOGV("Set floating point number field type's exponent size: addr=%p, "
+ BT_LOGT("Set floating point number field type's exponent size: addr=%p, "
"exp-size=%u", ft, exponent_digits);
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_floating_point_get_mantissa_digits(
struct bt_ctf_field_type_common *ft)
{
return (int) flt_ft->mant_dig;
}
-BT_HIDDEN
int bt_ctf_field_type_common_floating_point_set_mantissa_digits(
struct bt_ctf_field_type_common *ft, unsigned int mantissa_digits)
{
}
flt_ft->mant_dig = mantissa_digits;
- BT_LOGV("Set floating point number field type's mantissa size: addr=%p, "
+ BT_LOGT("Set floating point number field type's mantissa size: addr=%p, "
"mant-size=%u", ft, mantissa_digits);
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_structure_replace_field(
struct bt_ctf_field_type_common *ft,
const char *field_name,
GQuark name_quark;
uint64_t i;
- BT_ASSERT(ft);
- BT_ASSERT(field_name);
- BT_ASSERT(field_type);
- BT_ASSERT(ft->id == BT_CTF_FIELD_TYPE_ID_STRUCT);
+ BT_ASSERT_DBG(ft);
+ BT_ASSERT_DBG(field_name);
+ BT_ASSERT_DBG(field_type);
+ BT_ASSERT_DBG(ft->id == BT_CTF_FIELD_TYPE_ID_STRUCT);
name_quark = g_quark_from_string(field_name);
for (i = 0; i < struct_ft->fields->len; i++) {
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_structure_add_field(struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *field_type,
const char *field_name)
goto end;
}
- BT_LOGV("Added structure field type field: struct-ft-addr=%p, "
+ BT_LOGT("Added structure field type field: struct-ft-addr=%p, "
"field-ft-addr=%p, field-name=\"%s\"", ft,
field_type, field_name);
return ret;
}
-BT_HIDDEN
int64_t bt_ctf_field_type_common_structure_get_field_count(
struct bt_ctf_field_type_common *ft)
{
return (int64_t) struct_ft->fields->len;
}
-BT_HIDDEN
int bt_ctf_field_type_common_structure_borrow_field_by_index(
struct bt_ctf_field_type_common *ft,
const char **field_name,
if (field_name) {
*field_name = g_quark_to_string(field->name);
- BT_ASSERT(*field_name);
+ BT_ASSERT_DBG(*field_name);
}
return 0;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *
bt_ctf_field_type_common_structure_borrow_field_type_by_name(
struct bt_ctf_field_type_common *ft, const char *name)
"Field type");
name_quark = g_quark_try_string(name);
if (!name_quark) {
- BT_LOGV("No such structure field type field name: "
+ BT_LOGT("No such structure field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, name);
goto end;
if (!g_hash_table_lookup_extended(struct_ft->field_name_to_index,
GUINT_TO_POINTER(name_quark), NULL, (gpointer *) &index)) {
- BT_LOGV("No such structure field type field name: "
+ BT_LOGT("No such structure field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, name);
goto end;
return field_type;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *
bt_ctf_field_type_common_variant_borrow_tag_field_type(
struct bt_ctf_field_type_common *ft)
"Field type");
if (!var_ft->tag_ft) {
- BT_LOGV("Variant field type has no tag field type: "
+ BT_LOGT("Variant field type has no tag field type: "
"addr=%p", ft);
goto end;
}
return tag_ft;
}
-BT_HIDDEN
const char *bt_ctf_field_type_common_variant_get_tag_name(
struct bt_ctf_field_type_common *ft)
{
"Field type");
if (var_ft->tag_name->len == 0) {
- BT_LOGV("Variant field type has no tag field name: "
+ BT_LOGT("Variant field type has no tag field name: "
"addr=%p", ft);
goto end;
}
return tag_name;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_set_tag_name(
struct bt_ctf_field_type_common *ft, const char *name)
{
}
g_string_assign(var_ft->tag_name, name);
- BT_LOGV("Set variant field type's tag field name: addr=%p, "
+ BT_LOGT("Set variant field type's tag field name: addr=%p, "
"tag-field-name=\"%s\"", ft, name);
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_add_field(struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *field_type,
const char *field_name)
goto end;
}
- BT_LOGV("Added variant field type field: variant-ft-addr=%p, "
+ BT_LOGT("Added variant field type field: variant-ft-addr=%p, "
"field-ft-addr=%p, field-name=\"%s\"", ft,
field_type, field_name);
return ret;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *
bt_ctf_field_type_common_variant_borrow_field_type_by_name(
struct bt_ctf_field_type_common *ft,
"Field type");
name_quark = g_quark_try_string(field_name);
if (!name_quark) {
- BT_LOGV("No such variant field type field name: "
+ BT_LOGT("No such variant field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, field_name);
goto end;
if (!g_hash_table_lookup_extended(var_ft->choice_name_to_index,
GUINT_TO_POINTER(name_quark), NULL, (gpointer *) &index)) {
- BT_LOGV("No such variant field type field name: "
+ BT_LOGT("No such variant field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, field_name);
goto end;
return field_type;
}
-BT_HIDDEN
int64_t bt_ctf_field_type_common_variant_get_field_count(
struct bt_ctf_field_type_common *ft)
{
return (int64_t) var_ft->choices->len;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_borrow_field_by_index(
struct bt_ctf_field_type_common *ft,
const char **field_name,
if (field_name) {
*field_name = g_quark_to_string(choice->name);
- BT_ASSERT(*field_name);
+ BT_ASSERT_DBG(*field_name);
}
return 0;
}
-BT_HIDDEN
int64_t bt_ctf_field_type_common_variant_find_choice_index(
struct bt_ctf_field_type_common *ft, uint64_t uval,
bool is_signed)
uint64_t i;
struct bt_ctf_field_type_common_variant *var_ft = BT_CTF_FROM_COMMON(ft);
- BT_ASSERT(ft);
- BT_ASSERT(ft->id == BT_CTF_FIELD_TYPE_ID_VARIANT);
+ BT_ASSERT_DBG(ft);
+ BT_ASSERT_DBG(ft->id == BT_CTF_FIELD_TYPE_ID_VARIANT);
if (bt_ctf_field_type_common_variant_update_choices(ft)) {
ret = INT64_C(-1);
for (range_i = 0; range_i < choice->ranges->len; range_i++) {
struct bt_ctf_field_type_common_variant_choice_range *range =
- &g_array_index(
+ &bt_g_array_index(
choice->ranges,
struct bt_ctf_field_type_common_variant_choice_range,
range_i);
return ret;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *
bt_ctf_field_type_common_array_borrow_element_field_type(
struct bt_ctf_field_type_common *ft)
BT_CTF_ASSERT_PRE_NON_NULL(ft, "Field type");
BT_CTF_ASSERT_PRE_CTF_FT_COMMON_HAS_ID(ft, BT_CTF_FIELD_TYPE_ID_ARRAY,
"Field type");
- BT_ASSERT(array_ft && array_ft->element_ft);
+ BT_ASSERT_DBG(array_ft && array_ft->element_ft);
return array_ft->element_ft;
}
-BT_HIDDEN
int bt_ctf_field_type_common_array_set_element_field_type(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *element_ft)
}
array_ft->element_ft = bt_ctf_object_get_ref(element_ft);
- BT_LOGV("Set array field type's element field type: array-ft-addr=%p, "
+ BT_LOGT("Set array field type's element field type: array-ft-addr=%p, "
"element-ft-addr=%p", ft, element_ft);
end:
return ret;
}
-BT_HIDDEN
int64_t bt_ctf_field_type_common_array_get_length(struct bt_ctf_field_type_common *ft)
{
struct bt_ctf_field_type_common_array *array_ft = BT_CTF_FROM_COMMON(ft);
return (int64_t) array_ft->length;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *bt_ctf_field_type_common_sequence_borrow_element_field_type(
struct bt_ctf_field_type_common *ft)
{
return seq_ft->element_ft;
}
-BT_HIDDEN
int bt_ctf_field_type_common_sequence_set_element_field_type(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *element_ft)
seq_ft->element_ft = element_ft;
bt_ctf_object_get_ref(seq_ft->element_ft);
- BT_LOGV("Set sequence field type's element field type: sequence-ft-addr=%p, "
+ BT_LOGT("Set sequence field type's element field type: sequence-ft-addr=%p, "
"element-ft-addr=%p", ft, element_ft);
end:
return ret;
}
-BT_HIDDEN
const char *bt_ctf_field_type_common_sequence_get_length_field_name(
struct bt_ctf_field_type_common *ft)
{
seq_ft->length_field_name->str : NULL;
}
-BT_HIDDEN
enum bt_ctf_string_encoding bt_ctf_field_type_common_string_get_encoding(
struct bt_ctf_field_type_common *ft)
{
return string_ft->encoding;
}
-BT_HIDDEN
int bt_ctf_field_type_common_string_set_encoding(struct bt_ctf_field_type_common *ft,
enum bt_ctf_string_encoding encoding)
{
}
string_ft->encoding = encoding;
- BT_LOGV("Set string field type's encoding: addr=%p, encoding=%s",
+ BT_LOGT("Set string field type's encoding: addr=%p, encoding=%s",
ft, bt_ctf_string_encoding_string(encoding));
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_get_alignment(struct bt_ctf_field_type_common *ft)
{
int ret;
struct bt_ctf_field_type_common *element_ft =
bt_ctf_field_type_common_sequence_borrow_element_field_type(ft);
- BT_ASSERT(element_ft);
+ BT_ASSERT_DBG(element_ft);
ret = bt_ctf_field_type_common_get_alignment(element_ft);
break;
}
struct bt_ctf_field_type_common *element_ft =
bt_ctf_field_type_common_array_borrow_element_field_type(ft);
- BT_ASSERT(element_ft);
+ BT_ASSERT_DBG(element_ft);
ret = bt_ctf_field_type_common_get_alignment(element_ft);
break;
}
element_count = bt_ctf_field_type_common_structure_get_field_count(
ft);
- BT_ASSERT(element_count >= 0);
+ BT_ASSERT_DBG(element_count >= 0);
for (i = 0; i < element_count; i++) {
struct bt_ctf_field_type_common *field = NULL;
ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
ft, NULL, &field, i);
- BT_ASSERT(ret == 0);
- BT_ASSERT(field);
+ BT_ASSERT_DBG(ret == 0);
+ BT_ASSERT_DBG(field);
field_alignment = bt_ctf_field_type_common_get_alignment(
field);
if (field_alignment < 0) {
return ((value & (value - 1)) == 0) && value > 0;
}
-BT_HIDDEN
int bt_ctf_field_type_common_set_alignment(struct bt_ctf_field_type_common *ft,
unsigned int alignment)
{
ft->alignment = alignment;
ret = 0;
- BT_LOGV("Set field type's alignment: addr=%p, align=%u",
+ BT_LOGT("Set field type's alignment: addr=%p, align=%u",
ft, alignment);
end:
return ret;
}
-BT_HIDDEN
enum bt_ctf_byte_order bt_ctf_field_type_common_get_byte_order(
struct bt_ctf_field_type_common *ft)
{
goto end;
}
- BT_ASSERT(ret == BT_CTF_BYTE_ORDER_NATIVE ||
+ BT_ASSERT_DBG(ret == BT_CTF_BYTE_ORDER_NATIVE ||
ret == BT_CTF_BYTE_ORDER_LITTLE_ENDIAN ||
ret == BT_CTF_BYTE_ORDER_BIG_ENDIAN ||
ret == BT_CTF_BYTE_ORDER_NETWORK);
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_set_byte_order(struct bt_ctf_field_type_common *ft,
enum bt_ctf_byte_order byte_order)
{
ft->methods->set_byte_order(ft, byte_order);
}
- BT_LOGV("Set field type's byte order: addr=%p, bo=%s",
+ BT_LOGT("Set field type's byte order: addr=%p, bo=%s",
ft, bt_ctf_byte_order_string(byte_order));
end:
return ret;
}
-BT_HIDDEN
enum bt_ctf_field_type_id bt_ctf_field_type_common_get_type_id(
struct bt_ctf_field_type_common *ft)
{
return ft->id;
}
-BT_HIDDEN
void bt_ctf_field_type_common_freeze(struct bt_ctf_field_type_common *ft)
{
if (!ft || ft->frozen) {
return;
}
- BT_ASSERT(ft->methods->freeze);
+ BT_ASSERT_DBG(ft->methods->freeze);
ft->methods->freeze(ft);
}
-BT_HIDDEN
struct bt_ctf_field_type_common *
bt_ctf_field_type_common_variant_borrow_field_type_signed(
struct bt_ctf_field_type_common_variant *var_ft,
return field_type;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *
bt_ctf_field_type_common_variant_borrow_field_type_unsigned(
struct bt_ctf_field_type_common_variant *var_ft,
return field_type;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *bt_ctf_field_type_common_copy(
struct bt_ctf_field_type_common *ft)
{
struct bt_ctf_field_type_common *ft_copy = NULL;
BT_CTF_ASSERT_PRE_NON_NULL(ft, "Field type");
- BT_ASSERT(ft->methods->copy);
+ BT_ASSERT_DBG(ft->methods->copy);
ft_copy = ft->methods->copy(ft);
if (!ft_copy) {
BT_LOGE_STR("Cannot copy field type.");
return ft_copy;
}
-BT_HIDDEN
int bt_ctf_field_type_common_structure_get_field_name_index(
struct bt_ctf_field_type_common *ft, const char *name)
{
name_quark = g_quark_try_string(name);
if (!name_quark) {
- BT_LOGV("No such structure field type field name: "
+ BT_LOGT("No such structure field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, name);
ret = -1;
if (!g_hash_table_lookup_extended(struct_ft->field_name_to_index,
GUINT_TO_POINTER(name_quark),
NULL, (gpointer *) &index)) {
- BT_LOGV("No such structure field type field name: "
+ BT_LOGT("No such structure field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, name);
ret = -1;
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_get_field_name_index(
struct bt_ctf_field_type_common *ft, const char *name)
{
"Field type");
name_quark = g_quark_try_string(name);
if (!name_quark) {
- BT_LOGV("No such variant field type field name: "
+ BT_LOGT("No such variant field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, name);
ret = -1;
if (!g_hash_table_lookup_extended(var_ft->choice_name_to_index,
GUINT_TO_POINTER(name_quark),
NULL, (gpointer *) &index)) {
- BT_LOGV("No such variant field type field name: "
+ BT_LOGT("No such variant field type field name: "
"ft-addr=%p, field-name=\"%s\"",
ft, name);
ret = -1;
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_sequence_set_length_field_path(
struct bt_ctf_field_type_common *ft, struct bt_ctf_field_path *path)
{
bt_ctf_object_get_ref(path);
BT_CTF_OBJECT_MOVE_REF(seq_ft->length_field_path, path);
- BT_LOGV("Set sequence field type's length field path: ft-addr=%p, "
+ BT_LOGT("Set sequence field type's length field path: ft-addr=%p, "
"field-path-addr=%p", ft, path);
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_set_tag_field_path(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_path *path)
bt_ctf_object_get_ref(path);
BT_CTF_OBJECT_MOVE_REF(var_ft->tag_field_path, path);
- BT_LOGV("Set variant field type's tag field path: ft-addr=%p, "
+ BT_LOGT("Set variant field type's tag field path: ft-addr=%p, "
"field-path-addr=%p", ft, path);
end:
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_set_tag_field_type(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_field_type_common *tag_ft)
bt_ctf_object_put_ref(var_ft->tag_ft);
var_ft->tag_ft = bt_ctf_object_get_ref(tag_ft);
- BT_LOGV("Set variant field type's tag field type: variant-ft-addr=%p, "
+ BT_LOGT("Set variant field type's tag field type: variant-ft-addr=%p, "
"tag-ft-addr=%p", ft, tag_ft);
end:
return ret;
}
-BT_HIDDEN
void bt_ctf_field_type_common_generic_freeze(struct bt_ctf_field_type_common *ft)
{
ft->frozen = 1;
}
-BT_HIDDEN
void bt_ctf_field_type_common_enumeration_freeze_recursive(
struct bt_ctf_field_type_common *ft)
{
bt_ctf_field_type_common_freeze(BT_CTF_TO_COMMON(enum_ft->container_ft));
}
-BT_HIDDEN
void bt_ctf_field_type_common_structure_freeze_recursive(
struct bt_ctf_field_type_common *ft)
{
}
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_update_choices(struct bt_ctf_field_type_common *ft)
{
struct bt_ctf_field_type_common_variant *var_ft = BT_CTF_FROM_COMMON(ft);
goto end;
}
- BT_ASSERT(var_ft->tag_ft);
+ BT_ASSERT_DBG(var_ft->tag_ft);
is_signed = !!var_ft->tag_ft->container_ft->is_signed;
for (i = 0; i < var_ft->choices->len; i++) {
goto end;
}
- BT_ASSERT(choice->ranges);
+ BT_ASSERT_DBG(choice->ranges);
g_array_set_size(choice->ranges, 0);
while (bt_ctf_field_type_enumeration_mapping_iterator_next(iter) == 0) {
&range.lower.u, &range.upper.u);
}
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
g_array_append_val(choice->ranges, range);
}
return ret;
}
-BT_HIDDEN
void bt_ctf_field_type_common_variant_freeze_recursive(
struct bt_ctf_field_type_common *ft)
{
}
}
-BT_HIDDEN
void bt_ctf_field_type_common_array_freeze_recursive(
struct bt_ctf_field_type_common *ft)
{
bt_ctf_field_type_common_freeze(array_ft->element_ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_sequence_freeze_recursive(
struct bt_ctf_field_type_common *ft)
{
bt_ctf_field_type_common_freeze(seq_ft->element_ft);
}
-BT_HIDDEN
void bt_ctf_field_type_common_integer_set_byte_order(
struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order)
{
int_ft->user_byte_order = byte_order;
}
-BT_HIDDEN
void bt_ctf_field_type_common_enumeration_set_byte_order_recursive(
struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order)
{
byte_order);
}
-BT_HIDDEN
void bt_ctf_field_type_common_floating_point_set_byte_order(
struct bt_ctf_field_type_common *ft, enum bt_ctf_byte_order byte_order)
{
flt_ft->user_byte_order = byte_order;
}
-BT_HIDDEN
void bt_ctf_field_type_common_structure_set_byte_order_recursive(
struct bt_ctf_field_type_common *ft,
enum bt_ctf_byte_order byte_order)
}
}
-BT_HIDDEN
void bt_ctf_field_type_common_variant_set_byte_order_recursive(
struct bt_ctf_field_type_common *ft,
enum bt_ctf_byte_order byte_order)
}
}
-BT_HIDDEN
void bt_ctf_field_type_common_array_set_byte_order_recursive(
struct bt_ctf_field_type_common *ft,
enum bt_ctf_byte_order byte_order)
bt_ctf_field_type_common_set_byte_order(array_ft->element_ft, byte_order);
}
-BT_HIDDEN
void bt_ctf_field_type_common_sequence_set_byte_order_recursive(
struct bt_ctf_field_type_common *ft,
enum bt_ctf_byte_order byte_order)
}
-BT_HIDDEN
int bt_ctf_field_type_common_integer_compare(struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
{
/* Length */
if (int_ft_a->size != int_ft_b->size) {
- BT_LOGV("Integer field types differ: different sizes: "
+ BT_LOGT("Integer field types differ: different sizes: "
"ft-a-size=%u, ft-b-size=%u",
int_ft_a->size, int_ft_b->size);
goto end;
/* Byte order */
if (int_ft_a->user_byte_order != int_ft_b->user_byte_order) {
- BT_LOGV("Integer field types differ: different byte orders: "
+ BT_LOGT("Integer field types differ: different byte orders: "
"ft-a-bo=%s, ft-b-bo=%s",
bt_ctf_byte_order_string(int_ft_a->user_byte_order),
bt_ctf_byte_order_string(int_ft_b->user_byte_order));
/* Signedness */
if (int_ft_a->is_signed != int_ft_b->is_signed) {
- BT_LOGV("Integer field types differ: different signedness: "
+ BT_LOGT("Integer field types differ: different signedness: "
"ft-a-is-signed=%d, ft-b-is-signed=%d",
int_ft_a->is_signed,
int_ft_b->is_signed);
/* Base */
if (int_ft_a->base != int_ft_b->base) {
- BT_LOGV("Integer field types differ: different bases: "
+ BT_LOGT("Integer field types differ: different bases: "
"ft-a-base=%s, ft-b-base=%s",
bt_ctf_integer_base_string(int_ft_a->base),
bt_ctf_integer_base_string(int_ft_b->base));
/* Encoding */
if (int_ft_a->encoding != int_ft_b->encoding) {
- BT_LOGV("Integer field types differ: different encodings: "
+ BT_LOGT("Integer field types differ: different encodings: "
"ft-a-encoding=%s, ft-b-encoding=%s",
bt_ctf_string_encoding_string(int_ft_a->encoding),
bt_ctf_string_encoding_string(int_ft_b->encoding));
/* Mapped clock class */
if (int_ft_a->mapped_clock_class) {
if (!int_ft_b->mapped_clock_class) {
- BT_LOGV_STR("Integer field types differ: field type A "
+ BT_LOGT_STR("Integer field types differ: field type A "
"has a mapped clock class, but field type B "
"does not.");
goto end;
if (bt_ctf_clock_class_compare(int_ft_a->mapped_clock_class,
int_ft_b->mapped_clock_class) != 0) {
- BT_LOGV_STR("Integer field types differ: different "
+ BT_LOGT_STR("Integer field types differ: different "
"mapped clock classes.");
}
} else {
if (int_ft_b->mapped_clock_class) {
- BT_LOGV_STR("Integer field types differ: field type A "
+ BT_LOGT_STR("Integer field types differ: field type A "
"has no description, but field type B has one.");
goto end;
}
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_floating_point_compare(
struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
/* Byte order */
if (flt_ft_a->user_byte_order != flt_ft_b->user_byte_order) {
- BT_LOGV("Floating point number field types differ: different byte orders: "
+ BT_LOGT("Floating point number field types differ: different byte orders: "
"ft-a-bo=%s, ft-b-bo=%s",
bt_ctf_byte_order_string(flt_ft_a->user_byte_order),
bt_ctf_byte_order_string(flt_ft_b->user_byte_order));
/* Exponent length */
if (flt_ft_a->exp_dig != flt_ft_b->exp_dig) {
- BT_LOGV("Floating point number field types differ: different exponent sizes: "
+ BT_LOGT("Floating point number field types differ: different exponent sizes: "
"ft-a-exp-size=%u, ft-b-exp-size=%u",
flt_ft_a->exp_dig, flt_ft_b->exp_dig);
goto end;
/* Mantissa length */
if (flt_ft_a->mant_dig != flt_ft_b->mant_dig) {
- BT_LOGV("Floating point number field types differ: different mantissa sizes: "
+ BT_LOGT("Floating point number field types differ: different mantissa sizes: "
"ft-a-mant-size=%u, ft-b-mant-size=%u",
flt_ft_a->mant_dig, flt_ft_b->mant_dig);
goto end;
/* Label */
if (mapping_a->string != mapping_b->string) {
- BT_LOGV("Enumeration field type mappings differ: different names: "
+ BT_LOGT("Enumeration field type mappings differ: different names: "
"mapping-a-name=\"%s\", mapping-b-name=\"%s\"",
g_quark_to_string(mapping_a->string),
g_quark_to_string(mapping_b->string));
/* Range start */
if (mapping_a->range_start._unsigned !=
mapping_b->range_start._unsigned) {
- BT_LOGV("Enumeration field type mappings differ: different starts of range: "
+ BT_LOGT("Enumeration field type mappings differ: different starts of range: "
"mapping-a-range-start-unsigned=%" PRIu64 ", "
"mapping-b-range-start-unsigned=%" PRIu64,
mapping_a->range_start._unsigned,
/* Range end */
if (mapping_a->range_end._unsigned !=
mapping_b->range_end._unsigned) {
- BT_LOGV("Enumeration field type mappings differ: different ends of range: "
+ BT_LOGT("Enumeration field type mappings differ: different ends of range: "
"mapping-a-range-end-unsigned=%" PRIu64 ", "
"mapping-b-range-end-unsigned=%" PRIu64,
mapping_a->range_end._unsigned,
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_enumeration_compare_recursive(
struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
BT_CTF_TO_COMMON(enum_ft_a->container_ft),
BT_CTF_TO_COMMON(enum_ft_b->container_ft));
if (ret) {
- BT_LOGV("Enumeration field types differ: different container field types: "
+ BT_LOGT("Enumeration field types differ: different container field types: "
"ft-a-container-ft-addr=%p, ft-b-container-ft-addr=%p",
enum_ft_a->container_ft, enum_ft_b->container_ft);
goto end;
g_ptr_array_index(enum_ft_b->entries, i);
if (compare_enumeration_mappings(mapping_a, mapping_b)) {
- BT_LOGV("Enumeration field types differ: different mappings: "
+ BT_LOGT("Enumeration field types differ: different mappings: "
"ft-a-mapping-addr=%p, ft-b-mapping-addr=%p, "
"ft-a-mapping-name=\"%s\", ft-b-mapping-name=\"%s\"",
mapping_a, mapping_b,
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_string_compare(struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
{
/* Encoding */
if (string_ft_a->encoding != string_ft_b->encoding) {
- BT_LOGV("String field types differ: different encodings: "
+ BT_LOGT("String field types differ: different encodings: "
"ft-a-encoding=%s, ft-b-encoding=%s",
bt_ctf_string_encoding_string(string_ft_a->encoding),
bt_ctf_string_encoding_string(string_ft_b->encoding));
/* Label */
if (member_a_name != member_b_name) {
- BT_LOGV("Structure/variant field type fields differ: different names: "
+ BT_LOGT("Structure/variant field type fields differ: different names: "
"field-a-name=%s, field-b-name=%s",
g_quark_to_string(member_a_name),
g_quark_to_string(member_b_name));
/* Type */
ret = bt_ctf_field_type_common_compare(member_a_ft, member_b_ft);
if (ret == 1) {
- BT_LOGV("Structure/variant field type fields differ: different field types: "
+ BT_LOGT("Structure/variant field type fields differ: different field types: "
"field-name=\"%s\", field-a-ft-addr=%p, field-b-ft-addr=%p",
g_quark_to_string(member_a_name),
member_a_ft, member_b_ft);
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_structure_compare_recursive(
struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
/* Alignment */
if (bt_ctf_field_type_common_get_alignment(ft_a) !=
bt_ctf_field_type_common_get_alignment(ft_b)) {
- BT_LOGV("Structure field types differ: different alignments: "
+ BT_LOGT("Structure field types differ: different alignments: "
"ft-a-align=%u, ft-b-align=%u",
bt_ctf_field_type_common_get_alignment(ft_a),
bt_ctf_field_type_common_get_alignment(ft_b));
/* Fields */
if (struct_ft_a->fields->len != struct_ft_b->fields->len) {
- BT_LOGV("Structure field types differ: different field counts: "
+ BT_LOGT("Structure field types differ: different field counts: "
"ft-a-field-count=%u, ft-b-field-count=%u",
struct_ft_a->fields->len, struct_ft_b->fields->len);
goto end;
field_b->type, field_a->name, field_b->name);
if (ret) {
/* compare_structure_variant_members() logs what differs */
- BT_LOGV_STR("Structure field types differ: different fields.");
+ BT_LOGT_STR("Structure field types differ: different fields.");
goto end;
}
}
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_variant_compare_recursive(
struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
/* Tag name */
if (strcmp(var_ft_a->tag_name->str, var_ft_b->tag_name->str)) {
- BT_LOGV("Variant field types differ: different tag field names: "
+ BT_LOGT("Variant field types differ: different tag field names: "
"ft-a-tag-field-name=\"%s\", ft-b-tag-field-name=\"%s\"",
var_ft_a->tag_name->str, var_ft_b->tag_name->str);
goto end;
ret = bt_ctf_field_type_common_compare(BT_CTF_TO_COMMON(var_ft_a->tag_ft),
BT_CTF_TO_COMMON(var_ft_b->tag_ft));
if (ret) {
- BT_LOGV("Variant field types differ: different tag field types: "
+ BT_LOGT("Variant field types differ: different tag field types: "
"ft-a-tag-ft-addr=%p, ft-b-tag-ft-addr=%p",
var_ft_a->tag_ft, var_ft_b->tag_ft);
goto end;
/* Fields */
if (var_ft_a->choices->len != var_ft_b->choices->len) {
- BT_LOGV("Variant field types differ: different field counts: "
+ BT_LOGT("Variant field types differ: different field counts: "
"ft-a-field-count=%u, ft-b-field-count=%u",
var_ft_a->choices->len, var_ft_b->choices->len);
goto end;
choice_b->type, choice_a->name, choice_b->name);
if (ret) {
/* compare_structure_variant_members() logs what differs */
- BT_LOGV_STR("Variant field types differ: different fields.");
+ BT_LOGT_STR("Variant field types differ: different fields.");
goto end;
}
}
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_array_compare_recursive(
struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
/* Length */
if (array_ft_a->length != array_ft_b->length) {
- BT_LOGV("Structure field types differ: different lengths: "
+ BT_LOGT("Structure field types differ: different lengths: "
"ft-a-length=%u, ft-b-length=%u",
array_ft_a->length, array_ft_b->length);
goto end;
ret = bt_ctf_field_type_common_compare(array_ft_a->element_ft,
array_ft_b->element_ft);
if (ret == 1) {
- BT_LOGV("Array field types differ: different element field types: "
+ BT_LOGT("Array field types differ: different element field types: "
"ft-a-element-ft-addr=%p, ft-b-element-ft-addr=%p",
array_ft_a->element_ft, array_ft_b->element_ft);
}
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_sequence_compare_recursive(
struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
/* Length name */
if (strcmp(seq_ft_a->length_field_name->str,
seq_ft_b->length_field_name->str)) {
- BT_LOGV("Sequence field types differ: different length field names: "
+ BT_LOGT("Sequence field types differ: different length field names: "
"ft-a-length-field-name=\"%s\", "
"ft-b-length-field-name=\"%s\"",
seq_ft_a->length_field_name->str,
ret = bt_ctf_field_type_common_compare(seq_ft_a->element_ft,
seq_ft_b->element_ft);
if (ret == 1) {
- BT_LOGV("Sequence field types differ: different element field types: "
+ BT_LOGT("Sequence field types differ: different element field types: "
"ft-a-element-ft-addr=%p, ft-b-element-ft-addr=%p",
seq_ft_a->element_ft, seq_ft_b->element_ft);
}
return ret;
}
-BT_HIDDEN
int bt_ctf_field_type_common_compare(struct bt_ctf_field_type_common *ft_a,
struct bt_ctf_field_type_common *ft_b)
{
if (ft_a->id != ft_b->id) {
/* Different type IDs */
- BT_LOGV("Field types differ: different IDs: "
+ BT_LOGT("Field types differ: different IDs: "
"ft-a-addr=%p, ft-b-addr=%p, "
"ft-a-id=%s, ft-b-id=%s",
ft_a, ft_b,
goto end;
}
- BT_ASSERT(ft_a->methods->compare);
+ BT_ASSERT_DBG(ft_a->methods->compare);
ret = ft_a->methods->compare(ft_a, ft_b);
if (ret == 1) {
- BT_LOGV("Field types differ: ft-a-addr=%p, ft-b-addr=%p",
+ BT_LOGT("Field types differ: ft-a-addr=%p, ft-b-addr=%p",
ft_a, ft_b);
}
return ret;
}
-BT_HIDDEN
int64_t bt_ctf_field_type_common_get_field_count(struct bt_ctf_field_type_common *ft)
{
int64_t field_count = -1;
return field_count;
}
-BT_HIDDEN
struct bt_ctf_field_type_common *bt_ctf_field_type_common_borrow_field_at_index(
struct bt_ctf_field_type_common *ft, int index)
{
return field_type;
}
-BT_HIDDEN
int bt_ctf_field_type_common_get_field_index(struct bt_ctf_field_type_common *ft,
const char *name)
{
return field_index;
}
-BT_HIDDEN
struct bt_ctf_field_path *bt_ctf_field_type_common_variant_borrow_tag_field_path(
struct bt_ctf_field_type_common *ft)
{
return var_ft->tag_field_path;
}
-BT_HIDDEN
struct bt_ctf_field_path *bt_ctf_field_type_common_sequence_borrow_length_field_path(
struct bt_ctf_field_type_common *ft)
{
return seq_ft->length_field_path;
}
-BT_HIDDEN
int bt_ctf_field_type_common_validate_single_clock_class(
struct bt_ctf_field_type_common *ft,
struct bt_ctf_clock_class **expected_clock_class)
goto end;
}
- BT_ASSERT(expected_clock_class);
+ BT_ASSERT_DBG(expected_clock_class);
switch (ft->id) {
case BT_CTF_FIELD_TYPE_ID_INTEGER:
/* Move reference to output parameter */
*expected_clock_class = bt_ctf_object_get_ref(mapped_clock_class);
mapped_clock_class = NULL;
- BT_LOGV("Setting expected clock class: "
+ BT_LOGT("Setting expected clock class: "
"expected-clock-class-addr=%p",
*expected_clock_class);
} else {
break;
default:
BT_LOGF("Unexpected field type ID: id=%d", ft->id);
- abort();
+ bt_common_abort();
}
- BT_ASSERT(sub_ft);
+ BT_ASSERT_DBG(sub_ft);
ret = bt_ctf_field_type_common_validate_single_clock_class(sub_ft,
expected_clock_class);
break;
ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
ft, &name, &member_type, i);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
ret = bt_ctf_field_type_common_validate_single_clock_class(
member_type, expected_clock_class);
if (ret) {
ret = bt_ctf_field_type_common_variant_borrow_field_by_index(
ft, &name, &member_type, i);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
ret = bt_ctf_field_type_common_validate_single_clock_class(
member_type, expected_clock_class);
if (ret) {
typedef int (*bt_ctf_field_type_serialize_func)(struct bt_ctf_field_type_common *,
struct metadata_context *);
-BT_HIDDEN
int bt_ctf_field_type_serialize_recursive(struct bt_ctf_field_type *type,
struct metadata_context *context)
{
struct bt_ctf_field_type_common *type_common = (void *) type;
bt_ctf_field_type_serialize_func serialize_func;
- BT_ASSERT(type);
- BT_ASSERT(context);
+ BT_ASSERT_DBG(type);
+ BT_ASSERT_DBG(context);
/* Make sure field type is valid before serializing it */
ret = bt_ctf_field_type_common_validate((void *) type);
const char *clock_name = bt_ctf_clock_class_get_name(
integer->mapped_clock_class);
- BT_ASSERT(clock_name);
+ BT_ASSERT_DBG(clock_name);
g_string_append_printf(context->string,
"; map = clock.%s.value", clock_name);
}
"ft-addr=%p, metadata-context-addr=%p", type, context);
container_type =
bt_ctf_field_type_common_enumeration_borrow_container_field_type(type);
- BT_ASSERT(container_type);
+ BT_ASSERT_DBG(container_type);
container_signed = bt_ctf_field_type_common_integer_is_signed(
container_type);
- BT_ASSERT(container_signed >= 0);
+ BT_ASSERT_DBG(container_signed >= 0);
g_string_append(context->string, "enum : ");
BT_LOGD_STR("Serializing CTF writer enumeration field type's container field type's metadata.");
ret = bt_ctf_field_type_serialize_recursive(
return 0;
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_integer_create(unsigned int size)
{
struct bt_ctf_field_type_common_integer *integer = NULL;
return (void *) integer;
}
+BT_EXPORT
int bt_ctf_field_type_integer_get_size(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_integer_get_size((void *) ft);
}
-bt_bool bt_ctf_field_type_integer_is_signed(struct bt_ctf_field_type *ft)
+BT_EXPORT
+bt_ctf_bool bt_ctf_field_type_integer_is_signed(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_integer_is_signed((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_integer_set_is_signed(struct bt_ctf_field_type *ft,
- bt_bool is_signed)
+ bt_ctf_bool is_signed)
{
return bt_ctf_field_type_common_integer_set_is_signed((void *) ft,
is_signed);
}
+BT_EXPORT
int bt_ctf_field_type_integer_set_size(struct bt_ctf_field_type *ft,
unsigned int size)
{
return bt_ctf_field_type_common_integer_set_size((void *) ft, size);
}
+BT_EXPORT
enum bt_ctf_integer_base bt_ctf_field_type_integer_get_base(
struct bt_ctf_field_type *ft)
{
return (int) bt_ctf_field_type_common_integer_get_base((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_integer_set_base(struct bt_ctf_field_type *ft,
enum bt_ctf_integer_base base)
{
(int) base);
}
+BT_EXPORT
enum bt_ctf_string_encoding bt_ctf_field_type_integer_get_encoding(
struct bt_ctf_field_type *ft)
{
return (int) bt_ctf_field_type_common_integer_get_encoding((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_integer_set_encoding(struct bt_ctf_field_type *ft,
enum bt_ctf_string_encoding encoding)
{
(int) encoding);
}
+BT_EXPORT
struct bt_ctf_clock_class *bt_ctf_field_type_integer_get_mapped_clock_class(
struct bt_ctf_field_type *ft)
{
(void *) ft));
}
+BT_EXPORT
int bt_ctf_field_type_integer_set_mapped_clock_class(
struct bt_ctf_field_type *ft,
struct bt_ctf_clock_class *clock_class)
clock_class);
}
+BT_EXPORT
int bt_ctf_field_type_enumeration_signed_get_mapping_by_index(
struct bt_ctf_field_type *ft, uint64_t index,
const char **mapping_name, int64_t *range_begin,
(void *) ft, index, mapping_name, range_begin, range_end);
}
+BT_EXPORT
int bt_ctf_field_type_enumeration_unsigned_get_mapping_by_index(
struct bt_ctf_field_type *ft, uint64_t index,
const char **mapping_name, uint64_t *range_begin,
(void *) ft, index, mapping_name, range_begin, range_end);
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_enumeration_create(
struct bt_ctf_field_type *container_ft)
{
return (void *) enumeration;
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_enumeration_get_container_field_type(
struct bt_ctf_field_type *ft)
{
(void *) ft));
}
+BT_EXPORT
int bt_ctf_field_type_enumeration_signed_add_mapping(
struct bt_ctf_field_type *ft, const char *string,
int64_t range_start, int64_t range_end)
(void *) ft, string, range_start, range_end);
}
+BT_EXPORT
int bt_ctf_field_type_enumeration_unsigned_add_mapping(
struct bt_ctf_field_type *ft, const char *string,
uint64_t range_start, uint64_t range_end)
(void *) ft, string, range_start, range_end);
}
+BT_EXPORT
int64_t bt_ctf_field_type_enumeration_get_mapping_count(
struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_enumeration_get_mapping_count((void *) ft);
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_floating_point_create(void)
{
struct bt_ctf_field_type_common_floating_point *floating_point =
return (void *) floating_point;
}
+BT_EXPORT
int bt_ctf_field_type_floating_point_get_exponent_digits(
struct bt_ctf_field_type *ft)
{
(void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_floating_point_set_exponent_digits(
struct bt_ctf_field_type *ft, unsigned int exponent_digits)
{
(void *) ft, exponent_digits);
}
+BT_EXPORT
int bt_ctf_field_type_floating_point_get_mantissa_digits(
struct bt_ctf_field_type *ft)
{
(void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_floating_point_set_mantissa_digits(
struct bt_ctf_field_type *ft, unsigned int mantissa_digits)
{
(void *) ft, mantissa_digits);
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_structure_create(void)
{
struct bt_ctf_field_type_common_structure *structure =
return (void *) structure;
}
+BT_EXPORT
int bt_ctf_field_type_structure_add_field(struct bt_ctf_field_type *ft,
struct bt_ctf_field_type *field_type,
const char *field_name)
(void *) field_type, field_name);
}
+BT_EXPORT
int64_t bt_ctf_field_type_structure_get_field_count(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_structure_get_field_count((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_structure_get_field_by_index(
struct bt_ctf_field_type *ft,
const char **field_name,
return ret;
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_structure_get_field_type_by_name(
struct bt_ctf_field_type *ft, const char *name)
{
(void *) ft, name));
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_variant_create(
struct bt_ctf_field_type *tag_ft, const char *tag_name)
{
return (void *) var_ft;
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_variant_get_tag_field_type(
struct bt_ctf_field_type *ft)
{
(void *) ft));
}
+BT_EXPORT
const char *bt_ctf_field_type_variant_get_tag_name(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_variant_get_tag_name((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_variant_set_tag_name(
struct bt_ctf_field_type *ft, const char *name)
{
return bt_ctf_field_type_common_variant_set_tag_name((void *) ft, name);
}
+BT_EXPORT
int bt_ctf_field_type_variant_add_field(struct bt_ctf_field_type *ft,
struct bt_ctf_field_type *field_type,
const char *field_name)
(void *) field_type, field_name);
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_by_name(
struct bt_ctf_field_type *ft,
const char *field_name)
(void *) ft, field_name));
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_variant_get_field_type_from_tag(
struct bt_ctf_field_type *ft,
struct bt_ctf_field *tag_field)
"Tag field");
container = bt_ctf_field_enumeration_borrow_container(tag_field);
- BT_ASSERT(container);
+ BT_ASSERT_DBG(container);
if (var_ft->tag_ft->container_ft->is_signed) {
int64_t val;
ret = bt_ctf_field_integer_signed_get_value(container,
&val);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
choice_index = bt_ctf_field_type_common_variant_find_choice_index(
(void *) ft, (uint64_t) val, true);
} else {
ret = bt_ctf_field_integer_unsigned_get_value(container,
&val);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
choice_index = bt_ctf_field_type_common_variant_find_choice_index(
(void *) ft, val, false);
}
ret = bt_ctf_field_type_variant_get_field_by_index(ft, NULL,
&ret_ft, choice_index);
- BT_ASSERT(ret == 0);
+ BT_ASSERT_DBG(ret == 0);
end:
return ret_ft;
}
+BT_EXPORT
int64_t bt_ctf_field_type_variant_get_field_count(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_variant_get_field_count((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_variant_get_field_by_index(struct bt_ctf_field_type *ft,
const char **field_name, struct bt_ctf_field_type **field_type,
uint64_t index)
return ret;
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_array_create(
struct bt_ctf_field_type *element_ft, unsigned int length)
{
return (void *) array;
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_array_get_element_field_type(
struct bt_ctf_field_type *ft)
{
(void *) ft));
}
+BT_EXPORT
int64_t bt_ctf_field_type_array_get_length(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_array_get_length((void *) ft);
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_sequence_create(
struct bt_ctf_field_type *element_ft,
const char *length_field_name)
return (void *) sequence;
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_sequence_get_element_field_type(
struct bt_ctf_field_type *ft)
{
(void *) ft));
}
+BT_EXPORT
const char *bt_ctf_field_type_sequence_get_length_field_name(
struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_sequence_get_length_field_name((void *) ft);
}
+BT_EXPORT
struct bt_ctf_field_type *bt_ctf_field_type_string_create(void)
{
struct bt_ctf_field_type_common_string *string =
return (void *) string;
}
+BT_EXPORT
enum bt_ctf_string_encoding bt_ctf_field_type_string_get_encoding(
struct bt_ctf_field_type *ft)
{
return (int) bt_ctf_field_type_common_string_get_encoding((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_string_set_encoding(struct bt_ctf_field_type *ft,
enum bt_ctf_string_encoding encoding)
{
(int) encoding);
}
+BT_EXPORT
int bt_ctf_field_type_get_alignment(struct bt_ctf_field_type *ft)
{
return bt_ctf_field_type_common_get_alignment((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_set_alignment(struct bt_ctf_field_type *ft,
unsigned int alignment)
{
return bt_ctf_field_type_common_set_alignment((void *) ft, alignment);
}
+BT_EXPORT
enum bt_ctf_byte_order bt_ctf_field_type_get_byte_order(
struct bt_ctf_field_type *ft)
{
return (int) bt_ctf_field_type_common_get_byte_order((void *) ft);
}
+BT_EXPORT
int bt_ctf_field_type_set_byte_order(struct bt_ctf_field_type *ft,
enum bt_ctf_byte_order byte_order)
{
(int) byte_order);
}
+BT_EXPORT
enum bt_ctf_field_type_id bt_ctf_field_type_get_type_id(
struct bt_ctf_field_type *ft)
{
return (int) bt_ctf_field_type_common_get_type_id((void *) ft);
}
-BT_HIDDEN
struct bt_ctf_field_type *bt_ctf_field_type_copy(struct bt_ctf_field_type *ft)
{
return (void *) bt_ctf_field_type_common_copy((void *) ft);
/* Copy ranges */
copy_entry->ranges = g_array_new(FALSE, TRUE,
sizeof(struct bt_ctf_field_type_common_variant_choice_range));
- BT_ASSERT(copy_entry->ranges);
+ BT_ASSERT_DBG(copy_entry->ranges);
g_array_set_size(copy_entry->ranges, entry->ranges->len);
for (range_i = 0; range_i < entry->ranges->len; range_i++) {