X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Fctf-writer%2Fevent-class.c;h=1f49549f1fb804df892317b58081d20b4da93d49;hb=8009058387e16d70c065f8afb24953ed389c18a6;hp=823165c8c5c0fd6a62067be490e7041a28c484e1;hpb=217cf9d33a3ffc88e6eeaf21f3d46ee00cbeb0c4;p=babeltrace.git diff --git a/src/ctf-writer/event-class.c b/src/ctf-writer/event-class.c index 823165c8..1f49549f 100644 --- a/src/ctf-writer/event-class.c +++ b/src/ctf-writer/event-class.c @@ -1,24 +1,8 @@ /* + * SPDX-License-Identifier: MIT + * * Copyright 2013, 2014 Jérémie Galarneau * Copyright 2017-2018 Philippe Proulx - * - * 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: - * - * 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. */ #define BT_LOG_TAG "CTF-WRITER/EVENT-CLASS" @@ -118,7 +102,7 @@ error: BT_HIDDEN void bt_ctf_event_class_common_freeze(struct bt_ctf_event_class_common *event_class) { - BT_ASSERT(event_class); + BT_ASSERT_DBG(event_class); if (event_class->frozen) { return; @@ -141,8 +125,8 @@ int bt_ctf_event_class_common_validate_single_clock_class( { int ret = 0; - BT_ASSERT(event_class); - BT_ASSERT(expected_clock_class); + BT_ASSERT_DBG(event_class); + BT_ASSERT_DBG(expected_clock_class); ret = bt_ctf_field_type_common_validate_single_clock_class( event_class->context_field_type, expected_clock_class); @@ -347,7 +331,7 @@ int bt_ctf_event_class_add_field(struct bt_ctf_event_class *event_class, goto end; } - BT_ASSERT(bt_ctf_field_type_common_get_type_id( + BT_ASSERT_DBG(bt_ctf_field_type_common_get_type_id( event_class->common.payload_field_type) == BT_CTF_FIELD_TYPE_ID_STRUCT); ret = bt_ctf_field_type_structure_add_field( @@ -382,7 +366,7 @@ int64_t bt_ctf_event_class_get_payload_type_field_count( goto end; } - BT_ASSERT(bt_ctf_field_type_common_get_type_id( + BT_ASSERT_DBG(bt_ctf_field_type_common_get_type_id( event_class->common.payload_field_type) == BT_CTF_FIELD_TYPE_ID_STRUCT); ret = bt_ctf_field_type_common_structure_get_field_count( @@ -413,7 +397,7 @@ int bt_ctf_event_class_get_payload_type_field_by_index( goto end; } - BT_ASSERT(bt_ctf_field_type_common_get_type_id( + BT_ASSERT_DBG(bt_ctf_field_type_common_get_type_id( event_class->common.payload_field_type) == BT_CTF_FIELD_TYPE_ID_STRUCT); ret = bt_ctf_field_type_structure_get_field_by_index( @@ -446,7 +430,7 @@ bt_ctf_event_class_get_payload_type_field_type_by_name( goto end; } - BT_ASSERT(bt_ctf_field_type_common_get_type_id( + BT_ASSERT_DBG(bt_ctf_field_type_common_get_type_id( event_class->common.payload_field_type) == BT_CTF_FIELD_TYPE_ID_STRUCT); name_quark = g_quark_try_string(name); @@ -474,8 +458,8 @@ int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class, int ret = 0; struct bt_ctf_value *attr_value = NULL; - BT_ASSERT(event_class); - BT_ASSERT(context); + BT_ASSERT_DBG(event_class); + BT_ASSERT_DBG(context); BT_LOGD("Serializing event class's metadata: " "event-class-addr=%p, event-class-name=\"%s\", " "event-class-id=%" PRId64 ", metadata-context-addr=%p", @@ -488,7 +472,7 @@ int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class, /* Serialize attributes */ g_string_append_printf(context->string, "\tname = \"%s\";\n", event_class->common.name->str); - BT_ASSERT(event_class->common.id >= 0); + BT_ASSERT_DBG(event_class->common.id >= 0); g_string_append_printf(context->string, "\tid = %" PRId64 ";\n", event_class->common.id); g_string_append_printf(context->string, "\tstream_id = %" PRId64 ";\n", @@ -567,7 +551,7 @@ struct bt_ctf_field_type *bt_ctf_event_class_get_field_by_name( goto end; } - BT_ASSERT(event_class->common.payload_field_type->id == + BT_ASSERT_DBG(event_class->common.payload_field_type->id == BT_CTF_FIELD_TYPE_ID_STRUCT); name_quark = g_quark_try_string(name); if (!name_quark) {