#include <babeltrace/assert-internal.h>
#include <string.h>
#include <babeltrace/babeltrace.h>
-#include <babeltrace/ctf-ir/field-types-internal.h>
-#include <babeltrace/ctf-ir/field-path-internal.h>
+#include <babeltrace/common-internal.h>
#include <glib.h>
#include <stdlib.h>
}
/* Packet header type is common to the whole trace. */
- packet_header_type = bt_trace_get_packet_header_type(
+ packet_header_type = bt_trace_get_packet_header_field_type(
notit->meta.trace);
if (!packet_header_type) {
notit->state = STATE_AFTER_TRACE_PACKET_HEADER;
goto end;
}
- event_header = bt_stream_class_get_event_header_type(stream_class);
+ event_header = bt_stream_class_get_event_header_field_type(stream_class);
if (event_header && bt_field_type_is_structure(event_header)) {
int i, count;
}
}
- packet_context = bt_stream_class_get_packet_context_type(
+ packet_context = bt_stream_class_get_packet_context_field_type(
stream_class);
if (packet_context && bt_field_type_is_structure(packet_context)) {
int i, count;
notit->cur_sc_field_path_cache = NULL;
/* Is there any "stream_id" field in the packet header? */
- packet_header_type = bt_trace_get_packet_header_type(
+ packet_header_type = bt_trace_get_packet_header_field_type(
notit->meta.trace);
if (!packet_header_type) {
/*
stream_id_field = bt_field_structure_get_field_by_name(
notit->dscopes.trace_packet_header, "stream_id");
BT_ASSERT(stream_id_field);
- ret = bt_field_unsigned_integer_get_value(
+ ret = bt_field_integer_unsigned_get_value(
stream_id_field, &stream_id);
BT_ASSERT(!ret);
BT_PUT(stream_id_field);
struct bt_field_type *packet_context_type;
BT_ASSERT(notit->meta.stream_class);
- packet_context_type = bt_stream_class_get_packet_context_type(
+ packet_context_type = bt_stream_class_get_packet_context_field_type(
notit->meta.stream_class);
if (!packet_context_type) {
BT_LOGV("No packet packet context field type in stream class: continuing: "
content_size_field = bt_field_structure_get_field_by_name(
notit->dscopes.stream_packet_context, "content_size");
if (packet_size_field) {
- int ret = bt_field_unsigned_integer_get_value(
+ int ret = bt_field_integer_unsigned_get_value(
packet_size_field, &packet_size);
BT_ASSERT(ret == 0);
}
if (content_size_field) {
- int ret = bt_field_unsigned_integer_get_value(
+ int ret = bt_field_integer_unsigned_get_value(
content_size_field, &content_size);
BT_ASSERT(ret == 0);
}
}
- event_header_type = bt_stream_class_get_event_header_type(
+ event_header_type = bt_stream_class_get_event_header_field_type(
notit->meta.stream_class);
if (!event_header_type) {
notit->state = STATE_AFTER_STREAM_EVENT_HEADER;
uint64_t event_id = -1ULL;
int ret;
- event_header_type = bt_stream_class_get_event_header_type(
+ event_header_type = bt_stream_class_get_event_header_field_type(
notit->meta.stream_class);
if (!event_header_type) {
/*
}
if (bt_field_is_integer(v_struct_id_field)) {
- ret = bt_field_unsigned_integer_get_value(
+ ret = bt_field_integer_unsigned_get_value(
v_struct_id_field, &event_id);
if (ret) {
BT_LOGV("Cannot get value of unsigned integer field (`id`): continuing: "
}
if (bt_field_is_integer(id_field)) {
- ret_get_value = bt_field_unsigned_integer_get_value(
+ ret_get_value = bt_field_integer_unsigned_get_value(
id_field, &event_id);
} else if (bt_field_is_enumeration(id_field)) {
struct bt_field *container;
container = bt_field_enumeration_get_container(
id_field);
BT_ASSERT(container);
- ret_get_value = bt_field_unsigned_integer_get_value(
+ ret_get_value = bt_field_integer_unsigned_get_value(
container, &event_id);
BT_PUT(container);
}
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
struct bt_field_type *stream_event_context_type;
- stream_event_context_type = bt_stream_class_get_event_context_type(
- notit->meta.stream_class);
+ stream_event_context_type =
+ bt_stream_class_get_event_context_field_type(
+ notit->meta.stream_class);
if (!stream_event_context_type) {
notit->state = STATE_DSCOPE_EVENT_CONTEXT_BEGIN;
goto end;
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
struct bt_field_type *event_context_type;
- event_context_type = bt_event_class_get_context_type(
+ event_context_type = bt_event_class_get_context_field_type(
notit->meta.event_class);
if (!event_context_type) {
notit->state = STATE_DSCOPE_EVENT_PAYLOAD_BEGIN;
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
struct bt_field_type *event_payload_type;
- event_payload_type = bt_event_class_get_payload_type(
+ event_payload_type = bt_event_class_get_payload_field_type(
notit->meta.event_class);
if (!event_payload_type) {
notit->state = STATE_EMIT_NOTIF_EVENT;
BT_LOGF("Unknown base field type ID: "
"notit-addr=%p, ft-addr=%p, ft-id=%s",
notit, base_type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(base_type)));
abort();
}
requested_new_value_size =
bt_field_type_integer_get_size(value_type);
BT_ASSERT(requested_new_value_size > 0);
- ret = bt_field_unsigned_integer_get_value(value_field,
+ ret = bt_field_integer_unsigned_get_value(value_field,
&requested_new_value);
BT_ASSERT(!ret);
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s, value=%" PRIu64,
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)),
value);
BT_LOGF("Unexpected field type ID: "
"notit-addr=%p, ft-addr=%p, ft-id=%s",
notit, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
abort();
}
BT_ASSERT(int_field);
- ret = bt_field_unsigned_integer_set_value(int_field, value);
+ ret = bt_field_integer_unsigned_set_value(int_field, value);
BT_ASSERT(ret == 0);
stack_top(notit->stack)->index++;
*out_int_field = int_field;
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s",
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
status = btr_unsigned_int_common(*((uint64_t *) value), type, data,
&field);
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s, value=%" PRIu64,
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)),
value);
override = g_hash_table_lookup(notit->field_overrides, type);
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s, value=%" PRId64,
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)),
value);
BT_LOGF("Unexpected field type ID: "
"notit-addr=%p, ft-addr=%p, ft-id=%s",
notit, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
abort();
}
BT_ASSERT(int_field);
- ret = bt_field_signed_integer_set_value(int_field, value);
+ ret = bt_field_integer_signed_set_value(int_field, value);
BT_ASSERT(!ret);
stack_top(notit->stack)->index++;
status = update_clock(notit, int_field);
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s, value=%f",
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)),
value);
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s",
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
/* Create next field */
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s, string-length=%zu",
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)),
len);
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s",
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
/* Pop string field */
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s",
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
/* Create field */
BT_LOGE("Cannot create compound field: "
"notit-addr=%p, ft-addr=%p, ft-id=%s",
notit, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
status = BT_BTR_STATUS_ERROR;
goto end;
BT_LOGE("Cannot push compound field onto the stack: "
"notit-addr=%p, ft-addr=%p, ft-id=%s, ret=%d",
notit, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)),
ret);
status = BT_BTR_STATUS_ERROR;
"notit-addr=%p, btr-addr=%p, ft-addr=%p, "
"ft-id=%s",
notit, notit->btr, type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(type)));
BT_ASSERT(!stack_empty(notit->stack));
default:
BT_LOGF("Cannot resolve field path: unknown scope: "
"notit-addr=%p, root-scope=%s",
- notit, bt_scope_string(
+ notit, bt_common_scope_string(
bt_field_path_get_root_scope(path)));
abort();
}
if (!field) {
BT_LOGW("Cannot resolve field path: root field not found: "
"notit-addr=%p, root-scope=%s",
- notit, bt_scope_string(
+ notit, bt_common_scope_string(
bt_field_path_get_root_scope(path)));
goto end;
}
BT_LOGW("Cannot find next field: "
"notit-addr=%p, ft-addr=%p, ft-id=%s, index=%d",
notit, field_type,
- bt_field_type_id_string(
+ bt_common_field_type_id_string(
bt_field_type_get_type_id(field_type)),
index);
goto end;
goto end;
}
- iret = bt_field_unsigned_integer_get_value(length_field, &length);
+ iret = bt_field_integer_unsigned_get_value(length_field, &length);
if (iret) {
BT_LOGE("Cannot get value of sequence length field: "
"notit-addr=%p, field-addr=%p",
goto error;
}
- ret = bt_event_set_event_context(event,
+ ret = bt_event_set_context(event,
notit->dscopes.event_context);
if (ret) {
BT_LOGE("Cannot set event's stream event context field: "
goto error;
}
- ret = bt_event_set_event_payload(event,
+ ret = bt_event_set_payload(event,
notit->dscopes.event_payload);
if (ret) {
BT_LOGE("Cannot set event's payload field: "
goto end;
}
- ret = bt_field_unsigned_integer_get_value(stream_instance_id_field,
+ ret = bt_field_integer_unsigned_get_value(stream_instance_id_field,
&stream_instance_id);
if (ret) {
stream_instance_id = -1ULL;
int i, count;
struct bt_field_type *packet_header = NULL;
- packet_header = bt_trace_get_packet_header_type(trace);
+ packet_header = bt_trace_get_packet_header_field_type(trace);
if (!packet_header) {
goto end;
}