projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: make trace IR API const-correct
[babeltrace.git]
/
plugins
/
ctf
/
common
/
notif-iter
/
notif-iter.c
diff --git
a/plugins/ctf/common/notif-iter/notif-iter.c
b/plugins/ctf/common/notif-iter/notif-iter.c
index 26e86406bec3dc802cfd2d692307161b6bbeb33b..e6b4f8b77931a1256372c78fcc87294b0fc7aa84 100644
(file)
--- a/
plugins/ctf/common/notif-iter/notif-iter.c
+++ b/
plugins/ctf/common/notif-iter/notif-iter.c
@@
-103,7
+103,7
@@
struct bt_notif_iter {
struct stack *stack;
/* Current notification iterator to create notifications (weak) */
struct stack *stack;
/* Current notification iterator to create notifications (weak) */
- struct bt_
private_connection_private
_notification_iterator *notif_iter;
+ struct bt_
self
_notification_iterator *notif_iter;
/*
* Current dynamic scope field pointer.
/*
* Current dynamic scope field pointer.
@@
-145,7
+145,7
@@
struct bt_notif_iter {
struct bt_event *event;
/* Current event notification (NULL if not created yet) */
struct bt_event *event;
/* Current event notification (NULL if not created yet) */
- struct bt_notification *event_notif;
+ struct bt_
private_
notification *event_notif;
/* Database of current dynamic scopes */
struct {
/* Database of current dynamic scopes */
struct {
@@
-681,8
+681,9
@@
enum bt_notif_iter_status read_packet_header_begin_state(
* 3. We need the packet header field's content to know
* the ID of the stream class to select.
*/
* 3. We need the packet header field's content to know
* the ID of the stream class to select.
*/
- notit->packet_header_field = bt_packet_header_field_create(
- notit->meta.tc->ir_tc);
+ notit->packet_header_field =
+ bt_packet_header_field_create(
+ notit->meta.tc->ir_tc);
if (!notit->packet_header_field) {
BT_LOGE_STR("Cannot create packet header field wrapper from trace.");
ret = BT_NOTIF_ITER_STATUS_ERROR;
if (!notit->packet_header_field) {
BT_LOGE_STR("Cannot create packet header field wrapper from trace.");
ret = BT_NOTIF_ITER_STATUS_ERROR;
@@
-690,7
+691,8
@@
enum bt_notif_iter_status read_packet_header_begin_state(
}
notit->dscopes.trace_packet_header =
}
notit->dscopes.trace_packet_header =
- bt_packet_header_field_borrow_field(notit->packet_header_field);
+ bt_packet_header_field_borrow_field(
+ notit->packet_header_field);
BT_ASSERT(notit->dscopes.trace_packet_header);
}
BT_ASSERT(notit->dscopes.trace_packet_header);
}
@@
-803,9
+805,10
@@
enum bt_notif_iter_status set_current_stream(struct bt_notif_iter *notit)
"stream-class-addr=%p, stream-class-id=%" PRId64,
notit, notit->meta.sc,
notit->meta.sc->id);
"stream-class-addr=%p, stream-class-id=%" PRId64,
notit, notit->meta.sc,
notit->meta.sc->id);
- stream =
bt_get(
notit->medium.medops.borrow_stream(
+ stream = notit->medium.medops.borrow_stream(
notit->meta.sc->ir_sc, notit->cur_data_stream_id,
notit->meta.sc->ir_sc, notit->cur_data_stream_id,
- notit->medium.data));
+ notit->medium.data);
+ bt_object_get_ref(stream);
BT_LOGV("User function returned: stream-addr=%p", stream);
if (!stream) {
BT_LOGW_STR("User function failed to return a stream object "
BT_LOGV("User function returned: stream-addr=%p", stream);
if (!stream) {
BT_LOGW_STR("User function failed to return a stream object "
@@
-821,10
+824,10
@@
enum bt_notif_iter_status set_current_stream(struct bt_notif_iter *notit)
goto end;
}
goto end;
}
- BT_
MOVE
(notit->stream, stream);
+ BT_
OBJECT_MOVE_REF
(notit->stream, stream);
end:
end:
- bt_
put
(stream);
+ bt_
object_put_ref
(stream);
return status;
}
return status;
}
@@
-859,11
+862,11
@@
enum bt_notif_iter_status set_current_packet(struct bt_notif_iter *notit)
goto end;
error:
goto end;
error:
- BT_
PU
T(packet);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(packet);
status = BT_NOTIF_ITER_STATUS_ERROR;
end:
status = BT_NOTIF_ITER_STATUS_ERROR;
end:
- BT_
MOVE
(notit->packet, packet);
+ BT_
OBJECT_MOVE_REF
(notit->packet, packet);
return status;
}
return status;
}
@@
-916,7
+919,8
@@
enum bt_notif_iter_status read_packet_context_begin_state(
* (bt_notif_iter_borrow_packet_header_context_fields()).
*/
notit->packet_context_field =
* (bt_notif_iter_borrow_packet_header_context_fields()).
*/
notit->packet_context_field =
- bt_packet_context_field_create(notit->meta.sc->ir_sc);
+ bt_packet_context_field_create(
+ notit->meta.sc->ir_sc);
if (!notit->packet_context_field) {
BT_LOGE_STR("Cannot create packet context field wrapper from stream class.");
status = BT_NOTIF_ITER_STATUS_ERROR;
if (!notit->packet_context_field) {
BT_LOGE_STR("Cannot create packet context field wrapper from stream class.");
status = BT_NOTIF_ITER_STATUS_ERROR;
@@
-924,7
+928,8
@@
enum bt_notif_iter_status read_packet_context_begin_state(
}
notit->dscopes.stream_packet_context =
}
notit->dscopes.stream_packet_context =
- bt_packet_context_field_borrow_field(notit->packet_context_field);
+ bt_packet_context_field_borrow_field(
+ notit->packet_context_field);
BT_ASSERT(notit->dscopes.stream_packet_context);
}
BT_ASSERT(notit->dscopes.stream_packet_context);
}
@@
-1091,8
+1096,9
@@
enum bt_notif_iter_status read_event_header_begin_state(
if (event_header_fc->in_ir) {
BT_ASSERT(!notit->event_header_field);
if (event_header_fc->in_ir) {
BT_ASSERT(!notit->event_header_field);
- notit->event_header_field = bt_event_header_field_create(
- notit->meta.sc->ir_sc);
+ notit->event_header_field =
+ bt_event_header_field_create(
+ notit->meta.sc->ir_sc);
if (!notit->event_header_field) {
BT_LOGE_STR("Cannot create event header field wrapper from trace.");
status = BT_NOTIF_ITER_STATUS_ERROR;
if (!notit->event_header_field) {
BT_LOGE_STR("Cannot create event header field wrapper from trace.");
status = BT_NOTIF_ITER_STATUS_ERROR;
@@
-1100,7
+1106,8
@@
enum bt_notif_iter_status read_event_header_begin_state(
}
notit->dscopes.event_header =
}
notit->dscopes.event_header =
- bt_event_header_field_borrow_field(notit->event_header_field);
+ bt_event_header_field_borrow_field(
+ notit->event_header_field);
BT_ASSERT(notit->dscopes.event_header);
}
BT_ASSERT(notit->dscopes.event_header);
}
@@
-1192,7
+1199,7
@@
enum bt_notif_iter_status set_current_event_notification(
struct bt_notif_iter *notit)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
struct bt_notif_iter *notit)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
- struct bt_notification *notif = NULL;
+ struct bt_
private_
notification *notif = NULL;
BT_ASSERT(notit->meta.ec);
BT_ASSERT(notit->packet);
BT_ASSERT(notit->meta.ec);
BT_ASSERT(notit->packet);
@@
-1202,7
+1209,7
@@
enum bt_notif_iter_status set_current_event_notification(
notit->meta.ec->name->str,
notit->packet);
BT_ASSERT(notit->notif_iter);
notit->meta.ec->name->str,
notit->packet);
BT_ASSERT(notit->notif_iter);
- notif = bt_notification_event_create(notit->notif_iter,
+ notif = bt_
private_
notification_event_create(notit->notif_iter,
notit->meta.ec->ir_ec, notit->packet);
if (!notif) {
BT_LOGE("Cannot create event notification: "
notit->meta.ec->ir_ec, notit->packet);
if (!notif) {
BT_LOGE("Cannot create event notification: "
@@
-1217,11
+1224,11
@@
enum bt_notif_iter_status set_current_event_notification(
goto end;
error:
goto end;
error:
- BT_
PU
T(notif);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notif);
status = BT_NOTIF_ITER_STATUS_ERROR;
end:
status = BT_NOTIF_ITER_STATUS_ERROR;
end:
- BT_
MOVE
(notit->event_notif, notif);
+ BT_
OBJECT_MOVE_REF
(notit->event_notif, notif);
return status;
}
return status;
}
@@
-1241,14
+1248,15
@@
enum bt_notif_iter_status after_event_header_state(
goto end;
}
goto end;
}
- notit->event = bt_notification_event_borrow_event(notit->event_notif);
+ notit->event = bt_private_notification_event_borrow_event(
+ notit->event_notif);
BT_ASSERT(notit->event);
if (notit->event_header_field) {
int ret;
BT_ASSERT(notit->event);
BT_ASSERT(notit->event);
if (notit->event_header_field) {
int ret;
BT_ASSERT(notit->event);
- ret = bt_event_move_header(notit->event,
+ ret = bt_event_move_header
_field
(notit->event,
notit->event_header_field);
if (ret) {
status = BT_NOTIF_ITER_STATUS_ERROR;
notit->event_header_field);
if (ret) {
status = BT_NOTIF_ITER_STATUS_ERROR;
@@
-1262,8
+1270,8
@@
enum bt_notif_iter_status after_event_header_state(
* the same value as the event header field within
* notit->event.
*/
* the same value as the event header field within
* notit->event.
*/
- BT_ASSERT(bt_event_borrow_header_field(
notit->event) ==
- notit->dscopes.event_header);
+ BT_ASSERT(bt_event_borrow_header_field(
+ notit->
event) == notit->
dscopes.event_header);
}
notit->state = STATE_DSCOPE_EVENT_COMMON_CONTEXT_BEGIN;
}
notit->state = STATE_DSCOPE_EVENT_COMMON_CONTEXT_BEGIN;
@@
-1288,7
+1296,8
@@
enum bt_notif_iter_status read_event_common_context_begin_state(
if (event_common_context_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_common_context);
notit->dscopes.event_common_context =
if (event_common_context_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_common_context);
notit->dscopes.event_common_context =
- bt_event_borrow_common_context_field(notit->event);
+ bt_event_borrow_common_context_field(
+ notit->event);
BT_ASSERT(notit->dscopes.event_common_context);
}
BT_ASSERT(notit->dscopes.event_common_context);
}
@@
-1339,8
+1348,9
@@
enum bt_notif_iter_status read_event_spec_context_begin_state(
if (event_spec_context_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_spec_context);
if (event_spec_context_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_spec_context);
- notit->dscopes.event_spec_context = bt_event_borrow_specific_context_field(
- notit->event);
+ notit->dscopes.event_spec_context =
+ bt_event_borrow_specific_context_field(
+ notit->event);
BT_ASSERT(notit->dscopes.event_spec_context);
}
BT_ASSERT(notit->dscopes.event_spec_context);
}
@@
-1394,8
+1404,9
@@
enum bt_notif_iter_status read_event_payload_begin_state(
if (event_payload_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_payload);
if (event_payload_fc->in_ir) {
BT_ASSERT(!notit->dscopes.event_payload);
- notit->dscopes.event_payload = bt_event_borrow_payload_field(
- notit->event);
+ notit->dscopes.event_payload =
+ bt_event_borrow_payload_field(
+ notit->event);
BT_ASSERT(notit->dscopes.event_payload);
}
BT_ASSERT(notit->dscopes.event_payload);
}
@@
-1569,9
+1580,9
@@
void bt_notif_iter_reset(struct bt_notif_iter *notit)
stack_clear(notit->stack);
notit->meta.sc = NULL;
notit->meta.ec = NULL;
stack_clear(notit->stack);
notit->meta.sc = NULL;
notit->meta.ec = NULL;
- BT_
PU
T(notit->packet);
- BT_
PU
T(notit->stream);
- BT_
PU
T(notit->event_notif);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->packet);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->stream);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->event_notif);
release_all_dscopes(notit);
notit->cur_dscope_field = NULL;
release_all_dscopes(notit);
notit->cur_dscope_field = NULL;
@@
-1626,8
+1637,8
@@
int bt_notif_iter_switch_packet(struct bt_notif_iter *notit)
notit->cur_packet_offset);
stack_clear(notit->stack);
notit->meta.ec = NULL;
notit->cur_packet_offset);
stack_clear(notit->stack);
notit->meta.ec = NULL;
- BT_
PU
T(notit->packet);
- BT_
PU
T(notit->event_notif);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->packet);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->event_notif);
release_all_dscopes(notit);
notit->cur_dscope_field = NULL;
release_all_dscopes(notit);
notit->cur_dscope_field = NULL;
@@
-1673,33
+1684,35
@@
struct bt_field *borrow_next_field(struct bt_notif_iter *notit)
{
struct bt_field *next_field = NULL;
struct bt_field *base_field;
{
struct bt_field *next_field = NULL;
struct bt_field *base_field;
- struct bt_field_class *base_fc;
+
const
struct bt_field_class *base_fc;
size_t index;
BT_ASSERT(!stack_empty(notit->stack));
index = stack_top(notit->stack)->index;
base_field = stack_top(notit->stack)->base;
BT_ASSERT(base_field);
size_t index;
BT_ASSERT(!stack_empty(notit->stack));
index = stack_top(notit->stack)->index;
base_field = stack_top(notit->stack)->base;
BT_ASSERT(base_field);
- base_fc = bt_field_borrow_class(base_field);
+ base_fc = bt_field_borrow_class
_const
(base_field);
BT_ASSERT(base_fc);
BT_ASSERT(base_fc);
- switch (bt_field_class_get_
id
(base_fc)) {
- case BT_FIELD_CLASS_
ID
_STRUCTURE:
+ switch (bt_field_class_get_
type
(base_fc)) {
+ case BT_FIELD_CLASS_
TYPE
_STRUCTURE:
{
BT_ASSERT(index <
bt_field_class_structure_get_member_count(
{
BT_ASSERT(index <
bt_field_class_structure_get_member_count(
- bt_field_borrow_class(base_field)));
- next_field = bt_field_structure_borrow_member_field_by_index(
- base_field, index);
+ bt_field_borrow_class_const(
+ base_field)));
+ next_field =
+ bt_field_structure_borrow_member_field_by_index(
+ base_field, index);
break;
}
break;
}
- case BT_FIELD_CLASS_
ID
_STATIC_ARRAY:
- case BT_FIELD_CLASS_
ID
_DYNAMIC_ARRAY:
+ case BT_FIELD_CLASS_
TYPE
_STATIC_ARRAY:
+ case BT_FIELD_CLASS_
TYPE
_DYNAMIC_ARRAY:
BT_ASSERT(index < bt_field_array_get_length(base_field));
next_field = bt_field_array_borrow_element_field_by_index(
base_field, index);
break;
BT_ASSERT(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_
ID
_VARIANT:
+ case BT_FIELD_CLASS_
TYPE
_VARIANT:
BT_ASSERT(index == 0);
next_field = bt_field_variant_borrow_selected_option_field(
base_field);
BT_ASSERT(index == 0);
next_field = bt_field_variant_borrow_selected_option_field(
base_field);
@@
-1765,8
+1778,8
@@
enum bt_bfcr_status bfcr_unsigned_int_cb(uint64_t value,
BT_LOGV("Unsigned integer function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("Unsigned integer function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d, value=%" PRIu64,
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir, value);
+ "fc-
type
=%d, fc-in-ir=%d, value=%" PRIu64,
+ notit, notit->bfcr, fc, fc->
type
, fc->in_ir, value);
if (likely(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE)) {
goto update_def_clock;
if (likely(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE)) {
goto update_def_clock;
@@
-1829,9
+1842,11
@@
update_def_clock:
field = borrow_next_field(notit);
BT_ASSERT(field);
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_UNSIGNED_INTEGER ||
- bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_UNSIGNED_ENUMERATION);
+ 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_field_unsigned_integer_set_value(field, value);
stack_top(notit->stack)->index++;
bt_field_unsigned_integer_set_value(field, value);
stack_top(notit->stack)->index++;
@@
-1852,8
+1867,8
@@
enum bt_bfcr_status bfcr_unsigned_int_char_cb(uint64_t value,
BT_LOGV("Unsigned integer character function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("Unsigned integer character function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d, value=%" PRIu64,
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir, value);
+ "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(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
BT_ASSERT(!int_fc->mapped_clock_class);
BT_ASSERT(int_fc->storing_index < 0);
@@
-1872,7
+1887,8
@@
enum bt_bfcr_status bfcr_unsigned_int_char_cb(uint64_t value,
}
string_field = stack_top(notit->stack)->base;
}
string_field = stack_top(notit->stack)->base;
- BT_ASSERT(bt_field_get_class_id(string_field) == BT_FIELD_CLASS_ID_STRING);
+ BT_ASSERT(bt_field_get_class_type(string_field) ==
+ BT_FIELD_CLASS_TYPE_STRING);
/* Append character */
str[0] = (char) value;
/* Append character */
str[0] = (char) value;
@@
-1900,8
+1916,8
@@
enum bt_bfcr_status bfcr_signed_int_cb(int64_t value,
BT_LOGV("Signed integer function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("Signed integer function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d, value=%" PRId64,
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir, value);
+ "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);
if (unlikely(int_fc->storing_index >= 0)) {
BT_ASSERT(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
if (unlikely(int_fc->storing_index >= 0)) {
@@
-1915,9
+1931,11
@@
enum bt_bfcr_status bfcr_signed_int_cb(int64_t value,
field = borrow_next_field(notit);
BT_ASSERT(field);
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_SIGNED_INTEGER ||
- bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_SIGNED_ENUMERATION);
+ 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_field_signed_integer_set_value(field, value);
stack_top(notit->stack)->index++;
bt_field_signed_integer_set_value(field, value);
stack_top(notit->stack)->index++;
@@
-1935,13
+1953,14
@@
enum bt_bfcr_status bfcr_floating_point_cb(double value,
BT_LOGV("Floating point number function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("Floating point number function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d, value=%f",
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir, value);
+ "fc-
type
=%d, fc-in-ir=%d, value=%f",
+ notit, notit->bfcr, fc, fc->
type
, fc->in_ir, value);
BT_ASSERT(fc->in_ir);
field = borrow_next_field(notit);
BT_ASSERT(field);
BT_ASSERT(fc->in_ir);
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_REAL);
+ BT_ASSERT(bt_field_borrow_class_const(field) == fc->ir_fc);
+ BT_ASSERT(bt_field_get_class_type(field) ==
+ BT_FIELD_CLASS_TYPE_REAL);
bt_field_real_set_value(field, value);
stack_top(notit->stack)->index++;
return status;
bt_field_real_set_value(field, value);
stack_top(notit->stack)->index++;
return status;
@@
-1957,14
+1976,15
@@
enum bt_bfcr_status bfcr_string_begin_cb(
BT_LOGV("String (beginning) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("String (beginning) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d",
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir);
+ "fc-
type
=%d, fc-in-ir=%d",
+ notit, notit->bfcr, fc, fc->
type
, fc->in_ir);
BT_ASSERT(fc->in_ir);
field = borrow_next_field(notit);
BT_ASSERT(field);
BT_ASSERT(fc->in_ir);
field = borrow_next_field(notit);
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
- BT_ASSERT(bt_field_get_class_id(field) == BT_FIELD_CLASS_ID_STRING);
+ 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);
ret = bt_field_string_clear(field);
BT_ASSERT(ret == 0);
@@
-1988,8
+2008,8
@@
enum bt_bfcr_status bfcr_string_cb(const char *value,
BT_LOGV("String (substring) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("String (substring) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d, string-length=%zu",
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir,
+ "fc-
type
=%d, fc-in-ir=%d, string-length=%zu",
+ notit, notit->bfcr, fc, fc->
type
, fc->in_ir,
len);
BT_ASSERT(fc->in_ir);
field = stack_top(notit->stack)->base;
len);
BT_ASSERT(fc->in_ir);
field = stack_top(notit->stack)->base;
@@
-2017,8
+2037,8
@@
enum bt_bfcr_status bfcr_string_end_cb(
BT_LOGV("String (end) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("String (end) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d",
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir);
+ "fc-
type
=%d, fc-in-ir=%d",
+ notit, notit->bfcr, fc, fc->
type
, fc->in_ir);
BT_ASSERT(fc->in_ir);
/* Pop string field */
BT_ASSERT(fc->in_ir);
/* Pop string field */
@@
-2037,8
+2057,8
@@
enum bt_bfcr_status bfcr_compound_begin_cb(
BT_LOGV("Compound (beginning) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("Compound (beginning) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d",
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir);
+ "fc-
type
=%d, fc-in-ir=%d",
+ notit, notit->bfcr, fc, fc->
type
, fc->in_ir);
if (!fc->in_ir) {
goto end;
if (!fc->in_ir) {
goto end;
@@
-2055,22
+2075,22
@@
enum bt_bfcr_status bfcr_compound_begin_cb(
/* Push field */
BT_ASSERT(field);
/* Push field */
BT_ASSERT(field);
- BT_ASSERT(bt_field_borrow_class(field) == fc->ir_fc);
+ BT_ASSERT(bt_field_borrow_class
_const
(field) == fc->ir_fc);
stack_push(notit->stack, field);
/*
* Change BFCR "unsigned int" callback if it's a text
* array/sequence.
*/
stack_push(notit->stack, field);
/*
* Change BFCR "unsigned int" callback if it's a text
* array/sequence.
*/
- if (fc->
id == CTF_FIELD_CLASS_ID
_ARRAY ||
- fc->
id == CTF_FIELD_CLASS_ID
_SEQUENCE) {
+ if (fc->
type == CTF_FIELD_CLASS_TYPE
_ARRAY ||
+ fc->
type == CTF_FIELD_CLASS_TYPE
_SEQUENCE) {
struct ctf_field_class_array_base *array_fc = (void *) fc;
if (array_fc->is_text) {
int ret;
struct ctf_field_class_array_base *array_fc = (void *) fc;
if (array_fc->is_text) {
int ret;
- BT_ASSERT(bt_field_get_class_
id
(field) ==
-
BT_FIELD_CLASS_ID
_STRING);
+ 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);
notit->done_filling_string = false;
ret = bt_field_string_clear(field);
BT_ASSERT(ret == 0);
@@
-2090,29
+2110,29
@@
enum bt_bfcr_status bfcr_compound_end_cb(
BT_LOGV("Compound (end) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
BT_LOGV("Compound (end) function called from BFCR: "
"notit-addr=%p, bfcr-addr=%p, fc-addr=%p, "
- "fc-
id
=%d, fc-in-ir=%d",
- notit, notit->bfcr, fc, fc->
id
, fc->in_ir);
+ "fc-
type
=%d, fc-in-ir=%d",
+ notit, notit->bfcr, fc, fc->
type
, fc->in_ir);
if (!fc->in_ir) {
goto end;
}
BT_ASSERT(!stack_empty(notit->stack));
if (!fc->in_ir) {
goto end;
}
BT_ASSERT(!stack_empty(notit->stack));
- BT_ASSERT(bt_field_borrow_class(stack_top(notit->stack)->base) ==
+ BT_ASSERT(bt_field_borrow_class
_const
(stack_top(notit->stack)->base) ==
fc->ir_fc);
/*
* Reset BFCR "unsigned int" callback if it's a text
* array/sequence.
*/
fc->ir_fc);
/*
* Reset BFCR "unsigned int" callback if it's a text
* array/sequence.
*/
- if (fc->
id == CTF_FIELD_CLASS_ID
_ARRAY ||
- fc->
id == CTF_FIELD_CLASS_ID
_SEQUENCE) {
+ if (fc->
type == CTF_FIELD_CLASS_TYPE
_ARRAY ||
+ fc->
type == CTF_FIELD_CLASS_TYPE
_SEQUENCE) {
struct ctf_field_class_array_base *array_fc = (void *) fc;
if (array_fc->is_text) {
struct ctf_field_class_array_base *array_fc = (void *) fc;
if (array_fc->is_text) {
- BT_ASSERT(bt_field_get_class_
id
(
+ BT_ASSERT(bt_field_get_class_
type
(
stack_top(notit->stack)->base) ==
stack_top(notit->stack)->base) ==
-
BT_FIELD_CLASS_ID
_STRING);
+
BT_FIELD_CLASS_TYPE
_STRING);
bt_bfcr_set_unsigned_int_cb(notit->bfcr,
bfcr_unsigned_int_cb);
}
bt_bfcr_set_unsigned_int_cb(notit->bfcr,
bfcr_unsigned_int_cb);
}
@@
-2215,8
+2235,8
@@
struct ctf_field_class *bfcr_borrow_variant_selected_field_class_cb(
if (selected_option->fc->in_ir) {
struct bt_field *var_field = stack_top(notit->stack)->base;
if (selected_option->fc->in_ir) {
struct bt_field *var_field = stack_top(notit->stack)->base;
- ret = bt_field_variant_select_option_field(
var_field,
- option_index);
+ ret = bt_field_variant_select_option_field(
+
var_field,
option_index);
if (ret) {
BT_LOGW("Cannot select variant field's option field: "
"notit-addr=%p, var-field-addr=%p, "
if (ret) {
BT_LOGW("Cannot select variant field's option field: "
"notit-addr=%p, var-field-addr=%p, "
@@
-2235,36
+2255,35
@@
end:
static
void set_event_default_clock_value(struct bt_notif_iter *notit)
{
static
void set_event_default_clock_value(struct bt_notif_iter *notit)
{
- struct bt_event *event = bt_notification_event_borrow_event(
- notit->event_notif);
+ struct bt_event *event =
+ bt_private_notification_event_borrow_event(
+ notit->event_notif);
struct bt_stream_class *sc = notit->meta.sc->ir_sc;
BT_ASSERT(event);
if (bt_stream_class_borrow_default_clock_class(sc)) {
struct bt_stream_class *sc = notit->meta.sc->ir_sc;
BT_ASSERT(event);
if (bt_stream_class_borrow_default_clock_class(sc)) {
-
int ret =
bt_event_set_default_clock_value(event,
+ bt_event_set_default_clock_value(event,
notit->default_clock_val);
notit->default_clock_val);
-
- BT_ASSERT(ret == 0);
}
}
static
void notify_new_stream(struct bt_notif_iter *notit,
}
}
static
void notify_new_stream(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_
private_
notification **notification)
{
enum bt_notif_iter_status status;
{
enum bt_notif_iter_status status;
- struct bt_notification *ret = NULL;
+ struct bt_
private_
notification *ret = NULL;
status = set_current_stream(notit);
if (status != BT_NOTIF_ITER_STATUS_OK) {
status = set_current_stream(notit);
if (status != BT_NOTIF_ITER_STATUS_OK) {
- BT_
PU
T(ret);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(ret);
goto end;
}
BT_ASSERT(notit->stream);
BT_ASSERT(notit->notif_iter);
goto end;
}
BT_ASSERT(notit->stream);
BT_ASSERT(notit->notif_iter);
- ret = bt_notification_stream_begin_create(notit->notif_iter,
+ ret = bt_
private_
notification_stream_begin_create(notit->notif_iter,
notit->stream);
if (!ret) {
BT_LOGE("Cannot create stream beginning notification: "
notit->stream);
if (!ret) {
BT_LOGE("Cannot create stream beginning notification: "
@@
-2279,9
+2298,9
@@
end:
static
void notify_end_of_stream(struct bt_notif_iter *notit,
static
void notify_end_of_stream(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_
private_
notification **notification)
{
{
- struct bt_notification *ret;
+ struct bt_
private_
notification *ret;
if (!notit->stream) {
BT_LOGE("Cannot create stream for stream notification: "
if (!notit->stream) {
BT_LOGE("Cannot create stream for stream notification: "
@@
-2290,7
+2309,7
@@
void notify_end_of_stream(struct bt_notif_iter *notit,
}
BT_ASSERT(notit->notif_iter);
}
BT_ASSERT(notit->notif_iter);
- ret = bt_notification_stream_end_create(notit->notif_iter,
+ ret = bt_
private_
notification_stream_end_create(notit->notif_iter,
notit->stream);
if (!ret) {
BT_LOGE("Cannot create stream beginning notification: "
notit->stream);
if (!ret) {
BT_LOGE("Cannot create stream beginning notification: "
@@
-2303,12
+2322,12
@@
void notify_end_of_stream(struct bt_notif_iter *notit,
static
void notify_new_packet(struct bt_notif_iter *notit,
static
void notify_new_packet(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_
private_
notification **notification)
{
int ret;
enum bt_notif_iter_status status;
{
int ret;
enum bt_notif_iter_status status;
- struct bt_notification *notif = NULL;
- struct bt_stream_class *sc;
+ struct bt_
private_
notification *notif = NULL;
+
const
struct bt_stream_class *sc;
status = set_current_packet(notit);
if (status != BT_NOTIF_ITER_STATUS_OK) {
status = set_current_packet(notit);
if (status != BT_NOTIF_ITER_STATUS_OK) {
@@
-2321,35
+2340,31
@@
void notify_new_packet(struct bt_notif_iter *notit,
if (bt_stream_class_packets_have_discarded_event_counter_snapshot(sc)) {
BT_ASSERT(notit->snapshots.discarded_events != UINT64_C(-1));
if (bt_stream_class_packets_have_discarded_event_counter_snapshot(sc)) {
BT_ASSERT(notit->snapshots.discarded_events != UINT64_C(-1));
-
ret =
bt_packet_set_discarded_event_counter_snapshot(
+ bt_packet_set_discarded_event_counter_snapshot(
notit->packet, notit->snapshots.discarded_events);
notit->packet, notit->snapshots.discarded_events);
- BT_ASSERT(ret == 0);
}
if (bt_stream_class_packets_have_packet_counter_snapshot(sc)) {
BT_ASSERT(notit->snapshots.packets != UINT64_C(-1));
}
if (bt_stream_class_packets_have_packet_counter_snapshot(sc)) {
BT_ASSERT(notit->snapshots.packets != UINT64_C(-1));
-
ret =
bt_packet_set_packet_counter_snapshot(
+ bt_packet_set_packet_counter_snapshot(
notit->packet, notit->snapshots.packets);
notit->packet, notit->snapshots.packets);
- BT_ASSERT(ret == 0);
}
if (bt_stream_class_packets_have_default_beginning_clock_value(sc)) {
BT_ASSERT(notit->snapshots.beginning_clock != UINT64_C(-1));
}
if (bt_stream_class_packets_have_default_beginning_clock_value(sc)) {
BT_ASSERT(notit->snapshots.beginning_clock != UINT64_C(-1));
-
ret =
bt_packet_set_default_beginning_clock_value(
+ bt_packet_set_default_beginning_clock_value(
notit->packet, notit->snapshots.beginning_clock);
notit->packet, notit->snapshots.beginning_clock);
- BT_ASSERT(ret == 0);
}
if (bt_stream_class_packets_have_default_end_clock_value(sc)) {
BT_ASSERT(notit->snapshots.end_clock != UINT64_C(-1));
}
if (bt_stream_class_packets_have_default_end_clock_value(sc)) {
BT_ASSERT(notit->snapshots.end_clock != UINT64_C(-1));
-
ret =
bt_packet_set_default_end_clock_value(
+ bt_packet_set_default_end_clock_value(
notit->packet, notit->snapshots.end_clock);
notit->packet, notit->snapshots.end_clock);
- BT_ASSERT(ret == 0);
}
if (notit->packet_header_field) {
}
if (notit->packet_header_field) {
- ret = bt_packet_move_header_field(
notit->packet,
- notit->packet_header_field);
+ ret = bt_packet_move_header_field(
+ notit->packet
, notit->packet
_header_field);
if (ret) {
goto end;
}
if (ret) {
goto end;
}
@@
-2361,13
+2376,14
@@
void notify_new_packet(struct bt_notif_iter *notit,
* the same value as the packet header field within
* notit->packet.
*/
* the same value as the packet header field within
* notit->packet.
*/
- BT_ASSERT(bt_packet_borrow_header_field(notit->packet) ==
+ BT_ASSERT(bt_packet_borrow_header_field(
+ notit->packet) ==
notit->dscopes.trace_packet_header);
}
if (notit->packet_context_field) {
notit->dscopes.trace_packet_header);
}
if (notit->packet_context_field) {
- ret = bt_packet_move_context_field(
notit->packet,
- notit->packet_context_field);
+ ret = bt_packet_move_context_field(
+ notit->packet
, notit->packet
_context_field);
if (ret) {
goto end;
}
if (ret) {
goto end;
}
@@
-2379,12
+2395,13
@@
void notify_new_packet(struct bt_notif_iter *notit,
* the same value as the packet header field within
* notit->packet.
*/
* the same value as the packet header field within
* notit->packet.
*/
- BT_ASSERT(bt_packet_borrow_context_field(notit->packet) ==
+ BT_ASSERT(bt_packet_borrow_context_field(
+ notit->packet) ==
notit->dscopes.stream_packet_context);
}
BT_ASSERT(notit->notif_iter);
notit->dscopes.stream_packet_context);
}
BT_ASSERT(notit->notif_iter);
- notif = bt_notification_packet_begin_create(notit->notif_iter,
+ notif = bt_
private_
notification_packet_begin_create(notit->notif_iter,
notit->packet);
if (!notif) {
BT_LOGE("Cannot create packet beginning notification: "
notit->packet);
if (!notif) {
BT_LOGE("Cannot create packet beginning notification: "
@@
-2401,9
+2418,9
@@
end:
static
void notify_end_of_packet(struct bt_notif_iter *notit,
static
void notify_end_of_packet(struct bt_notif_iter *notit,
- struct bt_notification **notification)
+ struct bt_
private_
notification **notification)
{
{
- struct bt_notification *notif;
+ struct bt_
private_
notification *notif;
if (!notit->packet) {
return;
if (!notit->packet) {
return;
@@
-2415,7
+2432,7
@@
void notify_end_of_packet(struct bt_notif_iter *notit,
}
BT_ASSERT(notit->notif_iter);
}
BT_ASSERT(notit->notif_iter);
- notif = bt_notification_packet_end_create(notit->notif_iter,
+ notif = bt_
private_
notification_packet_end_create(notit->notif_iter,
notit->packet);
if (!notif) {
BT_LOGE("Cannot create packet end notification: "
notit->packet);
if (!notif) {
BT_LOGE("Cannot create packet end notification: "
@@
-2425,7
+2442,7
@@
void notify_end_of_packet(struct bt_notif_iter *notit,
}
}
- BT_
PU
T(notit->packet);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->packet);
*notification = notif;
}
*notification = notif;
}
@@
-2501,8
+2518,8
@@
error:
void bt_notif_iter_destroy(struct bt_notif_iter *notit)
{
void bt_notif_iter_destroy(struct bt_notif_iter *notit)
{
- BT_
PU
T(notit->packet);
- BT_
PU
T(notit->stream);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->packet);
+ BT_
OBJECT_PUT_REF_AND_RESE
T(notit->stream);
release_all_dscopes(notit);
BT_LOGD("Destroying CTF plugin notification iterator: addr=%p", notit);
release_all_dscopes(notit);
BT_LOGD("Destroying CTF plugin notification iterator: addr=%p", notit);
@@
-2526,8
+2543,8
@@
void bt_notif_iter_destroy(struct bt_notif_iter *notit)
enum bt_notif_iter_status bt_notif_iter_get_next_notification(
struct bt_notif_iter *notit,
enum bt_notif_iter_status bt_notif_iter_get_next_notification(
struct bt_notif_iter *notit,
- struct bt_
private_connection_private
_notification_iterator *notif_iter,
- struct bt_notification **notification)
+ struct bt_
self
_notification_iterator *notif_iter,
+ struct bt_
private_
notification **notification)
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
{
enum bt_notif_iter_status status = BT_NOTIF_ITER_STATUS_OK;
This page took
0.037117 seconds
and
4
git commands to generate.