* SOFTWARE.
*/
-#define BT_LOG_TAG "PLUGIN-TEXT-DETAILS-SINK-OBJ-LIFETIME-MGMT"
-#include "logging.h"
+#include <stdbool.h>
#include <babeltrace2/babeltrace.h>
{
struct details_trace_class_meta *details_tc_meta;
- BT_ASSERT(ctx->details_comp->cfg.with_meta);
- BT_ASSERT(ctx->details_comp->meta);
+ BT_ASSERT_DBG(ctx->details_comp->cfg.with_meta);
+ BT_ASSERT_DBG(ctx->details_comp->meta);
details_tc_meta = g_hash_table_lookup(ctx->details_comp->meta, tc);
if (!details_tc_meta) {
/* Not found: create one */
goto end;
}
- BT_ASSERT(ctx->details_comp->meta);
+ BT_ASSERT_DBG(ctx->details_comp->meta);
details_tc_meta = g_hash_table_lookup(ctx->details_comp->meta, tc);
- BT_ASSERT(details_tc_meta);
+ BT_ASSERT_DBG(details_tc_meta);
need_to_write =
- g_hash_table_lookup(details_tc_meta->objects, obj) == NULL;
+ !g_hash_table_lookup(details_tc_meta->objects, obj);
end:
return need_to_write;
goto end;
}
- BT_ASSERT(ctx->details_comp->meta);
+ BT_ASSERT_DBG(ctx->details_comp->meta);
details_tc_meta = g_hash_table_lookup(ctx->details_comp->meta, tc);
- need_to_write = details_tc_meta == NULL;
+ need_to_write = !details_tc_meta;
end:
return need_to_write;
int ret = 0;
struct details_trace *details_trace = NULL;
- BT_ASSERT(unique_id);
- BT_ASSERT(ctx->details_comp->traces);
+ BT_ASSERT_DBG(unique_id);
+ BT_ASSERT_DBG(ctx->details_comp->traces);
if (!bt_g_hash_table_contains(ctx->details_comp->traces,
trace)) {
/* Not found: create one */
ret = -1;
end:
- if (details_trace) {
- g_free(details_trace);
- }
+ g_free(details_trace);
return ret;
}