counter->last_printed_total = -1ULL;
counter->step = 1000;
- step = bt_value_map_get(params, "step");
+ step = bt_value_map_borrow(params, "step");
if (step && bt_value_is_integer(step)) {
int64_t val;
}
}
- hide_zero = bt_value_map_get(params, "hide-zero");
+ hide_zero = bt_value_map_borrow(params, "hide-zero");
if (hide_zero && bt_value_is_bool(hide_zero)) {
bt_bool val;
destroy_private_counter_data(counter);
end:
- bt_put(step);
- bt_put(hide_zero);
return ret;
}
enum bt_component_status counter_consume(struct bt_private_component *component)
{
enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
- struct bt_notification *notif = NULL;
struct counter *counter;
enum bt_notification_iterator_status it_ret;
int64_t count;
+ struct bt_notification *notif = NULL;
counter = bt_private_component_get_user_data(component);
BT_ASSERT(counter);
}
/* Consume one notification */
- it_ret = bt_notification_iterator_next(counter->notif_iter);
+ it_ret = bt_private_connection_notification_iterator_next(
+ counter->notif_iter, ¬if);
if (it_ret < 0) {
ret = BT_COMPONENT_STATUS_ERROR;
goto end;
goto end;
case BT_NOTIFICATION_ITERATOR_STATUS_OK:
{
- struct bt_notification *notif =
- bt_notification_iterator_get_notification(counter->notif_iter);
-
BT_ASSERT(notif);
switch (bt_notification_get_type(notif)) {
case BT_NOTIFICATION_TYPE_EVENT:
default:
counter->count.other++;
}
-
- bt_put(notif);
}
default:
break;