From 5fd7576bab8aceb12b303bdaffb5e171545510f5 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 13 Jun 2017 20:09:47 -0400 Subject: [PATCH] plugins/ctf/common/metadata/objstack.c: add logging MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- plugins/ctf/common/metadata/objstack.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/ctf/common/metadata/objstack.c b/plugins/ctf/common/metadata/objstack.c index de676016..0ff64b5b 100644 --- a/plugins/ctf/common/metadata/objstack.c +++ b/plugins/ctf/common/metadata/objstack.c @@ -24,6 +24,9 @@ * SOFTWARE. */ +#define BT_LOG_TAG "PLUGIN-CTF-METADATA-OBJSTACK" +#include "logging.h" + #include #include #include @@ -51,11 +54,14 @@ struct objstack *objstack_create(void) struct objstack_node *node; objstack = calloc(1, sizeof(*objstack)); - if (!objstack) + if (!objstack) { + BT_LOGE_STR("Failed to allocate one object stack."); return NULL; + } node = calloc(sizeof(struct objstack_node) + OBJSTACK_INIT_LEN, sizeof(char)); if (!node) { + BT_LOGE_STR("Failed to allocate one object stack node."); free(objstack); return NULL; } @@ -107,6 +113,7 @@ struct objstack_node *objstack_append_node(struct objstack *objstack) new_node = calloc(sizeof(struct objstack_node) + (last_node->len << 1), sizeof(char)); if (!new_node) { + BT_LOGE_STR("Failed to allocate one object stack node."); return NULL; } bt_list_add_tail(&new_node->node, &objstack->head); -- 2.34.1