X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Flocks.h;h=76533f636ecb48a6a3a88fc5817b4648243bad43;hb=6fb372b18909cedbd8b7018caa9ed863928aff55;hp=80e0569ade6564417d58fc416bc781ab8e87d0d1;hpb=68c6d537788b9c11670903bce2e9806933a3322a;p=netdata.git diff --git a/src/locks.h b/src/locks.h index 80e0569a..76533f63 100644 --- a/src/locks.h +++ b/src/locks.h @@ -41,12 +41,12 @@ static inline int netdata_mutex_init_debug( const char *file, const char *functi if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_init() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_init(0x%p) from %lu@%s, %s()", mutex, line, file, function); } int ret = __netdata_mutex_init(mutex); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_init() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_init(0x%p) = %d in %llu usec, from %lu@%s, %s()", mutex, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -56,12 +56,12 @@ static inline int netdata_mutex_lock_debug( const char *file, const char *functi if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_lock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_lock(0x%p) from %lu@%s, %s()", mutex, line, file, function); } int ret = __netdata_mutex_lock(mutex); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_lock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_lock(0x%p) = %d in %llu usec, from %lu@%s, %s()", mutex, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -71,12 +71,12 @@ static inline int netdata_mutex_trylock_debug( const char *file, const char *fun if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_trylock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_trylock(0x%p) from %lu@%s, %s()", mutex, line, file, function); } int ret = __netdata_mutex_trylock(mutex); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_trylock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_trylock(0x%p) = %d in %llu usec, from %lu@%s, %s()", mutex, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -86,12 +86,12 @@ static inline int netdata_mutex_unlock_debug( const char *file, const char *func if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_unlock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_unlock(0x%p) from %lu@%s, %s()", mutex, line, file, function); } int ret = __netdata_mutex_unlock(mutex); - debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_unlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_unlock(0x%p) = %d in %llu usec, from %lu@%s, %s()", mutex, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -171,12 +171,12 @@ static inline int netdata_rwlock_destroy_debug( const char *file, const char *fu if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_destroy() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_destroy(0x%p) from %lu@%s, %s()", rwlock, line, file, function); } int ret = __netdata_rwlock_destroy(rwlock); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_destroy() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_destroy(0x%p) = %d in %llu usec, from %lu@%s, %s()", rwlock, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -186,12 +186,12 @@ static inline int netdata_rwlock_init_debug( const char *file, const char *funct if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_init() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_init(0x%p) from %lu@%s, %s()", rwlock, line, file, function); } int ret = __netdata_rwlock_init(rwlock); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_init() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_init(0x%p) = %d in %llu usec, from %lu@%s, %s()", rwlock, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -201,12 +201,12 @@ static inline int netdata_rwlock_rdlock_debug( const char *file, const char *fun if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_rdlock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_rdlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function); } int ret = __netdata_rwlock_rdlock(rwlock); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_rdlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_rdlock(0x%p) = %d in %llu usec, from %lu@%s, %s()", rwlock, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -216,12 +216,12 @@ static inline int netdata_rwlock_wrlock_debug( const char *file, const char *fun if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_wrlock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_wrlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function); } int ret = __netdata_rwlock_wrlock(rwlock); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_wrlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_wrlock(0x%p) = %d in %llu usec, from %lu@%s, %s()", rwlock, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -231,12 +231,12 @@ static inline int netdata_rwlock_unlock_debug( const char *file, const char *fun if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_unlock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_unlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function); } int ret = __netdata_rwlock_unlock(rwlock); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_unlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_unlock(0x%p) = %d in %llu usec, from %lu@%s, %s()", rwlock, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -246,12 +246,12 @@ static inline int netdata_rwlock_tryrdlock_debug( const char *file, const char * if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_tryrdlock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_tryrdlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function); } int ret = __netdata_rwlock_tryrdlock(rwlock); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_tryrdlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_tryrdlock(0x%p) = %d in %llu usec, from %lu@%s, %s()", rwlock, ret, now_boottime_usec() - start, line, file, function); return ret; } @@ -261,12 +261,12 @@ static inline int netdata_rwlock_trywrlock_debug( const char *file, const char * if(unlikely(debug_flags & D_LOCKS)) { start = now_boottime_usec(); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_trywrlock() from %lu@%s, %s()", line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_trywrlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function); } int ret = __netdata_rwlock_trywrlock(rwlock); - debug(D_LOCKS, "RW_LOCK: netdata_rwlock_trywrlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function); + debug(D_LOCKS, "RW_LOCK: netdata_rwlock_trywrlock(0x%p) = %d in %llu usec, from %lu@%s, %s()", rwlock, ret, now_boottime_usec() - start, line, file, function); return ret; }