#include "lib/logging.h"
#include "lib/assert-pre.h"
+#include "lib/assert-post.h"
#include <babeltrace2/trace-ir/trace.h>
#include <babeltrace2/trace-ir/trace-const.h>
#include <babeltrace2/trace-ir/event-class.h>
* The destruction listener should not have kept a
* reference to the trace.
*/
- BT_ASSERT_PRE(trace->base.ref_count == 1, "Destruction listener kept a reference to the trace being destroyed: %![trace-]+t", trace);
+ BT_ASSERT_POST(trace->base.ref_count == 1, "Destruction listener kept a reference to the trace being destroyed: %![trace-]+t", trace);
}
g_array_free(trace->destruction_listeners, TRUE);
trace->destruction_listeners = NULL;
}
trace->class = tc;
- bt_object_get_no_null_check(trace->class);
+ bt_object_get_ref_no_null_check(trace->class);
BT_LIB_LOGD("Created trace object: %!+t", trace);
goto end;
BT_LIB_LOGD("Set trace's UUID: %!+t", trace);
}
-BT_ASSERT_FUNC
static
bool trace_has_environment_entry(const struct bt_trace *trace, const char *name)
{
uint64_t bt_trace_get_environment_entry_count(const struct bt_trace *trace)
{
- int64_t ret;
-
BT_ASSERT_PRE_DEV_NON_NULL(trace, "Trace");
- ret = bt_attributes_get_count(trace->environment);
- BT_ASSERT(ret >= 0);
- return (uint64_t) ret;
+ return bt_attributes_get_count(trace->environment);
}
void bt_trace_borrow_environment_entry_by_index_const(
BT_ASSERT_PRE(user_attributes->type == BT_VALUE_TYPE_MAP,
"User attributes object is not a map value object.");
BT_ASSERT_PRE_DEV_TRACE_HOT(trace);
- bt_object_put_no_null_check(trace->user_attributes);
+ bt_object_put_ref_no_null_check(trace->user_attributes);
trace->user_attributes = (void *) user_attributes;
- bt_object_get_no_null_check(trace->user_attributes);
+ bt_object_get_ref_no_null_check(trace->user_attributes);
}
void bt_trace_get_ref(const struct bt_trace *trace)