print the lock pointer in debug mode
Costa Tsaousis (ktsaou) committed
Mar 12, 2017 at 23:11 UTC
8a77a42998d10e3599728e722f6fb2fbe190627c
1 file changed
+22
-22
src/locks.h
+22
-22
@@ -41,12 +41,12 @@ static inline int netdata_mutex_init_debug( const char *file, const char *functi
41
42
if(unlikely(debug_flags & D_LOCKS)) {
43
start = now_boottime_usec();
44
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_init() from %lu@%s, %s()", line, file, function);
44
+ debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_init(0x%p) from %lu@%s, %s()", mutex, line, file, function);
45
}
46
47
int ret = __netdata_mutex_init(mutex);
48
49
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_init() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
49
+ 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);
50
51
return ret;
52
}
@@ -56,12 +56,12 @@ static inline int netdata_mutex_lock_debug( const char *file, const char *functi
56
57
if(unlikely(debug_flags & D_LOCKS)) {
58
start = now_boottime_usec();
59
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_lock() from %lu@%s, %s()", line, file, function);
59
+ debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_lock(0x%p) from %lu@%s, %s()", mutex, line, file, function);
60
}
61
62
int ret = __netdata_mutex_lock(mutex);
63
64
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_lock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
64
+ 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);
65
66
return ret;
67
}
@@ -71,12 +71,12 @@ static inline int netdata_mutex_trylock_debug( const char *file, const char *fun
71
72
if(unlikely(debug_flags & D_LOCKS)) {
73
start = now_boottime_usec();
74
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_trylock() from %lu@%s, %s()", line, file, function);
74
+ debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_trylock(0x%p) from %lu@%s, %s()", mutex, line, file, function);
75
}
76
77
int ret = __netdata_mutex_trylock(mutex);
78
79
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_trylock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
79
+ 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);
80
81
return ret;
82
}
@@ -86,12 +86,12 @@ static inline int netdata_mutex_unlock_debug( const char *file, const char *func
86
87
if(unlikely(debug_flags & D_LOCKS)) {
88
start = now_boottime_usec();
89
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_unlock() from %lu@%s, %s()", line, file, function);
89
+ debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_unlock(0x%p) from %lu@%s, %s()", mutex, line, file, function);
90
}
91
92
int ret = __netdata_mutex_unlock(mutex);
93
94
- debug(D_LOCKS, "MUTEX_LOCK: netdata_mutex_unlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
94
+ 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);
95
96
return ret;
97
}
@@ -171,12 +171,12 @@ static inline int netdata_rwlock_destroy_debug( const char *file, const char *fu
171
172
if(unlikely(debug_flags & D_LOCKS)) {
173
start = now_boottime_usec();
174
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_destroy() from %lu@%s, %s()", line, file, function);
174
+ debug(D_LOCKS, "RW_LOCK: netdata_rwlock_destroy(0x%p) from %lu@%s, %s()", rwlock, line, file, function);
175
}
176
177
int ret = __netdata_rwlock_destroy(rwlock);
178
179
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_destroy() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
179
+ 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);
180
181
return ret;
182
}
@@ -186,12 +186,12 @@ static inline int netdata_rwlock_init_debug( const char *file, const char *funct
186
187
if(unlikely(debug_flags & D_LOCKS)) {
188
start = now_boottime_usec();
189
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_init() from %lu@%s, %s()", line, file, function);
189
+ debug(D_LOCKS, "RW_LOCK: netdata_rwlock_init(0x%p) from %lu@%s, %s()", rwlock, line, file, function);
190
}
191
192
int ret = __netdata_rwlock_init(rwlock);
193
194
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_init() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
194
+ 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);
195
196
return ret;
197
}
@@ -201,12 +201,12 @@ static inline int netdata_rwlock_rdlock_debug( const char *file, const char *fun
201
202
if(unlikely(debug_flags & D_LOCKS)) {
203
start = now_boottime_usec();
204
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_rdlock() from %lu@%s, %s()", line, file, function);
204
+ debug(D_LOCKS, "RW_LOCK: netdata_rwlock_rdlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function);
205
}
206
207
int ret = __netdata_rwlock_rdlock(rwlock);
208
209
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_rdlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
209
+ 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);
210
211
return ret;
212
}
@@ -216,12 +216,12 @@ static inline int netdata_rwlock_wrlock_debug( const char *file, const char *fun
216
217
if(unlikely(debug_flags & D_LOCKS)) {
218
start = now_boottime_usec();
219
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_wrlock() from %lu@%s, %s()", line, file, function);
219
+ debug(D_LOCKS, "RW_LOCK: netdata_rwlock_wrlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function);
220
}
221
222
int ret = __netdata_rwlock_wrlock(rwlock);
223
224
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_wrlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
224
+ 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);
225
226
return ret;
227
}
@@ -231,12 +231,12 @@ static inline int netdata_rwlock_unlock_debug( const char *file, const char *fun
231
232
if(unlikely(debug_flags & D_LOCKS)) {
233
start = now_boottime_usec();
234
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_unlock() from %lu@%s, %s()", line, file, function);
234
+ debug(D_LOCKS, "RW_LOCK: netdata_rwlock_unlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function);
235
}
236
237
int ret = __netdata_rwlock_unlock(rwlock);
238
239
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_unlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
239
+ 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);
240
241
return ret;
242
}
@@ -246,12 +246,12 @@ static inline int netdata_rwlock_tryrdlock_debug( const char *file, const char *
246
247
if(unlikely(debug_flags & D_LOCKS)) {
248
start = now_boottime_usec();
249
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_tryrdlock() from %lu@%s, %s()", line, file, function);
249
+ debug(D_LOCKS, "RW_LOCK: netdata_rwlock_tryrdlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function);
250
}
251
252
int ret = __netdata_rwlock_tryrdlock(rwlock);
253
254
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_tryrdlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
254
+ 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);
255
256
return ret;
257
}
@@ -261,12 +261,12 @@ static inline int netdata_rwlock_trywrlock_debug( const char *file, const char *
261
262
if(unlikely(debug_flags & D_LOCKS)) {
263
start = now_boottime_usec();
264
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_trywrlock() from %lu@%s, %s()", line, file, function);
264
+ debug(D_LOCKS, "RW_LOCK: netdata_rwlock_trywrlock(0x%p) from %lu@%s, %s()", rwlock, line, file, function);
265
}
266
267
int ret = __netdata_rwlock_trywrlock(rwlock);
268
269
- debug(D_LOCKS, "RW_LOCK: netdata_rwlock_trywrlock() = %d in %llu usec, from %lu@%s, %s()", ret, now_boottime_usec() - start, line, file, function);
269
+ 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);
270
271
return ret;
272
}