From 57d2571db198e89b3d92db0ce0448db06ccae822 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Sun, 14 May 2017 02:55:24 -0400 Subject: [PATCH] lib/ref.c: logging: show current count and new count in messages 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 --- lib/ref.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/ref.c b/lib/ref.c index d39a24d0c..3a9cb61c6 100644 --- a/lib/ref.c +++ b/lib/ref.c @@ -43,10 +43,12 @@ void *bt_get(void *ptr) "addr=%p, parent-addr=%p", ptr, obj->parent); bt_get(obj->parent); } + BT_LOGV("Incrementing object's reference count: %lu -> %lu: " + "addr=%p, cur-count=%lu, new-count=%lu", + obj->ref_count.count, obj->ref_count.count + 1, + ptr, + obj->ref_count.count, obj->ref_count.count + 1); bt_ref_get(&obj->ref_count); - BT_LOGV("Incremented object's reference count: %lu -> %lu: " - "addr=%p, new-count=%lu", obj->ref_count.count - 1, - obj->ref_count.count, ptr, obj->ref_count.count); end: return obj; } @@ -60,7 +62,9 @@ void bt_put(void *ptr) } BT_LOGV("Decrementing object's reference count: %lu -> %lu: " - "addr=%p, cur-count=%lu", obj->ref_count.count, - obj->ref_count.count - 1, ptr, obj->ref_count.count); + "addr=%p, cur-count=%lu, new-count=%lu", + obj->ref_count.count, obj->ref_count.count - 1, + ptr, + obj->ref_count.count, obj->ref_count.count - 1); bt_ref_put(&obj->ref_count); } -- 2.34.1