#include <babeltrace2/babeltrace.h>
#include "common/common.h"
#include "common/assert.h"
+#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <glib.h>
ret = -1;
end:
+ g_match_info_free(match_info);
+
return ret;
}
return status;
}
+static
struct bt_param_validation_map_value_entry_descr trimmer_params[] = {
{ "gmt", BT_PARAM_VALIDATION_MAP_VALUE_ENTRY_OPTIONAL, { .type = BT_VALUE_TYPE_BOOL } },
{ "begin", BT_PARAM_VALIDATION_MAP_VALUE_ENTRY_OPTIONAL, { .validation_func = validate_bound_type } },
const bt_clock_snapshot *clock_snapshot = NULL;
int ret = 0;
- BT_ASSERT(msg);
- BT_ASSERT(ns_from_origin);
- BT_ASSERT(has_clock_snapshot);
+ BT_ASSERT_DBG(msg);
+ BT_ASSERT_DBG(ns_from_origin);
+ BT_ASSERT_DBG(has_clock_snapshot);
switch (bt_message_get_type(msg)) {
case BT_MESSAGE_TYPE_EVENT:
for (i = 0; i < count; i++) {
const bt_message *msg = msgs[i];
bool has_ns_from_origin;
- int ret;
-
ret = get_msg_ns_from_origin(msg, &ns_from_origin,
&has_ns_from_origin);
if (ret) {
continue;
}
- BT_ASSERT(ns_from_origin != INT64_MIN &&
+ BT_ASSERT_DBG(ns_from_origin != INT64_MIN &&
ns_from_origin != INT64_MAX);
put_messages(msgs, count);
goto found;
{
struct trimmer_iterator_stream_state *sstate;
- BT_ASSERT(stream);
+ BT_ASSERT_DBG(stream);
sstate = g_hash_table_lookup(trimmer_it->stream_states, stream);
- BT_ASSERT(sstate);
+ BT_ASSERT_DBG(sstate);
return sstate;
}
* class has a clock class. And we know it has, otherwise we
* couldn't be using the trimmer component.
*/
- BT_ASSERT(ns_from_origin);
+ BT_ASSERT_DBG(ns_from_origin);
if (G_UNLIKELY(!trimmer_it->end.is_infinite &&
*ns_from_origin > trimmer_it->end.ns_from_origin)) {
(*count)++;
}
- BT_ASSERT(*count > 0);
+ BT_ASSERT_DBG(*count > 0);
}
static inline
goto end;
}
- BT_ASSERT(my_count > 0);
+ BT_ASSERT_DBG(my_count > 0);
for (i = 0; i < my_count; i++) {
status = handle_message(trimmer_it, my_msgs[i],
* There's at least one message in the output message queue:
* move the messages to the output message array.
*/
- BT_ASSERT(!g_queue_is_empty(trimmer_it->output_messages));
+ BT_ASSERT_DBG(!g_queue_is_empty(trimmer_it->output_messages));
fill_message_array_from_output_messages(trimmer_it, msgs,
capacity, count);
bt_component_class_message_iterator_next_method_status status =
BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK;
- BT_ASSERT(trimmer_it);
+ BT_ASSERT_DBG(trimmer_it);
if (G_LIKELY(trimmer_it->state == TRIMMER_ITERATOR_STATE_TRIM)) {
status = state_trim(trimmer_it, msgs, capacity, count);
status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_END;
break;
default:
- abort();
+ bt_common_abort();
}
}