STATE_AFTER_STREAM_PACKET_CONTEXT,
STATE_CHECK_EMIT_MSG_STREAM_BEGINNING,
STATE_EMIT_MSG_STREAM_BEGINNING,
- STATE_EMIT_MSG_STREAM_ACTIVITY_BEGINNING,
STATE_CHECK_EMIT_MSG_DISCARDED_EVENTS,
STATE_CHECK_EMIT_MSG_DISCARDED_PACKETS,
STATE_EMIT_MSG_DISCARDED_EVENTS,
STATE_SKIP_PACKET_PADDING,
STATE_EMIT_MSG_PACKET_END_MULTI,
STATE_EMIT_MSG_PACKET_END_SINGLE,
- STATE_CHECK_EMIT_MSG_STREAM_ACTIVITY_END,
- STATE_EMIT_MSG_STREAM_ACTIVITY_END,
+ STATE_CHECK_EMIT_MSG_STREAM_END,
STATE_EMIT_MSG_STREAM_END,
STATE_DONE,
};
/* Current message iterator to create messages (weak) */
bt_self_message_iterator *msg_iter;
- /*
- * True to emit stream beginning and stream activity beginning
- * messages.
- */
+ /* True to emit a stream beginning message. */
bool emit_stream_begin_msg;
- /* True to emit stream end and stream activity end messages */
+ /* True to emit a stream end message. */
bool emit_stream_end_msg;
/* True to set the stream */
return "STATE_AFTER_STREAM_PACKET_CONTEXT";
case STATE_EMIT_MSG_STREAM_BEGINNING:
return "STATE_EMIT_MSG_STREAM_BEGINNING";
- case STATE_EMIT_MSG_STREAM_ACTIVITY_BEGINNING:
- return "STATE_EMIT_MSG_STREAM_ACTIVITY_BEGINNING";
case STATE_EMIT_MSG_PACKET_BEGINNING:
return "STATE_EMIT_MSG_PACKET_BEGINNING";
case STATE_EMIT_MSG_DISCARDED_EVENTS:
return "STATE_EMIT_MSG_PACKET_END_MULTI";
case STATE_EMIT_MSG_PACKET_END_SINGLE:
return "STATE_EMIT_MSG_PACKET_END_SINGLE";
- case STATE_EMIT_MSG_STREAM_ACTIVITY_END:
- return "STATE_EMIT_MSG_STREAM_ACTIVITY_END";
case STATE_EMIT_MSG_STREAM_END:
return "STATE_EMIT_MSG_STREAM_END";
case STATE_DONE:
BT_ASSERT(stack);
notit = stack->notit;
BT_ASSERT(base);
- BT_COMP_LOGV("Pushing base field on stack: stack-addr=%p, "
+ 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);
BT_ASSERT(stack);
BT_ASSERT(stack_size(stack));
notit = stack->notit;
- BT_COMP_LOGV("Popping from stack: "
+ BT_COMP_LOGT("Popping from stack: "
"stack-addr=%p, stack-size-before=%zu, stack-size-after=%zu",
stack, stack->size, stack->size - 1);
stack->size--;
static inline
void buf_consume_bits(struct bt_msg_iter *notit, size_t incr)
{
- BT_COMP_LOGV("Advancing cursor: notit-addr=%p, cur-before=%zu, cur-after=%zu",
+ BT_COMP_LOGT("Advancing cursor: notit-addr=%p, cur-before=%zu, cur-after=%zu",
notit, notit->buf.at, notit->buf.at + incr);
notit->buf.at += incr;
}
size_t consumed_bits;
notit->cur_dscope_field = dscope_field;
- BT_COMP_LOGV("Starting BFCR: notit-addr=%p, bfcr-addr=%p, fc-addr=%p",
+ BT_COMP_LOGT("Starting BFCR: notit-addr=%p, bfcr-addr=%p, fc-addr=%p",
notit, notit->bfcr, dscope_fc);
consumed_bits = bt_bfcr_start(notit->bfcr, dscope_fc,
notit->buf.addr, notit->buf.at, packet_at(notit),
notit->buf.sz, &bfcr_status);
- BT_COMP_LOGV("BFCR consumed bits: size=%zu", consumed_bits);
+ BT_COMP_LOGT("BFCR consumed bits: size=%zu", consumed_bits);
switch (bfcr_status) {
case BT_BFCR_STATUS_OK:
/* Field class was read completely */
- BT_COMP_LOGV_STR("Field was completely decoded.");
+ BT_COMP_LOGT_STR("Field was completely decoded.");
notit->state = done_state;
break;
case BT_BFCR_STATUS_EOF:
- BT_COMP_LOGV_STR("BFCR needs more data to decode field completely.");
+ BT_COMP_LOGT_STR("BFCR needs more data to decode field completely.");
notit->state = continue_state;
break;
default:
enum bt_bfcr_status bfcr_status;
size_t consumed_bits;
- BT_COMP_LOGV("Continuing BFCR: notit-addr=%p, bfcr-addr=%p",
+ BT_COMP_LOGT("Continuing BFCR: notit-addr=%p, bfcr-addr=%p",
notit, notit->bfcr);
status = buf_ensure_available_bits(notit);
"msg-addr=%p, status=%s",
notit, bt_msg_iter_status_string(status));
} else {
- BT_COMP_LOGV("Cannot ensure that buffer has at least one byte: "
+ BT_COMP_LOGT("Cannot ensure that buffer has at least one byte: "
"msg-addr=%p, status=%s",
notit, bt_msg_iter_status_string(status));
}
consumed_bits = bt_bfcr_continue(notit->bfcr, notit->buf.addr,
notit->buf.sz, &bfcr_status);
- BT_COMP_LOGV("BFCR consumed bits: size=%zu", consumed_bits);
+ BT_COMP_LOGT("BFCR consumed bits: size=%zu", consumed_bits);
switch (bfcr_status) {
case BT_BFCR_STATUS_OK:
/* Type was read completely. */
- BT_COMP_LOGV_STR("Field was completely decoded.");
+ BT_COMP_LOGT_STR("Field was completely decoded.");
notit->state = done_state;
break;
case BT_BFCR_STATUS_EOF:
/* Stay in this continue state. */
- BT_COMP_LOGV_STR("BFCR needs more data to decode field completely.");
+ BT_COMP_LOGT_STR("BFCR needs more data to decode field completely.");
break;
default:
BT_COMP_LOGW("BFCR failed to continue: notit-addr=%p, bfcr-addr=%p, "
break;
case BT_MSG_ITER_STATUS_EOF:
ret = BT_MSG_ITER_STATUS_OK;
- notit->state = STATE_CHECK_EMIT_MSG_STREAM_ACTIVITY_END;
+ notit->state = STATE_CHECK_EMIT_MSG_STREAM_END;
goto end;
default:
goto end;
BT_ASSERT(notit->meta.sc);
if (bt_stream_class_borrow_default_clock_class(notit->meta.sc->ir_sc)) {
- msg = bt_message_event_create_with_default_clock_snapshot(
+ msg = bt_message_event_create_with_packet_and_default_clock_snapshot(
notit->msg_iter, notit->meta.ec->ir_ec,
notit->packet, notit->default_clock_snapshot);
} else {
- msg = bt_message_event_create(notit->msg_iter,
+ msg = bt_message_event_create_with_packet(notit->msg_iter,
notit->meta.ec->ir_ec, notit->packet);
}
BT_ASSERT(notit->dscopes.event_common_context);
}
- BT_COMP_LOGV("Decoding event common context field: "
+ BT_COMP_LOGT("Decoding event common context field: "
"notit-addr=%p, stream-class-addr=%p, "
"stream-class-id=%" PRId64 ", "
"fc-addr=%p",
BT_ASSERT(notit->dscopes.event_spec_context);
}
- BT_COMP_LOGV("Decoding event specific context field: "
+ BT_COMP_LOGT("Decoding event specific context field: "
"notit-addr=%p, event-class-addr=%p, "
"event-class-name=\"%s\", event-class-id=%" PRId64 ", "
"fc-addr=%p",
BT_ASSERT(notit->dscopes.event_payload);
}
- BT_COMP_LOGV("Decoding event payload field: "
+ BT_COMP_LOGT("Decoding event payload field: "
"notit-addr=%p, event-class-addr=%p, "
"event-class-name=\"%s\", event-class-id=%" PRId64 ", "
"fc-addr=%p",
}
static
-enum bt_msg_iter_status check_emit_msg_stream_activity_end(
+enum bt_msg_iter_status check_emit_msg_stream_end(
struct bt_msg_iter *notit)
{
if (notit->emit_stream_end_msg) {
- notit->state = STATE_EMIT_MSG_STREAM_ACTIVITY_END;
+ notit->state = STATE_EMIT_MSG_STREAM_END;
} else {
notit->state = STATE_DONE;
}
enum bt_msg_iter_status status = BT_MSG_ITER_STATUS_OK;
const enum state state = notit->state;
- BT_COMP_LOGV("Handling state: notit-addr=%p, state=%s",
+ BT_COMP_LOGT("Handling state: notit-addr=%p, state=%s",
notit, state_string(state));
// TODO: optimalize!
status = check_emit_msg_stream_beginning_state(notit);
break;
case STATE_EMIT_MSG_STREAM_BEGINNING:
- notit->state = STATE_EMIT_MSG_STREAM_ACTIVITY_BEGINNING;
- break;
- case STATE_EMIT_MSG_STREAM_ACTIVITY_BEGINNING:
notit->state = STATE_CHECK_EMIT_MSG_DISCARDED_EVENTS;
break;
case STATE_CHECK_EMIT_MSG_DISCARDED_EVENTS:
notit->state = STATE_SKIP_PACKET_PADDING;
break;
case STATE_EMIT_MSG_PACKET_END_SINGLE:
- notit->state = STATE_CHECK_EMIT_MSG_STREAM_ACTIVITY_END;
+ notit->state = STATE_CHECK_EMIT_MSG_STREAM_END;
break;
- case STATE_CHECK_EMIT_MSG_STREAM_ACTIVITY_END:
- status = check_emit_msg_stream_activity_end(notit);
- break;
- case STATE_EMIT_MSG_STREAM_ACTIVITY_END:
- notit->state = STATE_EMIT_MSG_STREAM_END;
+ case STATE_CHECK_EMIT_MSG_STREAM_END:
+ status = check_emit_msg_stream_end(notit);
break;
case STATE_EMIT_MSG_STREAM_END:
notit->state = STATE_DONE;
abort();
}
- BT_COMP_LOGV("Handled state: notit-addr=%p, status=%s, "
+ BT_COMP_LOGT("Handled state: notit-addr=%p, status=%s, "
"prev-state=%s, cur-state=%s",
notit, bt_msg_iter_status_string(status),
state_string(state), state_string(notit->state));
notit->default_clock_snapshot |= new_val;
end:
- BT_COMP_LOGV("Updated default clock's value from integer field's value: "
+ BT_COMP_LOGT("Updated default clock's value from integer field's value: "
"value=%" PRIu64, notit->default_clock_snapshot);
}
bt_field *field = NULL;
struct ctf_field_class_int *int_fc = (void *) fc;
- BT_COMP_LOGV("Unsigned integer function called from BFCR: "
+ BT_COMP_LOGT("Unsigned integer function called from BFCR: "
"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);
struct ctf_field_class_int *int_fc = (void *) fc;
char str[2] = {'\0', '\0'};
- BT_COMP_LOGV("Unsigned integer character function called from BFCR: "
+ BT_COMP_LOGT("Unsigned integer character function called from BFCR: "
"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);
struct bt_msg_iter *notit = data;
struct ctf_field_class_int *int_fc = (void *) fc;
- BT_COMP_LOGV("Signed integer function called from BFCR: "
+ BT_COMP_LOGT("Signed integer function called from BFCR: "
"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_field *field = NULL;
struct bt_msg_iter *notit = data;
- BT_COMP_LOGV("Floating point number function called from BFCR: "
+ BT_COMP_LOGT("Floating point number function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d, value=%f",
notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
{
bt_field *field = NULL;
struct bt_msg_iter *notit = data;
- int ret;
- BT_COMP_LOGV("String (beginning) function called from BFCR: "
+ BT_COMP_LOGT("String (beginning) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d",
notit, notit->bfcr, fc, fc->type, fc->in_ir);
BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc);
BT_ASSERT(bt_field_get_class_type(field) ==
BT_FIELD_CLASS_TYPE_STRING);
- ret = bt_field_string_clear(field);
- BT_ASSERT(ret == 0);
+ bt_field_string_clear(field);
/*
* Push on stack. Not a compound class per se, but we know that
struct bt_msg_iter *notit = data;
int ret;
- BT_COMP_LOGV("String (substring) function called from BFCR: "
+ BT_COMP_LOGT("String (substring) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d, string-length=%zu",
notit, notit->bfcr, fc, fc->type, fc->in_ir,
{
struct bt_msg_iter *notit = data;
- BT_COMP_LOGV("String (end) function called from BFCR: "
+ BT_COMP_LOGT("String (end) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d",
notit, notit->bfcr, fc, fc->type, fc->in_ir);
struct bt_msg_iter *notit = data;
bt_field *field;
- BT_COMP_LOGV("Compound (beginning) function called from BFCR: "
+ BT_COMP_LOGT("Compound (beginning) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d",
notit, notit->bfcr, fc, fc->type, fc->in_ir);
struct ctf_field_class_array_base *array_fc = (void *) fc;
if (array_fc->is_text) {
- int ret;
-
BT_ASSERT(bt_field_get_class_type(field) ==
BT_FIELD_CLASS_TYPE_STRING);
notit->done_filling_string = false;
- ret = bt_field_string_clear(field);
- BT_ASSERT(ret == 0);
+ bt_field_string_clear(field);
bt_bfcr_set_unsigned_int_cb(notit->bfcr,
bfcr_unsigned_int_char_cb);
}
{
struct bt_msg_iter *notit = data;
- BT_COMP_LOGV("Compound (end) function called from BFCR: "
+ BT_COMP_LOGT("Compound (end) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
"fc-type=%d, fc-in-ir=%d",
notit, notit->bfcr, fc, fc->type, fc->in_ir);
*message = ret;
}
-static
-void create_msg_stream_activity_beginning(struct bt_msg_iter *notit,
- bt_message **message)
-{
- bt_message *ret = NULL;
-
- BT_ASSERT(notit->stream);
- BT_ASSERT(notit->msg_iter);
- ret = bt_message_stream_activity_beginning_create(notit->msg_iter,
- notit->stream);
- if (!ret) {
- BT_COMP_LOGE("Cannot create stream activity beginning message: "
- "notit-addr=%p, stream-addr=%p",
- notit, notit->stream);
- return;
- }
-
- *message = ret;
-}
-
-static
-void create_msg_stream_activity_end(struct bt_msg_iter *notit,
- bt_message **message)
-{
- bt_message *ret = NULL;
-
- if (!notit->stream) {
- BT_COMP_LOGE("Cannot create stream for stream message: "
- "notit-addr=%p", notit);
- return;
- }
-
- BT_ASSERT(notit->stream);
- BT_ASSERT(notit->msg_iter);
- ret = bt_message_stream_activity_end_create(notit->msg_iter,
- notit->stream);
- if (!ret) {
- BT_COMP_LOGE("Cannot create stream activity end message: "
- "notit-addr=%p, stream-addr=%p",
- notit, notit->stream);
- return;
- }
-
- *message = ret;
-}
-
static
void create_msg_stream_end(struct bt_msg_iter *notit, bt_message **message)
{
status = BT_MSG_ITER_STATUS_ERROR;
}
- goto end;
- case STATE_EMIT_MSG_STREAM_ACTIVITY_BEGINNING:
- /* create_msg_stream_activity_beginning() logs errors */
- create_msg_stream_activity_beginning(notit, message);
-
- if (!*message) {
- status = BT_MSG_ITER_STATUS_ERROR;
- }
-
- goto end;
- case STATE_EMIT_MSG_STREAM_ACTIVITY_END:
- /* create_msg_stream_activity_end() logs errors */
- create_msg_stream_activity_end(notit, message);
-
- if (!*message) {
- status = BT_MSG_ITER_STATUS_ERROR;
- }
-
goto end;
case STATE_EMIT_MSG_STREAM_BEGINNING:
/* create_msg_stream_beginning() logs errors */
case STATE_AFTER_STREAM_PACKET_CONTEXT:
case STATE_CHECK_EMIT_MSG_STREAM_BEGINNING:
case STATE_EMIT_MSG_STREAM_BEGINNING:
- case STATE_EMIT_MSG_STREAM_ACTIVITY_BEGINNING:
case STATE_CHECK_EMIT_MSG_DISCARDED_EVENTS:
case STATE_EMIT_MSG_DISCARDED_EVENTS:
case STATE_CHECK_EMIT_MSG_DISCARDED_PACKETS: