{
struct bt_msg_iter *notit;
- BT_ASSERT(stack);
+ BT_ASSERT_DBG(stack);
notit = stack->notit;
BT_COMP_LOGD("Destroying stack: addr=%p", stack);
struct stack_entry *entry;
struct bt_msg_iter *notit;
- BT_ASSERT(stack);
+ BT_ASSERT_DBG(stack);
notit = stack->notit;
- BT_ASSERT(base);
+ BT_ASSERT_DBG(base);
BT_COMP_LOGT("Pushing base field on stack: stack-addr=%p, "
"stack-size-before=%zu, stack-size-after=%zu",
stack, stack->size, stack->size + 1);
static inline
unsigned int stack_size(struct stack *stack)
{
- BT_ASSERT(stack);
+ BT_ASSERT_DBG(stack);
return stack->size;
}
{
struct bt_msg_iter *notit;
- BT_ASSERT(stack);
- BT_ASSERT(stack_size(stack));
+ BT_ASSERT_DBG(stack);
+ BT_ASSERT_DBG(stack_size(stack));
notit = stack->notit;
BT_COMP_LOGT("Popping from stack: "
"stack-addr=%p, stack-size-before=%zu, stack-size-after=%zu",
static inline
struct stack_entry *stack_top(struct stack *stack)
{
- BT_ASSERT(stack);
- BT_ASSERT(stack_size(stack));
+ BT_ASSERT_DBG(stack);
+ BT_ASSERT_DBG(stack_size(stack));
return &g_array_index(stack->entries, struct stack_entry,
stack->size - 1);
}
static
void stack_clear(struct stack *stack)
{
- BT_ASSERT(stack);
+ BT_ASSERT_DBG(stack);
stack->size = 0;
}
enum bt_msg_iter_status status = BT_MSG_ITER_STATUS_OK;
bt_message *msg = NULL;
- BT_ASSERT(notit->meta.ec);
- BT_ASSERT(notit->packet);
+ BT_ASSERT_DBG(notit->meta.ec);
+ BT_ASSERT_DBG(notit->packet);
BT_COMP_LOGD("Creating event message from event class and packet: "
"notit-addr=%p, ec-addr=%p, ec-name=\"%s\", packet-addr=%p",
notit, notit->meta.ec,
notit->meta.ec->name->str,
notit->packet);
- BT_ASSERT(notit->msg_iter);
- BT_ASSERT(notit->meta.sc);
+ BT_ASSERT_DBG(notit->msg_iter);
+ BT_ASSERT_DBG(notit->meta.sc);
if (bt_stream_class_borrow_default_clock_class(notit->meta.sc->ir_sc)) {
msg = bt_message_event_create_with_packet_and_default_clock_snapshot(
notit->event = bt_message_event_borrow_event(
notit->event_msg);
- BT_ASSERT(notit->event);
+ BT_ASSERT_DBG(notit->event);
next_state:
notit->state = STATE_DSCOPE_EVENT_COMMON_CONTEXT_BEGIN;
}
if (event_common_context_fc->in_ir && !notit->dry_run) {
- BT_ASSERT(!notit->dscopes.event_common_context);
+ BT_ASSERT_DBG(!notit->dscopes.event_common_context);
notit->dscopes.event_common_context =
bt_event_borrow_common_context_field(
notit->event);
- BT_ASSERT(notit->dscopes.event_common_context);
+ BT_ASSERT_DBG(notit->dscopes.event_common_context);
}
BT_COMP_LOGT("Decoding event common context field: "
}
if (event_spec_context_fc->in_ir && !notit->dry_run) {
- BT_ASSERT(!notit->dscopes.event_spec_context);
+ BT_ASSERT_DBG(!notit->dscopes.event_spec_context);
notit->dscopes.event_spec_context =
bt_event_borrow_specific_context_field(
notit->event);
- BT_ASSERT(notit->dscopes.event_spec_context);
+ BT_ASSERT_DBG(notit->dscopes.event_spec_context);
}
BT_COMP_LOGT("Decoding event specific context field: "
}
if (event_payload_fc->in_ir && !notit->dry_run) {
- BT_ASSERT(!notit->dscopes.event_payload);
+ BT_ASSERT_DBG(!notit->dscopes.event_payload);
notit->dscopes.event_payload =
bt_event_borrow_payload_field(
notit->event);
- BT_ASSERT(notit->dscopes.event_payload);
+ BT_ASSERT_DBG(notit->dscopes.event_payload);
}
BT_COMP_LOGT("Decoding event payload field: "
bt_field *next_field = NULL;
bt_field *base_field;
const bt_field_class *base_fc;
+ bt_field_class_type base_fc_type;
size_t index;
- BT_ASSERT(!stack_empty(notit->stack));
+ BT_ASSERT_DBG(!stack_empty(notit->stack));
index = stack_top(notit->stack)->index;
base_field = stack_top(notit->stack)->base;
- BT_ASSERT(base_field);
+ BT_ASSERT_DBG(base_field);
base_fc = bt_field_borrow_class_const(base_field);
- BT_ASSERT(base_fc);
+ BT_ASSERT_DBG(base_fc);
+ base_fc_type = bt_field_class_get_type(base_fc);
- switch (bt_field_class_get_type(base_fc)) {
- case BT_FIELD_CLASS_TYPE_STRUCTURE:
- {
- BT_ASSERT(index <
+ if (base_fc_type == BT_FIELD_CLASS_TYPE_STRUCTURE) {
+ BT_ASSERT_DBG(index <
bt_field_class_structure_get_member_count(
bt_field_borrow_class_const(
base_field)));
next_field =
bt_field_structure_borrow_member_field_by_index(
base_field, index);
- break;
- }
- case BT_FIELD_CLASS_TYPE_STATIC_ARRAY:
- case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY:
- BT_ASSERT(index < bt_field_array_get_length(base_field));
+ } else if (bt_field_class_type_is(base_fc_type,
+ BT_FIELD_CLASS_TYPE_ARRAY)) {
+ BT_ASSERT_DBG(index < bt_field_array_get_length(base_field));
next_field = bt_field_array_borrow_element_field_by_index(
base_field, index);
- break;
- case BT_FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR:
- case BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR:
- case BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR:
- BT_ASSERT(index == 0);
+ } else if (bt_field_class_type_is(base_fc_type,
+ BT_FIELD_CLASS_TYPE_VARIANT)) {
+ BT_ASSERT_DBG(index == 0);
next_field = bt_field_variant_borrow_selected_option_field(
base_field);
- break;
- default:
+ } else {
abort();
}
- BT_ASSERT(next_field);
+ BT_ASSERT_DBG(next_field);
return next_field;
}
uint64_t new_val_mask;
uint64_t cur_value_masked;
- BT_ASSERT(new_val_size > 0);
+ BT_ASSERT_DBG(new_val_size > 0);
/*
* Special case for a 64-bit new value, which is the limit
}
field = borrow_next_field(notit);
- BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_type(field) ==
- BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER ||
- bt_field_get_class_type(field) ==
- BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
+ BT_ASSERT_DBG(field);
+ BT_ASSERT_DBG(bt_field_borrow_class_const(field) == fc->ir_fc);
+ BT_ASSERT_DBG(bt_field_class_type_is(bt_field_get_class_type(field),
+ BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER));
bt_field_integer_unsigned_set_value(field, value);
stack_top(notit->stack)->index++;
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d, value=%" PRIu64,
notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
- BT_ASSERT(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
- BT_ASSERT(!int_fc->mapped_clock_class);
- BT_ASSERT(int_fc->storing_index < 0);
+ BT_ASSERT_DBG(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
+ BT_ASSERT_DBG(!int_fc->mapped_clock_class);
+ BT_ASSERT_DBG(int_fc->storing_index < 0);
if (G_UNLIKELY(!fc->in_ir || notit->dry_run)) {
goto end;
}
string_field = stack_top(notit->stack)->base;
- BT_ASSERT(bt_field_get_class_type(string_field) ==
- BT_FIELD_CLASS_TYPE_STRING);
+ BT_ASSERT_DBG(bt_field_get_class_type(string_field) ==
+ BT_FIELD_CLASS_TYPE_STRING);
/* Append character */
str[0] = (char) value;
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d, value=%" PRId64,
notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
- BT_ASSERT(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
+ BT_ASSERT_DBG(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
if (G_UNLIKELY(int_fc->storing_index >= 0)) {
g_array_index(notit->stored_values, uint64_t,
}
field = borrow_next_field(notit);
- BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_type(field) ==
- BT_FIELD_CLASS_TYPE_SIGNED_INTEGER ||
- bt_field_get_class_type(field) ==
- BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
+ BT_ASSERT_DBG(field);
+ BT_ASSERT_DBG(bt_field_borrow_class_const(field) == fc->ir_fc);
+ BT_ASSERT_DBG(bt_field_class_type_is(bt_field_get_class_type(field),
+ BT_FIELD_CLASS_TYPE_SIGNED_INTEGER));
bt_field_integer_signed_set_value(field, value);
stack_top(notit->stack)->index++;
field = borrow_next_field(notit);
bt_field_class_type type = bt_field_get_class_type(field);
- BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc);
- BT_ASSERT(type == BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL ||
- type == BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL);
+ BT_ASSERT_DBG(field);
+ BT_ASSERT_DBG(bt_field_borrow_class_const(field) == fc->ir_fc);
+ BT_ASSERT_DBG(bt_field_class_type_is(type, BT_FIELD_CLASS_TYPE_REAL));
if (type == BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL) {
bt_field_real_single_precision_set_value(field, (float) value);
}
field = borrow_next_field(notit);
- BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_type(field) ==
+ BT_ASSERT_DBG(field);
+ BT_ASSERT_DBG(bt_field_borrow_class_const(field) == fc->ir_fc);
+ BT_ASSERT_DBG(bt_field_get_class_type(field) ==
BT_FIELD_CLASS_TYPE_STRING);
bt_field_string_clear(field);
}
field = stack_top(notit->stack)->base;
- BT_ASSERT(field);
+ BT_ASSERT_DBG(field);
/* Append current substring */
ret = bt_field_string_append_with_length(field, value, len);
field = notit->cur_dscope_field;
} else {
field = borrow_next_field(notit);
- BT_ASSERT(field);
+ BT_ASSERT_DBG(field);
}
/* Push field */
- BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc);
+ BT_ASSERT_DBG(field);
+ BT_ASSERT_DBG(bt_field_borrow_class_const(field) == fc->ir_fc);
stack_push(notit->stack, field);
/*
struct ctf_field_class_array_base *array_fc = (void *) fc;
if (array_fc->is_text) {
- BT_ASSERT(bt_field_get_class_type(field) ==
+ BT_ASSERT_DBG(bt_field_get_class_type(field) ==
BT_FIELD_CLASS_TYPE_STRING);
notit->done_filling_string = false;
bt_field_string_clear(field);
goto end;
}
- BT_ASSERT(!stack_empty(notit->stack));
- BT_ASSERT(bt_field_borrow_class_const(stack_top(notit->stack)->base) ==
+ BT_ASSERT_DBG(!stack_empty(notit->stack));
+ BT_ASSERT_DBG(bt_field_borrow_class_const(stack_top(notit->stack)->base) ==
fc->ir_fc);
/*
struct ctf_field_class_array_base *array_fc = (void *) fc;
if (array_fc->is_text) {
- BT_ASSERT(bt_field_get_class_type(
+ BT_ASSERT_DBG(bt_field_get_class_type(
stack_top(notit->stack)->base) ==
BT_FIELD_CLASS_TYPE_STRING);
bt_bfcr_set_unsigned_int_cb(notit->bfcr,
}
seq_field = stack_top(notit->stack)->base;
- BT_ASSERT(seq_field);
+ BT_ASSERT_DBG(seq_field);
/*
* bfcr_get_sequence_length_cb() also gets called back for a
* is a sequence field.
*/
if (!seq_fc->base.is_text) {
- BT_ASSERT(bt_field_get_class_type(seq_field) ==
- BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY);
+ BT_ASSERT_DBG(bt_field_class_type_is(
+ bt_field_get_class_type(seq_field),
+ BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY));
ret = bt_field_array_dynamic_set_length(seq_field,
(uint64_t) length);
if (ret) {
{
enum bt_msg_iter_status status = BT_MSG_ITER_STATUS_OK;
- BT_ASSERT(notit);
- BT_ASSERT(message);
+ BT_ASSERT_DBG(notit);
+ BT_ASSERT_DBG(message);
notit->msg_iter = msg_iter;
notit->set_stream = true;
BT_COMP_LOGD("Getting next message: notit-addr=%p", notit);
switch (notit->state) {
case STATE_EMIT_MSG_EVENT:
- BT_ASSERT(notit->event_msg);
+ BT_ASSERT_DBG(notit->event_msg);
/*
* Check if we need to emit the delayed packet
{
enum bt_msg_iter_status status = BT_MSG_ITER_STATUS_OK;
- BT_ASSERT(notit);
+ BT_ASSERT_DBG(notit);
notit->set_stream = false;
do {
{
enum bt_msg_iter_status status = BT_MSG_ITER_STATUS_OK;
- BT_ASSERT(notit);
- BT_ASSERT(clock_snapshot);
+ BT_ASSERT_DBG(notit);
+ BT_ASSERT_DBG(clock_snapshot);
status = decode_until_state(notit, target_state_1, target_state_2);
if (status != BT_MSG_ITER_STATUS_OK) {
goto end;
{
enum bt_msg_iter_status status;
- BT_ASSERT(notit);
- BT_ASSERT(props);
+ BT_ASSERT_DBG(notit);
+ BT_ASSERT_DBG(props);
status = read_packet_header_context_fields(notit);
if (status != BT_MSG_ITER_STATUS_OK) {
goto end;