The user must not call an API function while the current thread has an
error set, especially a function that can itself fail and set an error.
Otherwise, causes from two unrelated errors will end up in the same
stack, which will produce some misleading information.
Add a precondition assertion to all API functions that are likely to
themselves set an error to the current thread, to verify that there is
not error on the current thread when they are called.
Change-Id: I9aadbc4e00d06f3e893970c7c8891dbe7c68606b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
32 files changed:
"Index is out of bounds: index=%" PRIu64 ", " \
"count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
"Index is out of bounds: index=%" PRIu64 ", " \
"count=%" PRIu64, (uint64_t) (_index), (uint64_t) (_length))
+/*
+ * Asserts that the current thread has no error set.
+ */
+#define BT_ASSERT_PRE_NO_ERROR() \
+ do { \
+ const struct bt_error *err = bt_current_thread_take_error(); \
+ if (err) { \
+ bt_current_thread_move_error(err); \
+ } \
+ BT_ASSERT_PRE(!err, \
+ "API function called while current thread has an " \
+ "error: function=%s", __func__); \
+ } while (0)
+
#ifdef BT_DEV_MODE
/* Developer mode version of BT_ASSERT_PRE_MSG(). */
# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...) \
#ifdef BT_DEV_MODE
/* Developer mode version of BT_ASSERT_PRE_MSG(). */
# define BT_ASSERT_PRE_DEV_MSG(_fmt, ...) \
# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
BT_ASSERT_PRE_VALID_INDEX((_index), (_length))
# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
BT_ASSERT_PRE_VALID_INDEX((_index), (_length))
+/* Developer mode version of BT_ASSERT_PRE_NO_ERROR(). */
+# define BT_ASSERT_PRE_DEV_NO_ERROR() \
+ BT_ASSERT_PRE_NO_ERROR()
+
/*
* Marks a function as being only used within a BT_ASSERT_PRE_DEV()
* context.
/*
* Marks a function as being only used within a BT_ASSERT_PRE_DEV()
* context.
((void) sizeof((void) (_obj), (void) (_obj_name), 0))
# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
((void) sizeof((void) (_index), (void) (_length), 0))
((void) sizeof((void) (_obj), (void) (_obj_name), 0))
# define BT_ASSERT_PRE_DEV_VALID_INDEX(_index, _length) \
((void) sizeof((void) (_index), (void) (_length), 0))
+# define BT_ASSERT_PRE_DEV_NO_ERROR()
# define BT_ASSERT_PRE_DEV_FUNC __attribute__((unused))
#endif /* BT_DEV_MODE */
# define BT_ASSERT_PRE_DEV_FUNC __attribute__((unused))
#endif /* BT_DEV_MODE */
{
enum bt_component_class_set_method_status set_method_status;
{
enum bt_component_class_set_method_status set_method_status;
+ BT_ASSERT_PRE_NO_ERROR();
+
if (simple_comp_cls) {
goto end;
}
if (simple_comp_cls) {
goto end;
}
struct bt_component_class_source *source_class = NULL;
int ret;
struct bt_component_class_source *source_class = NULL;
int ret;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(method, "Message iterator next method");
BT_LOGI("Creating source component class: "
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(method, "Message iterator next method");
BT_LOGI("Creating source component class: "
struct bt_component_class_filter *filter_class = NULL;
int ret;
struct bt_component_class_filter *filter_class = NULL;
int ret;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(method, "Message iterator next method");
BT_LOGI("Creating filter component class: "
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(method, "Message iterator next method");
BT_LOGI("Creating filter component class: "
struct bt_component_class_sink *sink_class = NULL;
int ret;
struct bt_component_class_sink *sink_class = NULL;
int ret;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(method, "Consume next method");
BT_LOGI("Creating sink component class: "
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(method, "Consume next method");
BT_LOGI("Creating sink component class: "
struct bt_component_class_source *comp_cls,
bt_component_class_source_get_supported_mip_versions_method method)
{
struct bt_component_class_source *comp_cls,
bt_component_class_source_get_supported_mip_versions_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_get_supported_mip_versions_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_get_supported_mip_versions_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_get_supported_mip_versions_method method)
{
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_get_supported_mip_versions_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_source *comp_cls,
bt_component_class_source_initialize_method method)
{
struct bt_component_class_source *comp_cls,
bt_component_class_source_initialize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_initialize_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_initialize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_initialize_method method)
{
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_initialize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_source *comp_cls,
bt_component_class_source_finalize_method method)
{
struct bt_component_class_source *comp_cls,
bt_component_class_source_finalize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_finalize_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_finalize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_finalize_method method)
{
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_finalize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_source *comp_cls,
bt_component_class_source_query_method method)
{
struct bt_component_class_source *comp_cls,
bt_component_class_source_query_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_query_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_query_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_query_method method)
{
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_query_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_input_port_connected_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_input_port_connected_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_input_port_connected_method method)
{
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_input_port_connected_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_source *comp_cls,
bt_component_class_source_output_port_connected_method method)
{
struct bt_component_class_source *comp_cls,
bt_component_class_source_output_port_connected_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_output_port_connected_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_output_port_connected_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_graph_is_configured_method method)
{
struct bt_component_class_sink *comp_cls,
bt_component_class_sink_graph_is_configured_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_source *comp_cls,
bt_component_class_source_message_iterator_initialize_method method)
{
struct bt_component_class_source *comp_cls,
bt_component_class_source_message_iterator_initialize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_message_iterator_initialize_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_message_iterator_initialize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_source *comp_cls,
bt_component_class_source_message_iterator_finalize_method method)
{
struct bt_component_class_source *comp_cls,
bt_component_class_source_message_iterator_finalize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_message_iterator_finalize_method method)
{
struct bt_component_class_filter *comp_cls,
bt_component_class_filter_message_iterator_finalize_method method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(method, "Method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
bt_component_class_filter_message_iterator_seek_ns_from_origin_method seek_method,
bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method can_seek_method)
{
bt_component_class_filter_message_iterator_seek_ns_from_origin_method seek_method,
bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method can_seek_method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
bt_component_class_source_message_iterator_seek_ns_from_origin_method seek_method,
bt_component_class_source_message_iterator_can_seek_ns_from_origin_method can_seek_method)
{
bt_component_class_source_message_iterator_seek_ns_from_origin_method seek_method,
bt_component_class_source_message_iterator_can_seek_ns_from_origin_method can_seek_method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
bt_component_class_filter_message_iterator_seek_beginning_method seek_method,
bt_component_class_filter_message_iterator_can_seek_beginning_method can_seek_method)
{
bt_component_class_filter_message_iterator_seek_beginning_method seek_method,
bt_component_class_filter_message_iterator_can_seek_beginning_method can_seek_method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
bt_component_class_source_message_iterator_seek_beginning_method seek_method,
bt_component_class_source_message_iterator_can_seek_beginning_method can_seek_method)
{
bt_component_class_source_message_iterator_seek_beginning_method seek_method,
bt_component_class_source_message_iterator_can_seek_beginning_method can_seek_method)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(seek_method, "Seek method");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class *comp_cls,
const char *description)
{
struct bt_component_class *comp_cls,
const char *description)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(description, "Description");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(description, "Description");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
struct bt_component_class *comp_cls,
const char *help)
{
struct bt_component_class *comp_cls,
const char *help)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(help, "Help");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(help, "Help");
BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls);
{
struct bt_component_descriptor_set *comp_descr_set;
{
struct bt_component_descriptor_set *comp_descr_set;
+ BT_ASSERT_PRE_NO_ERROR();
+
BT_LOGI_STR("Creating component descriptor set object.");
comp_descr_set = g_new0(struct bt_component_descriptor_set, 1);
if (!comp_descr_set) {
BT_LOGI_STR("Creating component descriptor set object.");
comp_descr_set = g_new0(struct bt_component_descriptor_set, 1);
if (!comp_descr_set) {
struct bt_component_descriptor_set_entry *entry = NULL;
GPtrArray *comp_descr_array = NULL;
struct bt_component_descriptor_set_entry *entry = NULL;
GPtrArray *comp_descr_array = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_descr_set, "Component descriptor set");
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE(!params || bt_value_is_map(params),
BT_ASSERT_PRE_NON_NULL(comp_descr_set, "Component descriptor set");
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE(!params || bt_value_is_map(params),
const struct bt_component_class *comp_cls,
const struct bt_value *params)
{
const struct bt_component_class *comp_cls,
const struct bt_value *params)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_component_descriptor_set_add_descriptor_with_initialize_method_data(
comp_descr_set, comp_cls, params, NULL);
}
return bt_component_descriptor_set_add_descriptor_with_initialize_method_data(
comp_descr_set, comp_cls, params, NULL);
}
{
struct bt_component_filter *filter = NULL;
{
struct bt_component_filter *filter = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
filter = g_new0(struct bt_component_filter, 1);
if (!filter) {
BT_LIB_LOGE_APPEND_CAUSE(
filter = g_new0(struct bt_component_filter, 1);
if (!filter) {
BT_LIB_LOGE_APPEND_CAUSE(
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
/* bt_component_add_output_port() logs details and errors */
status = bt_component_add_output_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
/* bt_component_add_output_port() logs details and errors */
status = bt_component_add_output_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
+ BT_ASSERT_PRE_NO_ERROR();
+
/* bt_component_add_input_port() logs details/errors */
status = bt_component_add_input_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
/* bt_component_add_input_port() logs details/errors */
status = bt_component_add_input_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
{
struct bt_component_sink *sink = NULL;
{
struct bt_component_sink *sink = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
sink = g_new0(struct bt_component_sink, 1);
if (!sink) {
BT_LIB_LOGE_APPEND_CAUSE(
sink = g_new0(struct bt_component_sink, 1);
if (!sink) {
BT_LIB_LOGE_APPEND_CAUSE(
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
struct bt_port *port = NULL;
struct bt_component *comp = (void *) self_comp;
+ BT_ASSERT_PRE_NO_ERROR();
+
/* bt_component_add_input_port() logs details/errors */
status = bt_component_add_input_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
/* bt_component_add_input_port() logs details/errors */
status = bt_component_add_input_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
{
struct bt_component_source *source = NULL;
{
struct bt_component_source *source = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
source = g_new0(struct bt_component_source, 1);
if (!source) {
BT_LIB_LOGE_APPEND_CAUSE(
source = g_new0(struct bt_component_source, 1);
if (!source) {
BT_LIB_LOGE_APPEND_CAUSE(
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
enum bt_self_component_add_port_status status;
struct bt_port *port = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
/* bt_component_add_output_port() logs details and errors */
status = bt_component_add_output_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
/* bt_component_add_output_port() logs details and errors */
status = bt_component_add_output_port(comp, name, user_data, &port);
if (status != BT_FUNC_STATUS_OK) {
struct bt_graph *graph;
int ret;
struct bt_graph *graph;
int ret;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE(mip_version <= bt_get_maximal_mip_version(),
"Unknown MIP version: mip-version=%" PRIu64 ", "
"max-mip-version=%" PRIu64,
BT_ASSERT_PRE(mip_version <= bt_get_maximal_mip_version(),
"Unknown MIP version: mip-version=%" PRIu64 ", "
"max-mip-version=%" PRIu64,
enum bt_component_class_port_connected_method_status port_connected_status;
bool init_can_consume;
enum bt_component_class_port_connected_method_status port_connected_status;
bool init_can_consume;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(upstream_port, "Upstream port");
BT_ASSERT_PRE_NON_NULL(downstream_port, "Downstream port port");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(upstream_port, "Upstream port");
BT_ASSERT_PRE_NON_NULL(downstream_port, "Downstream port port");
{
enum bt_graph_run_once_status status;
{
enum bt_graph_run_once_status status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_DEV(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_DEV(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
{
enum bt_graph_run_status status;
{
enum bt_graph_run_status status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE(graph->can_consume,
"Cannot consume graph in its current state: %!+g", graph);
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
};
bt_listener_id listener_id;
};
bt_listener_id listener_id;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(func, "Listener");
BT_ASSERT_PRE_NON_NULL(func, "\"Listener removed\" listener");
void *init_method_data, bt_logging_level log_level,
const struct bt_component_source **component)
{
void *init_method_data, bt_logging_level log_level,
const struct bt_component_source **component)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
enum bt_logging_level log_level,
const struct bt_component_source **component)
{
enum bt_logging_level log_level,
const struct bt_component_source **component)
{
+ BT_ASSERT_PRE_NO_ERROR();
return bt_graph_add_source_component_with_initialize_method_data(
graph, comp_cls, name, params, NULL, log_level, component);
}
return bt_graph_add_source_component_with_initialize_method_data(
graph, comp_cls, name, params, NULL, log_level, component);
}
void *init_method_data, enum bt_logging_level log_level,
const struct bt_component_filter **component)
{
void *init_method_data, enum bt_logging_level log_level,
const struct bt_component_filter **component)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
enum bt_logging_level log_level,
const struct bt_component_filter **component)
{
enum bt_logging_level log_level,
const struct bt_component_filter **component)
{
+ BT_ASSERT_PRE_NO_ERROR();
return bt_graph_add_filter_component_with_initialize_method_data(
graph, comp_cls, name, params, NULL, log_level, component);
}
return bt_graph_add_filter_component_with_initialize_method_data(
graph, comp_cls, name, params, NULL, log_level, component);
}
void *init_method_data, enum bt_logging_level log_level,
const struct bt_component_sink **component)
{
void *init_method_data, enum bt_logging_level log_level,
const struct bt_component_sink **component)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
return add_component_with_init_method_data(graph,
(void *) comp_cls, (comp_init_method_t) comp_cls->methods.init,
enum bt_logging_level log_level,
const struct bt_component_sink **component)
{
enum bt_logging_level log_level,
const struct bt_component_sink **component)
{
+ BT_ASSERT_PRE_NO_ERROR();
return bt_graph_add_sink_component_with_initialize_method_data(
graph, comp_cls, name, params, NULL, log_level, component);
}
return bt_graph_add_sink_component_with_initialize_method_data(
graph, comp_cls, name, params, NULL, log_level, component);
}
.user_data = user_data,
};
.user_data = user_data,
};
+ BT_ASSERT_PRE_NO_ERROR();
+
/*
* Other preconditions are checked by
* bt_graph_add_sink_component_with_init_method_data().
/*
* Other preconditions are checked by
* bt_graph_add_sink_component_with_init_method_data().
enum bt_graph_add_interrupter_status bt_graph_add_interrupter(
struct bt_graph *graph, const struct bt_interrupter *intr)
{
enum bt_graph_add_interrupter_status bt_graph_add_interrupter(
struct bt_graph *graph, const struct bt_interrupter *intr)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
g_ptr_array_add(graph->interrupters, (void *) intr);
BT_ASSERT_PRE_NON_NULL(graph, "Graph");
BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
g_ptr_array_add(graph->interrupters, (void *) intr);
{
struct bt_interrupter *intr = g_new0(struct bt_interrupter, 1);
{
struct bt_interrupter *intr = g_new0(struct bt_interrupter, 1);
+ BT_ASSERT_PRE_NO_ERROR();
+
if (!intr) {
BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one interrupter.");
goto error;
if (!intr) {
BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one interrupter.");
goto error;
struct bt_self_component_port_input *input_port,
struct bt_self_component_port_input_message_iterator **message_iterator)
{
struct bt_self_component_port_input *input_port,
struct bt_self_component_port_input_message_iterator **message_iterator)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
return create_self_component_input_port_message_iterator(self_msg_iter,
input_port, message_iterator);
BT_ASSERT_PRE_NON_NULL(self_msg_iter, "Message iterator");
return create_self_component_input_port_message_iterator(self_msg_iter,
input_port, message_iterator);
struct bt_self_component_port_input *input_port,
struct bt_self_component_port_input_message_iterator **message_iterator)
{
struct bt_self_component_port_input *input_port,
struct bt_self_component_port_input_message_iterator **message_iterator)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(self_comp, "Sink component");
return create_self_component_input_port_message_iterator(NULL,
input_port, message_iterator);
BT_ASSERT_PRE_NON_NULL(self_comp, "Sink component");
return create_self_component_input_port_message_iterator(NULL,
input_port, message_iterator);
{
enum bt_message_iterator_next_status status = BT_FUNC_STATUS_OK;
{
enum bt_message_iterator_next_status status = BT_FUNC_STATUS_OK;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_DEV_NON_NULL(msgs, "Message array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(user_count, "Message count (output)");
BT_ASSERT_PRE_DEV_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_DEV_NON_NULL(msgs, "Message array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(user_count, "Message count (output)");
{
enum bt_message_iterator_can_seek_ns_from_origin_status status;
{
enum bt_message_iterator_can_seek_ns_from_origin_status status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
{
enum bt_message_iterator_can_seek_beginning_status status;
{
enum bt_message_iterator_can_seek_beginning_status status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_NON_NULL(can_seek, "Result (output)");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
GHashTable *stream_states = NULL;
bt_bool can_seek_by_itself;
GHashTable *stream_states = NULL;
bt_bool can_seek_by_itself;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
BT_ASSERT_PRE_NON_NULL(iterator, "Message iterator");
BT_ASSERT_PRE_ITER_HAS_STATE_TO_SEEK(iterator);
BT_ASSERT_PRE(
struct bt_self_message_iterator *message_iterator,
const struct bt_stream *stream)
{
struct bt_self_message_iterator *message_iterator,
const struct bt_stream *stream)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_EVENTS, (void *) stream,
false, 0, 0);
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_EVENTS, (void *) stream,
false, 0, 0);
const struct bt_stream *stream, uint64_t beginning_raw_value,
uint64_t end_raw_value)
{
const struct bt_stream *stream, uint64_t beginning_raw_value,
uint64_t end_raw_value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_EVENTS, (void *) stream,
true, beginning_raw_value, end_raw_value);
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_EVENTS, (void *) stream,
true, beginning_raw_value, end_raw_value);
struct bt_self_message_iterator *message_iterator,
const struct bt_stream *stream)
{
struct bt_self_message_iterator *message_iterator,
const struct bt_stream *stream)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_PACKETS, (void *) stream,
false, 0, 0);
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_PACKETS, (void *) stream,
false, 0, 0);
const struct bt_stream *stream, uint64_t beginning_raw_value,
uint64_t end_raw_value)
{
const struct bt_stream *stream, uint64_t beginning_raw_value,
uint64_t end_raw_value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_PACKETS, (void *) stream,
true, beginning_raw_value, end_raw_value);
return create_discarded_items_message(message_iterator,
BT_MESSAGE_TYPE_DISCARDED_PACKETS, (void *) stream,
true, beginning_raw_value, end_raw_value);
const struct bt_event_class *event_class,
const struct bt_stream *stream)
{
const struct bt_event_class *event_class,
const struct bt_stream *stream)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
return create_event_message(msg_iter, event_class, NULL, stream, false, 0);
}
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
return create_event_message(msg_iter, event_class, NULL, stream, false, 0);
}
const struct bt_event_class *event_class,
const struct bt_packet *packet)
{
const struct bt_event_class *event_class,
const struct bt_packet *packet)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
return create_event_message(msg_iter, event_class, packet,
packet->stream, false, 0);
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
return create_event_message(msg_iter, event_class, packet,
packet->stream, false, 0);
const struct bt_stream *stream,
uint64_t raw_value)
{
const struct bt_stream *stream,
uint64_t raw_value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
return create_event_message(msg_iter, event_class, NULL, stream,
true, raw_value);
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
return create_event_message(msg_iter, event_class, NULL, stream,
true, raw_value);
const struct bt_packet *packet,
uint64_t raw_value)
{
const struct bt_packet *packet,
uint64_t raw_value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
return create_event_message(msg_iter, event_class, packet,
packet->stream, true, raw_value);
BT_ASSERT_PRE_NON_NULL(packet, "Packet");
return create_event_message(msg_iter, event_class, packet,
packet->stream, true, raw_value);
struct bt_message_message_iterator_inactivity *message;
struct bt_message *ret_msg = NULL;
struct bt_message_message_iterator_inactivity *message;
struct bt_message *ret_msg = NULL;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
BT_ASSERT_PRE_NON_NULL(default_clock_class, "Default clock class");
BT_LIB_LOGD("Creating message iterator inactivity message object: "
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
BT_ASSERT_PRE_NON_NULL(default_clock_class, "Default clock class");
BT_LIB_LOGD("Creating message iterator inactivity message object: "
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, false, 0);
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, false, 0);
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, true, raw_value);
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_begin_msg_pool, true, raw_value);
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, false, 0);
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, false, 0);
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
struct bt_self_component_port_input_message_iterator *msg_iter =
(void *) self_msg_iter;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, true, raw_value);
BT_ASSERT_PRE_NON_NULL(msg_iter, "Message iterator");
return create_packet_message(msg_iter, (void *) packet,
&msg_iter->graph->packet_end_msg_pool, true, raw_value);
struct bt_self_message_iterator *self_msg_iter,
const struct bt_stream *stream)
{
struct bt_self_message_iterator *self_msg_iter,
const struct bt_stream *stream)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return create_stream_message(self_msg_iter, (void *) stream,
BT_MESSAGE_TYPE_STREAM_BEGINNING);
}
return create_stream_message(self_msg_iter, (void *) stream,
BT_MESSAGE_TYPE_STREAM_BEGINNING);
}
struct bt_self_message_iterator *self_msg_iter,
const struct bt_stream *stream)
{
struct bt_self_message_iterator *self_msg_iter,
const struct bt_stream *stream)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return create_stream_message(self_msg_iter, (void *) stream,
BT_MESSAGE_TYPE_STREAM_END);
}
return create_stream_message(self_msg_iter, (void *) stream,
BT_MESSAGE_TYPE_STREAM_END);
}
{
int status = BT_FUNC_STATUS_OK;
{
int status = BT_FUNC_STATUS_OK;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_descr_set, "Component descriptor set");
BT_ASSERT_PRE_NON_NULL(operative_mip_version,
"Operative MIP version (output)");
BT_ASSERT_PRE_NON_NULL(comp_descr_set, "Component descriptor set");
BT_ASSERT_PRE_NON_NULL(operative_mip_version,
"Operative MIP version (output)");
{
struct bt_query_executor *query_exec;
{
struct bt_query_executor *query_exec;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(object, "Object");
BT_LIB_LOGD("Creating query executor: "
BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
BT_ASSERT_PRE_NON_NULL(object, "Object");
BT_LIB_LOGD("Creating query executor: "
const bt_component_class *comp_cls, const char *object,
const bt_value *params)
{
const bt_component_class *comp_cls, const char *object,
const bt_value *params)
{
+ BT_ASSERT_PRE_NO_ERROR();
return bt_query_executor_create_with_method_data(comp_cls,
object, params, NULL);
}
return bt_query_executor_create_with_method_data(comp_cls,
object, params, NULL);
}
enum bt_component_class_query_method_status query_status;
method_t method = NULL;
enum bt_component_class_query_method_status query_status;
method_t method = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
BT_ASSERT_PRE_NON_NULL(user_result, "Result (output)");
BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
BT_ASSERT_PRE_NON_NULL(user_result, "Result (output)");
struct bt_query_executor *query_exec,
const struct bt_interrupter *intr)
{
struct bt_query_executor *query_exec,
const struct bt_interrupter *intr)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
g_ptr_array_add(query_exec->interrupters, (void *) intr);
BT_ASSERT_PRE_NON_NULL(query_exec, "Query executor");
BT_ASSERT_PRE_NON_NULL(intr, "Interrupter");
g_ptr_array_add(query_exec->interrupters, (void *) intr);
struct bt_integer_range_set_unsigned *bt_integer_range_set_unsigned_create(void)
{
struct bt_integer_range_set_unsigned *bt_integer_range_set_unsigned_create(void)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return (void *) create_range_set();
}
struct bt_integer_range_set_signed *bt_integer_range_set_signed_create(void)
{
return (void *) create_range_set();
}
struct bt_integer_range_set_signed *bt_integer_range_set_signed_create(void)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return (void *) create_range_set();
}
return (void *) create_range_set();
}
struct bt_integer_range_set_unsigned *range_set,
uint64_t lower, uint64_t upper)
{
struct bt_integer_range_set_unsigned *range_set,
uint64_t lower, uint64_t upper)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE(lower <= upper,
"Range's upper bound is less than lower bound: "
"upper=%" PRIu64 ", lower=%" PRIu64, lower, upper);
BT_ASSERT_PRE(lower <= upper,
"Range's upper bound is less than lower bound: "
"upper=%" PRIu64 ", lower=%" PRIu64, lower, upper);
struct bt_integer_range_set_signed *range_set,
int64_t lower, int64_t upper)
{
struct bt_integer_range_set_signed *range_set,
int64_t lower, int64_t upper)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE(lower <= upper,
"Range's upper bound is less than lower bound: "
"upper=%" PRId64 ", lower=%" PRId64, lower, upper);
BT_ASSERT_PRE(lower <= upper,
"Range's upper bound is less than lower bound: "
"upper=%" PRId64 ", lower=%" PRId64, lower, upper);
bt_bool fail_on_load_error,
const struct bt_plugin_set **plugin_set_out)
{
bt_bool fail_on_load_error,
const struct bt_plugin_set **plugin_set_out)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
/* bt_plugin_so_create_all_from_static() logs errors */
return bt_plugin_so_create_all_from_static(fail_on_load_error,
(void *) plugin_set_out);
/* bt_plugin_so_create_all_from_static() logs errors */
return bt_plugin_so_create_all_from_static(fail_on_load_error,
(void *) plugin_set_out);
{
enum bt_plugin_find_all_from_file_status status;
{
enum bt_plugin_find_all_from_file_status status;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(path, "Path");
BT_ASSERT_PRE_NON_NULL(path, "Plugin set (output)");
BT_LOGI("Creating plugins from file: path=\"%s\"", path);
BT_ASSERT_PRE_NON_NULL(path, "Path");
BT_ASSERT_PRE_NON_NULL(path, "Plugin set (output)");
BT_LOGI("Creating plugins from file: path=\"%s\"", path);
int status = BT_FUNC_STATUS_OK;
uint64_t dir_i, plugin_i;
int status = BT_FUNC_STATUS_OK;
uint64_t dir_i, plugin_i;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
BT_LOGI("Finding all plugins in standard directories and built-in plugins: "
"find-in-std-env-var=%d, find-in-user-dir=%d, "
BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
BT_LOGI("Finding all plugins in standard directories and built-in plugins: "
"find-in-std-env-var=%d, find-in-user-dir=%d, "
const struct bt_plugin_set *plugin_set = NULL;
uint64_t i;
const struct bt_plugin_set *plugin_set = NULL;
uint64_t i;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(plugin_name, "Name");
BT_ASSERT_PRE_NON_NULL(plugin_out, "Plugin (output)");
BT_LOGI("Finding named plugin in standard directories and built-in plugins: "
BT_ASSERT_PRE_NON_NULL(plugin_name, "Name");
BT_ASSERT_PRE_NON_NULL(plugin_out, "Plugin (output)");
BT_LOGI("Finding named plugin in standard directories and built-in plugins: "
enum bt_plugin_find_all_from_dir_status status =
BT_FUNC_STATUS_OK;
enum bt_plugin_find_all_from_dir_status status =
BT_FUNC_STATUS_OK;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
BT_LOGI("Creating all plugins in directory: path=\"%s\", recurse=%d",
path, recurse);
BT_ASSERT_PRE_NON_NULL(plugin_set_out, "Plugin set (output)");
BT_LOGI("Creating all plugins in directory: path=\"%s\", recurse=%d",
path, recurse);
int ret;
struct bt_clock_class *clock_class = NULL;
int ret;
struct bt_clock_class *clock_class = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(self_comp, "Self component");
BT_LOGD_STR("Creating default clock class object");
BT_ASSERT_PRE_NON_NULL(self_comp, "Self component");
BT_LOGD_STR("Creating default clock class object");
enum bt_clock_class_set_name_status bt_clock_class_set_name(
struct bt_clock_class *clock_class, const char *name)
{
enum bt_clock_class_set_name_status bt_clock_class_set_name(
struct bt_clock_class *clock_class, const char *name)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
enum bt_clock_class_set_description_status bt_clock_class_set_description(
struct bt_clock_class *clock_class, const char *descr)
{
enum bt_clock_class_set_description_status bt_clock_class_set_description(
struct bt_clock_class *clock_class, const char *descr)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_NON_NULL(descr, "Description");
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_NON_NULL(descr, "Description");
BT_ASSERT_PRE_DEV_CLOCK_CLASS_HOT(clock_class);
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_DEV_NON_NULL(ns, "Nanoseconds (output)");
ret = bt_util_ns_from_origin_clock_class(clock_class, cycles, ns);
BT_ASSERT_PRE_DEV_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_DEV_NON_NULL(ns, "Nanoseconds (output)");
ret = bt_util_ns_from_origin_clock_class(clock_class, cycles, ns);
{
int ret = BT_FUNC_STATUS_OK;
{
int ret = BT_FUNC_STATUS_OK;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
BT_ASSERT_PRE_DEV_NON_NULL(ret_value_ns, "Value (ns) (output)");
BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
BT_ASSERT_PRE_DEV_NON_NULL(ret_value_ns, "Value (ns) (output)");
BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
struct bt_event_class *bt_event_class_create(
struct bt_stream_class *stream_class)
{
struct bt_event_class *bt_event_class_create(
struct bt_stream_class *stream_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE(stream_class->assigns_automatic_event_class_id,
"Stream class does not automatically assigns event class IDs: "
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE(stream_class->assigns_automatic_event_class_id,
"Stream class does not automatically assigns event class IDs: "
struct bt_event_class *bt_event_class_create_with_id(
struct bt_stream_class *stream_class, uint64_t id)
{
struct bt_event_class *bt_event_class_create_with_id(
struct bt_stream_class *stream_class, uint64_t id)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE(!stream_class->assigns_automatic_event_class_id,
"Stream class automatically assigns event class IDs: "
"%![sc-]+S", stream_class);
BT_ASSERT_PRE(!stream_class->assigns_automatic_event_class_id,
"Stream class automatically assigns event class IDs: "
"%![sc-]+S", stream_class);
enum bt_event_class_set_name_status bt_event_class_set_name(
struct bt_event_class *event_class, const char *name)
{
enum bt_event_class_set_name_status bt_event_class_set_name(
struct bt_event_class *event_class, const char *name)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
struct bt_event_class *event_class,
const char *emf_uri)
{
struct bt_event_class *event_class,
const char *emf_uri)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(emf_uri, "EMF URI");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(emf_uri, "EMF URI");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
.event_payload = NULL,
};
.event_payload = NULL,
};
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
.event_payload = field_class,
};
.event_payload = field_class,
};
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
BT_ASSERT_PRE_NON_NULL(event_class, "Event class");
BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
BT_ASSERT_PRE_DEV_EVENT_CLASS_HOT(event_class);
{
struct bt_field_class_bit_array *ba_fc = NULL;
{
struct bt_field_class_bit_array *ba_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_ASSERT_PRE(length > 0 && length <= 64,
"Unsupported length for bit array field class "
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_ASSERT_PRE(length > 0 && length <= 64,
"Unsupported length for bit array field class "
{
struct bt_field_class_bool *bool_fc = NULL;
{
struct bt_field_class_bool *bool_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_LOGD("Creating default boolean field class object.");
bool_fc = g_new0(struct bt_field_class_bool, 1);
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_LOGD("Creating default boolean field class object.");
bool_fc = g_new0(struct bt_field_class_bool, 1);
struct bt_field_class *bt_field_class_integer_unsigned_create(
bt_trace_class *trace_class)
{
struct bt_field_class *bt_field_class_integer_unsigned_create(
bt_trace_class *trace_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return create_integer_field_class(trace_class,
BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
}
return create_integer_field_class(trace_class,
BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER);
}
struct bt_field_class *bt_field_class_integer_signed_create(
bt_trace_class *trace_class)
{
struct bt_field_class *bt_field_class_integer_signed_create(
bt_trace_class *trace_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return create_integer_field_class(trace_class,
BT_FIELD_CLASS_TYPE_SIGNED_INTEGER);
}
return create_integer_field_class(trace_class,
BT_FIELD_CLASS_TYPE_SIGNED_INTEGER);
}
struct bt_field_class *bt_field_class_enumeration_unsigned_create(
bt_trace_class *trace_class)
{
struct bt_field_class *bt_field_class_enumeration_unsigned_create(
bt_trace_class *trace_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return create_enumeration_field_class(trace_class,
BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
}
return create_enumeration_field_class(trace_class,
BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION);
}
struct bt_field_class *bt_field_class_enumeration_signed_create(
bt_trace_class *trace_class)
{
struct bt_field_class *bt_field_class_enumeration_signed_create(
bt_trace_class *trace_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return create_enumeration_field_class(trace_class,
BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
}
return create_enumeration_field_class(trace_class,
BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION);
}
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
uint64_t i;
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
uint64_t i;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
uint64_t i;
const struct bt_field_class_enumeration *enum_fc = (const void *) fc;
uint64_t i;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(count, "Count (output)");
struct bt_field_class_enumeration *enum_fc = (void *) fc;
struct bt_field_class_enumeration_mapping mapping = { 0 };
struct bt_field_class_enumeration *enum_fc = (void *) fc;
struct bt_field_class_enumeration_mapping mapping = { 0 };
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT(fc);
BT_ASSERT_PRE_NON_NULL(label, "Label");
BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
BT_ASSERT(fc);
BT_ASSERT_PRE_NON_NULL(label, "Label");
BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
struct bt_field_class *fc, const char *label,
const struct bt_integer_range_set_unsigned *range_set)
{
struct bt_field_class *fc, const char *label,
const struct bt_integer_range_set_unsigned *range_set)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
"Field class");
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION,
"Field class");
struct bt_field_class *fc, const char *label,
const struct bt_integer_range_set_signed *range_set)
{
struct bt_field_class *fc, const char *label,
const struct bt_integer_range_set_signed *range_set)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
"Field class");
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION,
"Field class");
struct bt_field_class *bt_field_class_real_single_precision_create(
bt_trace_class *trace_class)
{
struct bt_field_class *bt_field_class_real_single_precision_create(
bt_trace_class *trace_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return create_real_field_class(trace_class,
BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL);
}
return create_real_field_class(trace_class,
BT_FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL);
}
struct bt_field_class *bt_field_class_real_double_precision_create(
bt_trace_class *trace_class)
{
struct bt_field_class *bt_field_class_real_double_precision_create(
bt_trace_class *trace_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return create_real_field_class(trace_class,
BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL);
}
return create_real_field_class(trace_class,
BT_FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL);
}
int ret;
struct bt_field_class_structure *struct_fc = NULL;
int ret;
struct bt_field_class_structure *struct_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_LOGD_STR("Creating default structure field class object.");
struct_fc = g_new0(struct bt_field_class_structure, 1);
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_LOGD_STR("Creating default structure field class object.");
struct_fc = g_new0(struct bt_field_class_structure, 1);
enum bt_field_class_structure_append_member_status status;
struct bt_named_field_class *named_fc = NULL;
enum bt_field_class_structure_append_member_status status;
struct bt_named_field_class *named_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_FC_HAS_ID(fc, BT_FIELD_CLASS_TYPE_STRUCTURE,
"Field class");
struct bt_trace_class *trace_class,
struct bt_field_class *content_fc)
{
struct bt_trace_class *trace_class,
struct bt_field_class *content_fc)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return create_option_field_class(trace_class,
BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD,
content_fc, NULL);
return create_option_field_class(trace_class,
BT_FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD,
content_fc, NULL);
struct bt_field_class *content_fc,
struct bt_field_class *selector_fc)
{
struct bt_field_class *content_fc,
struct bt_field_class *selector_fc)
{
- struct bt_field_class_option_with_selector_field_bool *fc =
- (void *) create_option_field_class(trace_class,
- BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD,
- content_fc, selector_fc);
+ BT_ASSERT_PRE_NO_ERROR();
- if (!fc) {
- goto end;
- }
-
-end:
- return (void *) fc;
+ return create_option_field_class(trace_class,
+ BT_FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD,
+ content_fc, selector_fc);
}
struct bt_field_class *
}
struct bt_field_class *
const struct bt_integer_range_set *range_set =
(const void *) u_range_set;
const struct bt_integer_range_set *range_set =
(const void *) u_range_set;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
const struct bt_integer_range_set *range_set =
(const void *) i_range_set;
const struct bt_integer_range_set *range_set =
(const void *) i_range_set;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
BT_ASSERT_PRE_NON_NULL(range_set, "Integer range set");
BT_ASSERT_PRE(range_set->ranges->len > 0,
"Integer range set is empty: %!+R", range_set);
struct bt_field_class_variant_with_selector_field *var_with_sel_fc = NULL;
enum bt_field_class_type fc_type;
struct bt_field_class_variant_with_selector_field *var_with_sel_fc = NULL;
enum bt_field_class_type fc_type;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
if (selector_fc) {
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
if (selector_fc) {
enum bt_field_class_variant_without_selector_append_option_status status;
struct bt_named_field_class *named_fc = NULL;
enum bt_field_class_variant_without_selector_append_option_status status;
struct bt_named_field_class *named_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class");
BT_ASSERT_PRE_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(option_fc, "Option field class");
struct bt_field_class *option_fc,
const struct bt_integer_range_set_unsigned *range_set)
{
struct bt_field_class *option_fc,
const struct bt_integer_range_set_unsigned *range_set)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return append_option_to_variant_with_selector_field_field_class(fc,
name, option_fc, (const void *) range_set,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD);
return append_option_to_variant_with_selector_field_field_class(fc,
name, option_fc, (const void *) range_set,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD);
struct bt_field_class *option_fc,
const struct bt_integer_range_set_signed *range_set)
{
struct bt_field_class *option_fc,
const struct bt_integer_range_set_signed *range_set)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return append_option_to_variant_with_selector_field_field_class(fc,
name, option_fc, (const void *) range_set,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD);
return append_option_to_variant_with_selector_field_field_class(fc,
name, option_fc, (const void *) range_set,
BT_FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD);
{
struct bt_field_class_array_static *array_fc = NULL;
{
struct bt_field_class_array_static *array_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default static array field class object.");
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default static array field class object.");
{
struct bt_field_class_array_dynamic *array_fc = NULL;
{
struct bt_field_class_array_dynamic *array_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default dynamic array field class object.");
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_ASSERT_PRE_NON_NULL(element_fc, "Element field class");
BT_LOGD_STR("Creating default dynamic array field class object.");
{
const struct bt_field_class_array_dynamic *seq_fc = (const void *) fc;
{
const struct bt_field_class_array_dynamic *seq_fc = (const void *) fc;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_FC_HAS_ID(fc,
BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD,
BT_ASSERT_PRE_DEV_NON_NULL(fc, "Field class");
BT_ASSERT_PRE_DEV_FC_HAS_ID(fc,
BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD,
{
struct bt_field_class_string *string_fc = NULL;
{
struct bt_field_class_string *string_fc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_LOGD_STR("Creating default string field class object.");
string_fc = g_new0(struct bt_field_class_string, 1);
BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
BT_LOGD_STR("Creating default string field class object.");
string_fc = g_new0(struct bt_field_class_string, 1);
{
const struct bt_field_integer *int_field = (const void *) field;
{
const struct bt_field_integer *int_field = (const void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
{
const struct bt_field_integer *int_field = (const void *) field;
{
const struct bt_field_integer *int_field = (const void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Label array (output)");
BT_ASSERT_PRE_DEV_NON_NULL(label_array, "Count (output)");
enum bt_field_string_set_value_status bt_field_string_set_value(
struct bt_field *field, const char *value)
{
enum bt_field_string_set_value_status bt_field_string_set_value(
struct bt_field *field, const char *value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
enum bt_field_string_append_status bt_field_string_append(
struct bt_field *field, const char *value)
{
enum bt_field_string_append_status bt_field_string_append(
struct bt_field *field, const char *value)
{
+ BT_ASSERT_PRE_DEV_NO_ERROR();
+
return bt_field_string_append_with_length(field,
value, (uint64_t) strlen(value));
}
return bt_field_string_append_with_length(field,
value, (uint64_t) strlen(value));
}
char *data;
uint64_t new_length;
char *data;
uint64_t new_length;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(value, "Value");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
int ret = BT_FUNC_STATUS_OK;
struct bt_field_array *array_field = (void *) field;
int ret = BT_FUNC_STATUS_OK;
struct bt_field_array *array_field = (void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_DYNAMIC_ARRAY(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
{
struct bt_field_variant *var_field = (void *) field;
{
struct bt_field_variant *var_field = (void *) field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
BT_ASSERT_PRE_DEV_NON_NULL(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_IS_VARIANT(field, "Field");
BT_ASSERT_PRE_DEV_FIELD_HOT(field, "Field");
{
struct bt_field_wrapper *field_wrapper;
{
struct bt_field_wrapper *field_wrapper;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE(stream_class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE(stream_class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
struct bt_packet *packet = NULL;
struct bt_stream *stream = (void *) c_stream;
struct bt_packet *packet = NULL;
struct bt_stream *stream = (void *) c_stream;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
BT_ASSERT_PRE(stream->class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
BT_ASSERT_PRE(stream->class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
struct bt_stream_class *stream_class;
struct bt_field_wrapper *field_wrapper = (void *) context_field;
struct bt_stream_class *stream_class;
struct bt_field_wrapper *field_wrapper = (void *) context_field;
+ BT_ASSERT_PRE_DEV_NO_ERROR();
BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
BT_ASSERT_PRE_DEV_NON_NULL(field_wrapper, "Context field");
BT_ASSERT_PRE_DEV_HOT(packet, "Packet", ": %!+a", packet);
BT_ASSERT_PRE_DEV_NON_NULL(packet, "Packet");
BT_ASSERT_PRE_DEV_NON_NULL(field_wrapper, "Context field");
BT_ASSERT_PRE_DEV_HOT(packet, "Packet", ": %!+a", packet);
struct bt_stream_class *bt_stream_class_create(struct bt_trace_class *tc)
{
struct bt_stream_class *bt_stream_class_create(struct bt_trace_class *tc)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE(tc->assigns_automatic_stream_class_id,
"Trace class does not automatically assigns stream class IDs: "
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE(tc->assigns_automatic_stream_class_id,
"Trace class does not automatically assigns stream class IDs: "
struct bt_stream_class *bt_stream_class_create_with_id(
struct bt_trace_class *tc, uint64_t id)
{
struct bt_stream_class *bt_stream_class_create_with_id(
struct bt_trace_class *tc, uint64_t id)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE(!tc->assigns_automatic_stream_class_id,
"Trace class automatically assigns stream class IDs: "
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE(!tc->assigns_automatic_stream_class_id,
"Trace class automatically assigns stream class IDs: "
struct bt_stream_class *stream_class,
const char *name)
{
struct bt_stream_class *stream_class,
const char *name)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
.event_payload = NULL,
};
.event_payload = NULL,
};
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE(stream_class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE(stream_class->supports_packets,
"Stream class does not support packets: %![sc-]+S",
.event_payload = NULL,
};
.event_payload = NULL,
};
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(field_class, "Field class");
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
struct bt_stream_class *stream_class,
struct bt_clock_class *clock_class)
{
struct bt_stream_class *stream_class,
struct bt_clock_class *clock_class)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(clock_class, "Clock class");
BT_ASSERT_PRE_DEV_STREAM_CLASS_HOT(stream_class);
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(stream_class->assigns_automatic_stream_id,
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(stream_class->assigns_automatic_stream_id,
struct bt_stream *bt_stream_create_with_id(struct bt_stream_class *stream_class,
struct bt_trace *trace, uint64_t id)
{
struct bt_stream *bt_stream_create_with_id(struct bt_stream_class *stream_class,
struct bt_trace *trace, uint64_t id)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(!stream_class->assigns_automatic_stream_id,
BT_ASSERT_PRE_NON_NULL(stream_class, "Stream class");
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(!stream_class->assigns_automatic_stream_id,
enum bt_stream_set_name_status bt_stream_set_name(struct bt_stream *stream,
const char *name)
{
enum bt_stream_set_name_status bt_stream_set_name(struct bt_stream *stream,
const char *name)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_STREAM_HOT(stream);
{
struct bt_trace_class *tc = NULL;
{
struct bt_trace_class *tc = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(self_comp, "Self component");
BT_LOGD_STR("Creating default trace class object.");
tc = g_new0(struct bt_trace_class, 1);
BT_ASSERT_PRE_NON_NULL(self_comp, "Self component");
BT_LOGD_STR("Creating default trace class object.");
tc = g_new0(struct bt_trace_class, 1);
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE_NON_NULL(listener, "Listener");
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE_NON_NULL(listener, "Listener");
struct bt_trace_class *tc = (void *) _tc;
struct bt_trace_class_destruction_listener_elem *elem;
struct bt_trace_class *tc = (void *) _tc;
struct bt_trace_class_destruction_listener_elem *elem;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE(has_listener_id(tc, listener_id),
"Trace class has no such trace class destruction listener ID: "
BT_ASSERT_PRE_NON_NULL(tc, "Trace class");
BT_ASSERT_PRE(has_listener_id(tc, listener_id),
"Trace class has no such trace class destruction listener ID: "
{
struct bt_trace *trace = NULL;
{
struct bt_trace *trace = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
BT_LIB_LOGD("Creating trace object: %![tc-]+T", tc);
trace = g_new0(struct bt_trace, 1);
if (!trace) {
BT_LIB_LOGD("Creating trace object: %![tc-]+T", tc);
trace = g_new0(struct bt_trace, 1);
if (!trace) {
enum bt_trace_set_name_status bt_trace_set_name(struct bt_trace *trace,
const char *name)
{
enum bt_trace_set_name_status bt_trace_set_name(struct bt_trace *trace,
const char *name)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
{
int ret;
struct bt_value *value_obj;
{
int ret;
struct bt_value *value_obj;
+
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(value, "Value");
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(value, "Value");
value_obj = bt_value_string_create_init(value);
if (!value_obj) {
BT_LIB_LOGE_APPEND_CAUSE(
value_obj = bt_value_string_create_init(value);
if (!value_obj) {
BT_LIB_LOGE_APPEND_CAUSE(
{
int ret;
struct bt_value *value_obj;
{
int ret;
struct bt_value *value_obj;
+
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(name, "Name");
value_obj = bt_value_integer_signed_create_init(value);
if (!value_obj) {
BT_LIB_LOGE_APPEND_CAUSE(
value_obj = bt_value_integer_signed_create_init(value);
if (!value_obj) {
BT_LIB_LOGE_APPEND_CAUSE(
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(listener, "Listener");
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE_NON_NULL(listener, "Listener");
struct bt_trace *trace = (void *) c_trace;
struct bt_trace_destruction_listener_elem *elem;
struct bt_trace *trace = (void *) c_trace;
struct bt_trace_destruction_listener_elem *elem;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(has_listener_id(trace, listener_id),
"Trace has no such trace destruction listener ID: "
BT_ASSERT_PRE_NON_NULL(trace, "Trace");
BT_ASSERT_PRE(has_listener_id(trace, listener_id),
"Trace has no such trace destruction listener ID: "
BT_FUNC_STATUS_OK;
int ret;
BT_FUNC_STATUS_OK;
int ret;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(ns, "Nanoseconds (output)");
BT_ASSERT_PRE(frequency != UINT64_C(-1) && frequency != 0,
"Invalid frequency: freq=%" PRIu64, frequency);
BT_ASSERT_PRE_NON_NULL(ns, "Nanoseconds (output)");
BT_ASSERT_PRE(frequency != UINT64_C(-1) && frequency != 0,
"Invalid frequency: freq=%" PRIu64, frequency);
{
struct bt_value_bool *bool_obj;
{
struct bt_value_bool *bool_obj;
+ BT_ASSERT_PRE_NO_ERROR();
+
BT_LOGD("Creating boolean value object: val=%d", val);
bool_obj = g_new0(struct bt_value_bool, 1);
if (!bool_obj) {
BT_LOGD("Creating boolean value object: val=%d", val);
bool_obj = g_new0(struct bt_value_bool, 1);
if (!bool_obj) {
struct bt_value *bt_value_bool_create(void)
{
struct bt_value *bt_value_bool_create(void)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_value_bool_create_init(BT_FALSE);
}
return bt_value_bool_create_init(BT_FALSE);
}
struct bt_value *bt_value_integer_unsigned_create_init(uint64_t val)
{
struct bt_value *bt_value_integer_unsigned_create_init(uint64_t val)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_value_integer_create_init(BT_VALUE_TYPE_UNSIGNED_INTEGER,
val);
}
struct bt_value *bt_value_integer_unsigned_create(void)
{
return bt_value_integer_create_init(BT_VALUE_TYPE_UNSIGNED_INTEGER,
val);
}
struct bt_value *bt_value_integer_unsigned_create(void)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_value_integer_unsigned_create_init(0);
}
struct bt_value *bt_value_integer_signed_create_init(int64_t val)
{
return bt_value_integer_unsigned_create_init(0);
}
struct bt_value *bt_value_integer_signed_create_init(int64_t val)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_value_integer_create_init(BT_VALUE_TYPE_SIGNED_INTEGER,
(uint64_t) val);
}
struct bt_value *bt_value_integer_signed_create(void)
{
return bt_value_integer_create_init(BT_VALUE_TYPE_SIGNED_INTEGER,
(uint64_t) val);
}
struct bt_value *bt_value_integer_signed_create(void)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_value_integer_signed_create_init(0);
}
return bt_value_integer_signed_create_init(0);
}
{
struct bt_value_real *real_obj;
{
struct bt_value_real *real_obj;
+ BT_ASSERT_PRE_NO_ERROR();
+
BT_LOGD("Creating real number value object: val=%f", val);
real_obj = g_new0(struct bt_value_real, 1);
if (!real_obj) {
BT_LOGD("Creating real number value object: val=%f", val);
real_obj = g_new0(struct bt_value_real, 1);
if (!real_obj) {
struct bt_value *bt_value_real_create(void)
{
struct bt_value *bt_value_real_create(void)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_value_real_create_init(0.);
}
return bt_value_real_create_init(0.);
}
{
struct bt_value_string *string_obj = NULL;
{
struct bt_value_string *string_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(val, "Value");
BT_ASSERT_PRE_NON_NULL(val, "Value");
BT_LOGD("Creating string value object: val-len=%zu", strlen(val));
string_obj = g_new0(struct bt_value_string, 1);
if (!string_obj) {
BT_LOGD("Creating string value object: val-len=%zu", strlen(val));
string_obj = g_new0(struct bt_value_string, 1);
if (!string_obj) {
struct bt_value *bt_value_string_create(void)
{
struct bt_value *bt_value_string_create(void)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return bt_value_string_create_init("");
}
return bt_value_string_create_init("");
}
{
struct bt_value_array *array_obj;
{
struct bt_value_array *array_obj;
+ BT_ASSERT_PRE_NO_ERROR();
+
BT_LOGD_STR("Creating empty array value object.");
array_obj = g_new0(struct bt_value_array, 1);
if (!array_obj) {
BT_LOGD_STR("Creating empty array value object.");
array_obj = g_new0(struct bt_value_array, 1);
if (!array_obj) {
{
struct bt_value_map *map_obj;
{
struct bt_value_map *map_obj;
+ BT_ASSERT_PRE_NO_ERROR();
+
BT_LOGD_STR("Creating empty map value object.");
map_obj = g_new0(struct bt_value_map, 1);
if (!map_obj) {
BT_LOGD_STR("Creating empty map value object.");
map_obj = g_new0(struct bt_value_map, 1);
if (!map_obj) {
enum bt_value_string_set_status bt_value_string_set(
struct bt_value *string_obj, const char *val)
{
enum bt_value_string_set_status bt_value_string_set(
struct bt_value *string_obj, const char *val)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
BT_ASSERT_PRE_DEV_VALUE_HOT(string_obj, "Value object");
BT_ASSERT_PRE_NON_NULL(string_obj, "Value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(string_obj, BT_VALUE_TYPE_STRING);
BT_ASSERT_PRE_DEV_VALUE_HOT(string_obj, "Value object");
struct bt_value_array *typed_array_obj =
BT_VALUE_TO_ARRAY(array_obj);
struct bt_value_array *typed_array_obj =
BT_VALUE_TO_ARRAY(array_obj);
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
enum bt_value_array_append_element_status ret;
struct bt_value *bool_obj = NULL;
enum bt_value_array_append_element_status ret;
struct bt_value *bool_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
bool_obj = bt_value_bool_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) bool_obj);
bool_obj = bt_value_bool_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) bool_obj);
enum bt_value_array_append_element_status ret;
struct bt_value *integer_obj = NULL;
enum bt_value_array_append_element_status ret;
struct bt_value *integer_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
integer_obj = bt_value_integer_unsigned_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) integer_obj);
integer_obj = bt_value_integer_unsigned_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) integer_obj);
enum bt_value_array_append_element_status ret;
struct bt_value *integer_obj = NULL;
enum bt_value_array_append_element_status ret;
struct bt_value *integer_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
integer_obj = bt_value_integer_signed_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) integer_obj);
integer_obj = bt_value_integer_signed_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) integer_obj);
enum bt_value_array_append_element_status ret;
struct bt_value *real_obj = NULL;
enum bt_value_array_append_element_status ret;
struct bt_value *real_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
real_obj = bt_value_real_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) real_obj);
real_obj = bt_value_real_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) real_obj);
enum bt_value_array_append_element_status ret;
struct bt_value *string_obj = NULL;
enum bt_value_array_append_element_status ret;
struct bt_value *string_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
string_obj = bt_value_string_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) string_obj);
string_obj = bt_value_string_create_init(val);
ret = bt_value_array_append_element(array_obj,
(void *) string_obj);
enum bt_value_array_append_element_status ret;
struct bt_value *empty_array_obj = NULL;
enum bt_value_array_append_element_status ret;
struct bt_value *empty_array_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
empty_array_obj = bt_value_array_create();
ret = bt_value_array_append_element(array_obj,
(void *) empty_array_obj);
empty_array_obj = bt_value_array_create();
ret = bt_value_array_append_element(array_obj,
(void *) empty_array_obj);
enum bt_value_array_append_element_status ret;
struct bt_value *map_obj = NULL;
enum bt_value_array_append_element_status ret;
struct bt_value *map_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
map_obj = bt_value_map_create();
ret = bt_value_array_append_element(array_obj,
(void *) map_obj);
map_obj = bt_value_map_create();
ret = bt_value_array_append_element(array_obj,
(void *) map_obj);
struct bt_value_array *typed_array_obj =
BT_VALUE_TO_ARRAY(array_obj);
struct bt_value_array *typed_array_obj =
BT_VALUE_TO_ARRAY(array_obj);
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
BT_ASSERT_PRE_NON_NULL(array_obj, "Array value object");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_VALUE_IS_TYPE(array_obj, BT_VALUE_TYPE_ARRAY);
struct bt_value *map_obj, const char *key,
struct bt_value *element_obj)
{
struct bt_value *map_obj, const char *key,
struct bt_value *element_obj)
{
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(map_obj, "Map value object");
BT_ASSERT_PRE_NON_NULL(key, "Key");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
BT_ASSERT_PRE_NON_NULL(map_obj, "Map value object");
BT_ASSERT_PRE_NON_NULL(key, "Key");
BT_ASSERT_PRE_NON_NULL(element_obj, "Element value object");
enum bt_value_map_insert_entry_status ret;
struct bt_value *bool_obj = NULL;
enum bt_value_map_insert_entry_status ret;
struct bt_value *bool_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
bool_obj = bt_value_bool_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) bool_obj);
bool_obj = bt_value_bool_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) bool_obj);
enum bt_value_map_insert_entry_status ret;
struct bt_value *integer_obj = NULL;
enum bt_value_map_insert_entry_status ret;
struct bt_value *integer_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
integer_obj = bt_value_integer_unsigned_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) integer_obj);
integer_obj = bt_value_integer_unsigned_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) integer_obj);
enum bt_value_map_insert_entry_status ret;
struct bt_value *integer_obj = NULL;
enum bt_value_map_insert_entry_status ret;
struct bt_value *integer_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
integer_obj = bt_value_integer_signed_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) integer_obj);
integer_obj = bt_value_integer_signed_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) integer_obj);
enum bt_value_map_insert_entry_status ret;
struct bt_value *real_obj = NULL;
enum bt_value_map_insert_entry_status ret;
struct bt_value *real_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
real_obj = bt_value_real_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) real_obj);
real_obj = bt_value_real_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) real_obj);
enum bt_value_map_insert_entry_status ret;
struct bt_value *string_obj = NULL;
enum bt_value_map_insert_entry_status ret;
struct bt_value *string_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
string_obj = bt_value_string_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) string_obj);
string_obj = bt_value_string_create_init(val);
ret = bt_value_map_insert_entry(map_obj, key,
(void *) string_obj);
enum bt_value_map_insert_entry_status ret;
struct bt_value *array_obj = NULL;
enum bt_value_map_insert_entry_status ret;
struct bt_value *array_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
array_obj = bt_value_array_create();
ret = bt_value_map_insert_entry(map_obj, key,
(void *) array_obj);
array_obj = bt_value_array_create();
ret = bt_value_map_insert_entry(map_obj, key,
(void *) array_obj);
enum bt_value_map_insert_entry_status ret;
struct bt_value *empty_map_obj = NULL;
enum bt_value_map_insert_entry_status ret;
struct bt_value *empty_map_obj = NULL;
+ BT_ASSERT_PRE_NO_ERROR();
+
empty_map_obj = bt_value_map_create();
ret = bt_value_map_insert_entry(map_obj, key,
(void *) empty_map_obj);
empty_map_obj = bt_value_map_create();
ret = bt_value_map_insert_entry(map_obj, key,
(void *) empty_map_obj);
GHashTableIter iter;
struct bt_value_map *typed_map_obj = BT_VALUE_TO_MAP(map_obj);
GHashTableIter iter;
struct bt_value_map *typed_map_obj = BT_VALUE_TO_MAP(map_obj);
+ BT_ASSERT_PRE_NO_ERROR();
+
BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
BT_ASSERT_PRE_DEV_NON_NULL(func, "Callback");
BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
BT_ASSERT_PRE_DEV_NON_NULL(map_obj, "Value object");
BT_ASSERT_PRE_DEV_NON_NULL(func, "Callback");
BT_ASSERT_PRE_DEV_VALUE_IS_TYPE(map_obj, BT_VALUE_TYPE_MAP);
const struct bt_value *map_obj,
bt_value_map_foreach_entry_const_func func, void *data)
{
const struct bt_value *map_obj,
bt_value_map_foreach_entry_const_func func, void *data)
{
+ BT_ASSERT_PRE_NO_ERROR();
+
return (int) bt_value_map_foreach_entry((void *) map_obj,
(bt_value_map_foreach_entry_func) func, data);
}
return (int) bt_value_map_foreach_entry((void *) map_obj,
(bt_value_map_foreach_entry_func) func, data);
}
.status = BT_FUNC_STATUS_OK,
};
.status = BT_FUNC_STATUS_OK,
};
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(base_map_obj, "Base value object");
BT_ASSERT_PRE_DEV_VALUE_HOT(base_map_obj, "Base value object");
BT_ASSERT_PRE_NON_NULL(extension_obj, "Extension value object");
BT_ASSERT_PRE_NON_NULL(base_map_obj, "Base value object");
BT_ASSERT_PRE_DEV_VALUE_HOT(base_map_obj, "Base value object");
BT_ASSERT_PRE_NON_NULL(extension_obj, "Extension value object");
{
enum bt_value_copy_status status = BT_FUNC_STATUS_OK;
{
enum bt_value_copy_status status = BT_FUNC_STATUS_OK;
+ BT_ASSERT_PRE_NO_ERROR();
BT_ASSERT_PRE_NON_NULL(object, "Value object");
BT_ASSERT_PRE_NON_NULL(copy_obj, "Value object copy (output)");
BT_LOGD("Copying value object: addr=%p", object);
BT_ASSERT_PRE_NON_NULL(object, "Value object");
BT_ASSERT_PRE_NON_NULL(copy_obj, "Value object copy (output)");
BT_LOGD("Copying value object: addr=%p", object);