struct connman_ipconfig *__connman_ipconfig_create(int index,
enum connman_ipconfig_type type);
-struct connman_ipconfig *__connman_ipconfig_ref(struct connman_ipconfig *ipconfig);
-void __connman_ipconfig_unref(struct connman_ipconfig *ipconfig);
+
+#define __connman_ipconfig_ref(ipconfig) \
+ __connman_ipconfig_ref_debug(ipconfig, __FILE__, __LINE__, __func__)
+#define __connman_ipconfig_unref(ipconfig) \
+ __connman_ipconfig_unref_debug(ipconfig, __FILE__, __LINE__, __func__)
+
+struct connman_ipconfig *
+__connman_ipconfig_ref_debug(struct connman_ipconfig *ipconfig,
+ const char *file, int line, const char *caller);
+void __connman_ipconfig_unref_debug(struct connman_ipconfig *ipconfig,
+ const char *file, int line, const char *caller);
void *__connman_ipconfig_get_data(struct connman_ipconfig *ipconfig);
void __connman_ipconfig_set_data(struct connman_ipconfig *ipconfig, void *data);
*
* 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);
*
* 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;