X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fplugins%2Ftext%2Fdetails%2Fobj-lifetime-mgmt.c;h=41a2a31e0c3c02d456cfc8619d88e4f49fe9a527;hb=9669d69306665dc42352cf22b65d76cbf517ee11;hp=fc749046e28e330d897f4d7218974502f42c8db8;hpb=55478183b5a100be028ed476718f0773ec7b4af5;p=babeltrace.git diff --git a/src/plugins/text/details/obj-lifetime-mgmt.c b/src/plugins/text/details/obj-lifetime-mgmt.c index fc749046..41a2a31e 100644 --- a/src/plugins/text/details/obj-lifetime-mgmt.c +++ b/src/plugins/text/details/obj-lifetime-mgmt.c @@ -20,9 +20,6 @@ * SOFTWARE. */ -#define BT_LOG_TAG "PLUGIN-TEXT-DETAILS-SINK-OBJ-LIFETIME-MGMT" -#include "logging.h" - #include #include "common/common.h" @@ -51,8 +48,8 @@ struct details_trace_class_meta *borrow_trace_class_meta( { 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 */ @@ -96,11 +93,11 @@ bool details_need_to_write_meta_object(struct details_write_ctx *ctx, 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; @@ -131,9 +128,9 @@ bool details_need_to_write_trace_class(struct details_write_ctx *ctx, 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; @@ -193,8 +190,8 @@ int details_trace_unique_id(struct details_write_ctx *ctx, 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 */ @@ -235,9 +232,7 @@ error: ret = -1; end: - if (details_trace) { - g_free(details_trace); - } + g_free(details_trace); return ret; }