diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-01-20 12:01:46 +0200 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-01-24 11:48:06 +0100 |
commit | 783da99f3668b165bd11929bc0c7aebbe7bcf752 (patch) | |
tree | c23f84d94702967bba6268e44cce8915887aaea7 /src/ipconfig.c | |
parent | 79a38d9428030028696abe2ed8c30e3f6b7c4504 (diff) | |
download | connman-783da99f3668b165bd11929bc0c7aebbe7bcf752.tar.gz connman-783da99f3668b165bd11929bc0c7aebbe7bcf752.tar.bz2 connman-783da99f3668b165bd11929bc0c7aebbe7bcf752.zip |
ipconfig: Add caller information to ref/unref debug prints.
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r-- | src/ipconfig.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c index 75cb56e5..34a8ddcb 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -1297,9 +1297,12 @@ struct connman_ipconfig *__connman_ipconfig_create(int index, * * Increase reference counter of ipconfig */ -struct connman_ipconfig *__connman_ipconfig_ref(struct connman_ipconfig *ipconfig) +struct connman_ipconfig * +__connman_ipconfig_ref_debug(struct connman_ipconfig *ipconfig, + const char *file, int line, const char *caller) { - DBG("ipconfig %p refcount %d", ipconfig, ipconfig->refcount + 1); + DBG("%p ref %d by %s:%d:%s()", ipconfig, ipconfig->refcount + 1, + file, line, caller); __sync_fetch_and_add(&ipconfig->refcount, 1); @@ -1312,12 +1315,14 @@ struct connman_ipconfig *__connman_ipconfig_ref(struct connman_ipconfig *ipconfi * * Decrease reference counter of ipconfig */ -void __connman_ipconfig_unref(struct connman_ipconfig *ipconfig) +void __connman_ipconfig_unref_debug(struct connman_ipconfig *ipconfig, + const char *file, int line, const char *caller) { if (ipconfig == NULL) return; - DBG("ipconfig %p refcount %d", ipconfig, ipconfig->refcount - 1); + DBG("%p ref %d by %s:%d:%s()", ipconfig, ipconfig->refcount - 1, + file, line, caller); if (__sync_fetch_and_sub(&ipconfig->refcount, 1) != 1) return; |