]>
Commit | Line | Data |
---|---|---|
b4e1fa2c AM |
1 | # name : innodb_show_lock_name.patch |
2 | # introduced : 11 or before | |
3 | # maintainer : Yasufumi | |
4 | # | |
5 | #!!! notice !!! | |
6 | # Any small change to this file in the main branch | |
7 | # should be done or reviewed by the maintainer! | |
db82db79 AM |
8 | --- a/storage/innobase/handler/ha_innodb.cc |
9 | +++ b/storage/innobase/handler/ha_innodb.cc | |
29ffd636 | 10 | @@ -9709,9 +9709,8 @@ |
b4e1fa2c AM |
11 | rw_lock_wait_time += mutex->lspent_time; |
12 | } | |
13 | #else /* UNIV_DEBUG */ | |
14 | - buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu", | |
adf0fb13 AM |
15 | - innobase_basename(mutex->cfile_name), |
16 | - (ulong) mutex->cline); | |
b4e1fa2c AM |
17 | + buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s", |
18 | + mutex->cmutex_name); | |
19 | buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu", | |
20 | (ulong) mutex->count_os_wait); | |
21 | ||
29ffd636 | 22 | @@ -9726,10 +9725,8 @@ |
b4e1fa2c AM |
23 | |
24 | if (block_mutex) { | |
25 | buf1len = (uint) my_snprintf(buf1, sizeof buf1, | |
26 | - "combined %s:%lu", | |
adf0fb13 AM |
27 | - innobase_basename( |
28 | - block_mutex->cfile_name), | |
b4e1fa2c AM |
29 | - (ulong) block_mutex->cline); |
30 | + "combined %s", | |
31 | + block_mutex->cmutex_name); | |
32 | buf2len = (uint) my_snprintf(buf2, sizeof buf2, | |
33 | "os_waits=%lu", | |
34 | (ulong) block_mutex_oswait_count); | |
29ffd636 | 35 | @@ -9758,9 +9755,8 @@ |
b4e1fa2c AM |
36 | continue; |
37 | } | |
38 | ||
39 | - buf1len = my_snprintf(buf1, sizeof buf1, "%s:%lu", | |
adf0fb13 AM |
40 | - innobase_basename(lock->cfile_name), |
41 | - (ulong) lock->cline); | |
b4e1fa2c AM |
42 | + buf1len = my_snprintf(buf1, sizeof buf1, "%s", |
43 | + lock->lock_name); | |
44 | buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu", | |
45 | (ulong) lock->count_os_wait); | |
46 | ||
29ffd636 | 47 | @@ -9774,10 +9770,8 @@ |
b4e1fa2c AM |
48 | |
49 | if (block_lock) { | |
50 | buf1len = (uint) my_snprintf(buf1, sizeof buf1, | |
51 | - "combined %s:%lu", | |
adf0fb13 AM |
52 | - innobase_basename( |
53 | - block_lock->cfile_name), | |
b4e1fa2c AM |
54 | - (ulong) block_lock->cline); |
55 | + "combined %s", | |
56 | + block_lock->lock_name); | |
57 | buf2len = (uint) my_snprintf(buf2, sizeof buf2, | |
58 | "os_waits=%lu", | |
59 | (ulong) block_lock_oswait_count); | |
db82db79 AM |
60 | --- a/storage/innobase/include/sync0rw.h |
61 | +++ b/storage/innobase/include/sync0rw.h | |
d8778560 AM |
62 | @@ -138,14 +138,14 @@ |
63 | # ifdef UNIV_DEBUG | |
64 | # ifdef UNIV_SYNC_DEBUG | |
65 | # define rw_lock_create(K, L, level) \ | |
66 | - rw_lock_create_func((L), (level), #L, __FILE__, __LINE__) | |
67 | + rw_lock_create_func((L), (level), __FILE__, __LINE__, #L) | |
68 | # else /* UNIV_SYNC_DEBUG */ | |
69 | # define rw_lock_create(K, L, level) \ | |
70 | - rw_lock_create_func((L), #L, __FILE__, __LINE__) | |
71 | + rw_lock_create_func((L), __FILE__, __LINE__, #L) | |
b4e1fa2c AM |
72 | # endif/* UNIV_SYNC_DEBUG */ |
73 | # else /* UNIV_DEBUG */ | |
74 | # define rw_lock_create(K, L, level) \ | |
75 | - rw_lock_create_func((L), __FILE__, __LINE__) | |
d8778560 | 76 | + rw_lock_create_func((L), #L) |
b4e1fa2c AM |
77 | # endif /* UNIV_DEBUG */ |
78 | ||
79 | /**************************************************************//** | |
d8778560 AM |
80 | @@ -191,14 +191,14 @@ |
81 | # ifdef UNIV_DEBUG | |
82 | # ifdef UNIV_SYNC_DEBUG | |
83 | # define rw_lock_create(K, L, level) \ | |
84 | - pfs_rw_lock_create_func((K), (L), (level), #L, __FILE__, __LINE__) | |
85 | + pfs_rw_lock_create_func((K), (L), (level), __FILE__, __LINE__, #L) | |
86 | # else /* UNIV_SYNC_DEBUG */ | |
87 | # define rw_lock_create(K, L, level) \ | |
88 | - pfs_rw_lock_create_func((K), (L), #L, __FILE__, __LINE__) | |
89 | + pfs_rw_lock_create_func((K), (L), __FILE__, __LINE__, #L) | |
b4e1fa2c AM |
90 | # endif/* UNIV_SYNC_DEBUG */ |
91 | # else /* UNIV_DEBUG */ | |
92 | # define rw_lock_create(K, L, level) \ | |
93 | - pfs_rw_lock_create_func((K), (L), __FILE__, __LINE__) | |
d8778560 | 94 | + pfs_rw_lock_create_func((K), (L), #L) |
b4e1fa2c AM |
95 | # endif /* UNIV_DEBUG */ |
96 | ||
97 | /****************************************************************** | |
d8778560 | 98 | @@ -256,10 +256,10 @@ |
b4e1fa2c AM |
99 | # ifdef UNIV_SYNC_DEBUG |
100 | ulint level, /*!< in: level */ | |
101 | # endif /* UNIV_SYNC_DEBUG */ | |
102 | - const char* cmutex_name, /*!< in: mutex name */ | |
d8778560 | 103 | -#endif /* UNIV_DEBUG */ |
b4e1fa2c | 104 | const char* cfile_name, /*!< in: file name where created */ |
d8778560 AM |
105 | - ulint cline); /*!< in: file line where created */ |
106 | + ulint cline, /*!< in: file line where created */ | |
107 | +#endif /* UNIV_DEBUG */ | |
108 | + const char* cmutex_name); /*!< in: mutex name */ | |
b4e1fa2c | 109 | /******************************************************************//** |
d8778560 AM |
110 | Calling this function is obligatory only if the memory buffer containing |
111 | the rw-lock is freed. Removes an rw-lock object from the global list. The | |
df1b5770 | 112 | @@ -611,7 +611,8 @@ |
b4e1fa2c AM |
113 | struct PSI_rwlock *pfs_psi;/*!< The instrumentation hook */ |
114 | #endif | |
115 | ulint count_os_wait; /*!< Count of os_waits. May not be accurate */ | |
116 | - const char* cfile_name;/*!< File name where lock created */ | |
117 | + //const char* cfile_name;/*!< File name where lock created */ | |
118 | + const char* lock_name;/*!< lock name */ | |
119 | /* last s-lock file/line is not guaranteed to be correct */ | |
120 | const char* last_s_file_name;/*!< File name where last s-locked */ | |
121 | const char* last_x_file_name;/*!< File name where last x-locked */ | |
df1b5770 | 122 | @@ -622,7 +623,7 @@ |
b4e1fa2c AM |
123 | are at the start of this struct, thus we can |
124 | peek this field without causing much memory | |
125 | bus traffic */ | |
126 | - unsigned cline:14; /*!< Line where created */ | |
127 | + //unsigned cline:14; /*!< Line where created */ | |
128 | unsigned last_s_line:14; /*!< Line number where last time s-locked */ | |
129 | unsigned last_x_line:14; /*!< Line number where last time x-locked */ | |
130 | #ifdef UNIV_DEBUG | |
13ceb006 | 131 | @@ -693,10 +694,10 @@ |
b4e1fa2c AM |
132 | # ifdef UNIV_SYNC_DEBUG |
133 | ulint level, /*!< in: level */ | |
134 | # endif /* UNIV_SYNC_DEBUG */ | |
135 | - const char* cmutex_name, /*!< in: mutex name */ | |
d8778560 | 136 | -#endif /* UNIV_DEBUG */ |
b4e1fa2c | 137 | const char* cfile_name, /*!< in: file name where created */ |
d8778560 AM |
138 | - ulint cline); /*!< in: file line where created */ |
139 | + ulint cline, /*!< in: file line where created */ | |
140 | +#endif /* UNIV_DEBUG */ | |
141 | + const char* cmutex_name); /*!< in: mutex name */ | |
b4e1fa2c | 142 | |
d8778560 AM |
143 | /******************************************************************//** |
144 | Performance schema instrumented wrap function for rw_lock_x_lock_func() | |
db82db79 AM |
145 | --- a/storage/innobase/include/sync0rw.ic |
146 | +++ b/storage/innobase/include/sync0rw.ic | |
13ceb006 | 147 | @@ -641,10 +641,10 @@ |
b4e1fa2c AM |
148 | # ifdef UNIV_SYNC_DEBUG |
149 | ulint level, /*!< in: level */ | |
150 | # endif /* UNIV_SYNC_DEBUG */ | |
151 | - const char* cmutex_name, /*!< in: mutex name */ | |
d8778560 | 152 | -# endif /* UNIV_DEBUG */ |
b4e1fa2c | 153 | const char* cfile_name, /*!< in: file name where created */ |
d8778560 AM |
154 | - ulint cline) /*!< in: file line where created */ |
155 | + ulint cline, /*!< in: file line where created */ | |
156 | +# endif /* UNIV_DEBUG */ | |
157 | + const char* cmutex_name) /*!< in: mutex name */ | |
b4e1fa2c | 158 | { |
d8778560 AM |
159 | /* Initialize the rwlock for performance schema */ |
160 | lock->pfs_psi = (PSI_server && PFS_IS_INSTRUMENTED(key)) | |
13ceb006 | 161 | @@ -657,10 +657,10 @@ |
b4e1fa2c AM |
162 | # ifdef UNIV_SYNC_DEBUG |
163 | level, | |
164 | # endif /* UNIV_SYNC_DEBUG */ | |
165 | - cmutex_name, | |
d8778560 | 166 | -# endif /* UNIV_DEBUG */ |
b4e1fa2c | 167 | cfile_name, |
d8778560 AM |
168 | - cline); |
169 | + cline, | |
170 | +# endif /* UNIV_DEBUG */ | |
171 | + cmutex_name); | |
b4e1fa2c | 172 | } |
d8778560 AM |
173 | /******************************************************************//** |
174 | Performance schema instrumented wrap function for rw_lock_x_lock_func() | |
db82db79 AM |
175 | --- a/storage/innobase/include/sync0sync.h |
176 | +++ b/storage/innobase/include/sync0sync.h | |
adf0fb13 | 177 | @@ -158,14 +158,14 @@ |
d8778560 AM |
178 | # ifdef UNIV_DEBUG |
179 | # ifdef UNIV_SYNC_DEBUG | |
180 | # define mutex_create(K, M, level) \ | |
181 | - pfs_mutex_create_func((K), (M), #M, (level), __FILE__, __LINE__) | |
182 | + pfs_mutex_create_func((K), (M), (level), __FILE__, __LINE__, #M) | |
183 | # else | |
184 | # define mutex_create(K, M, level) \ | |
185 | - pfs_mutex_create_func((K), (M), #M, __FILE__, __LINE__) | |
186 | + pfs_mutex_create_func((K), (M), __FILE__, __LINE__, #M) | |
b4e1fa2c AM |
187 | # endif/* UNIV_SYNC_DEBUG */ |
188 | # else | |
189 | # define mutex_create(K, M, level) \ | |
190 | - pfs_mutex_create_func((K), (M), __FILE__, __LINE__) | |
d8778560 | 191 | + pfs_mutex_create_func((K), (M), #M) |
b4e1fa2c AM |
192 | # endif /* UNIV_DEBUG */ |
193 | ||
194 | # define mutex_enter(M) \ | |
adf0fb13 | 195 | @@ -185,14 +185,14 @@ |
d8778560 AM |
196 | # ifdef UNIV_DEBUG |
197 | # ifdef UNIV_SYNC_DEBUG | |
198 | # define mutex_create(K, M, level) \ | |
199 | - mutex_create_func((M), #M, (level), __FILE__, __LINE__) | |
200 | + mutex_create_func((M), (level), __FILE__, __LINE__, #M) | |
201 | # else /* UNIV_SYNC_DEBUG */ | |
202 | # define mutex_create(K, M, level) \ | |
203 | - mutex_create_func((M), #M, __FILE__, __LINE__) | |
204 | + mutex_create_func((M), __FILE__, __LINE__, #M) | |
b4e1fa2c AM |
205 | # endif /* UNIV_SYNC_DEBUG */ |
206 | # else /* UNIV_DEBUG */ | |
207 | # define mutex_create(K, M, level) \ | |
208 | - mutex_create_func((M), __FILE__, __LINE__) | |
d8778560 | 209 | + mutex_create_func((M), #M) |
b4e1fa2c AM |
210 | # endif /* UNIV_DEBUG */ |
211 | ||
212 | # define mutex_enter(M) mutex_enter_func((M), __FILE__, __LINE__) | |
adf0fb13 | 213 | @@ -217,13 +217,13 @@ |
b4e1fa2c AM |
214 | /*==============*/ |
215 | mutex_t* mutex, /*!< in: pointer to memory */ | |
d8778560 AM |
216 | #ifdef UNIV_DEBUG |
217 | - const char* cmutex_name, /*!< in: mutex name */ | |
b4e1fa2c AM |
218 | # ifdef UNIV_SYNC_DEBUG |
219 | ulint level, /*!< in: level */ | |
220 | # endif /* UNIV_SYNC_DEBUG */ | |
d8778560 AM |
221 | -#endif /* UNIV_DEBUG */ |
222 | const char* cfile_name, /*!< in: file name where created */ | |
223 | - ulint cline); /*!< in: file line where created */ | |
224 | + ulint cline, /*!< in: file line where created */ | |
225 | +#endif /* UNIV_DEBUG */ | |
226 | + const char* cmutex_name); /*!< in: mutex name */ | |
227 | ||
228 | /******************************************************************//** | |
229 | NOTE! Use the corresponding macro mutex_free(), not directly this function! | |
adf0fb13 | 230 | @@ -291,13 +291,13 @@ |
b4e1fa2c AM |
231 | PSI_mutex_key key, /*!< in: Performance Schema key */ |
232 | mutex_t* mutex, /*!< in: pointer to memory */ | |
d8778560 AM |
233 | # ifdef UNIV_DEBUG |
234 | - const char* cmutex_name, /*!< in: mutex name */ | |
b4e1fa2c AM |
235 | # ifdef UNIV_SYNC_DEBUG |
236 | ulint level, /*!< in: level */ | |
237 | # endif /* UNIV_SYNC_DEBUG */ | |
d8778560 AM |
238 | -# endif /* UNIV_DEBUG */ |
239 | const char* cfile_name, /*!< in: file name where created */ | |
240 | - ulint cline); /*!< in: file line where created */ | |
241 | + ulint cline, /*!< in: file line where created */ | |
242 | +# endif /* UNIV_DEBUG */ | |
243 | + const char* cmutex_name); | |
244 | /******************************************************************//** | |
245 | NOTE! Please use the corresponding macro mutex_enter(), not directly | |
246 | this function! | |
13ceb006 | 247 | @@ -728,9 +728,9 @@ |
b4e1fa2c AM |
248 | ulint line; /*!< Line where the mutex was locked */ |
249 | ulint level; /*!< Level in the global latching order */ | |
250 | #endif /* UNIV_SYNC_DEBUG */ | |
251 | +#ifdef UNIV_DEBUG | |
252 | const char* cfile_name;/*!< File name where mutex created */ | |
253 | ulint cline; /*!< Line where created */ | |
254 | -#ifdef UNIV_DEBUG | |
255 | os_thread_id_t thread_id; /*!< The thread id of the thread | |
256 | which locked the mutex. */ | |
257 | ulint magic_n; /*!< MUTEX_MAGIC_N */ | |
13ceb006 | 258 | @@ -745,9 +745,9 @@ |
b4e1fa2c AM |
259 | ulong count_os_yield; /*!< count of os_wait */ |
260 | ulonglong lspent_time; /*!< mutex os_wait timer msec */ | |
261 | ulonglong lmax_spent_time;/*!< mutex os_wait timer msec */ | |
262 | - const char* cmutex_name; /*!< mutex name */ | |
263 | ulint mutex_type; /*!< 0=usual mutex, 1=rw_lock mutex */ | |
264 | #endif /* UNIV_DEBUG */ | |
265 | + const char* cmutex_name; /*!< mutex name */ | |
266 | #ifdef UNIV_PFS_MUTEX | |
267 | struct PSI_mutex* pfs_psi; /*!< The performance schema | |
268 | instrumentation hook */ | |
db82db79 AM |
269 | --- a/storage/innobase/include/sync0sync.ic |
270 | +++ b/storage/innobase/include/sync0sync.ic | |
734d6226 | 271 | @@ -320,13 +320,13 @@ |
b4e1fa2c AM |
272 | mysql_pfs_key_t key, /*!< in: Performance Schema key */ |
273 | mutex_t* mutex, /*!< in: pointer to memory */ | |
d8778560 AM |
274 | # ifdef UNIV_DEBUG |
275 | - const char* cmutex_name, /*!< in: mutex name */ | |
b4e1fa2c AM |
276 | # ifdef UNIV_SYNC_DEBUG |
277 | ulint level, /*!< in: level */ | |
278 | # endif /* UNIV_SYNC_DEBUG */ | |
d8778560 AM |
279 | -# endif /* UNIV_DEBUG */ |
280 | const char* cfile_name, /*!< in: file name where created */ | |
281 | - ulint cline) /*!< in: file line where created */ | |
282 | + ulint cline, /*!< in: file line where created */ | |
283 | +# endif /* UNIV_DEBUG */ | |
284 | + const char* cmutex_name) /*!< in: mutex name */ | |
285 | { | |
286 | mutex->pfs_psi = (PSI_server && PFS_IS_INSTRUMENTED(key)) | |
287 | ? PSI_server->init_mutex(key, mutex) | |
734d6226 | 288 | @@ -334,13 +334,13 @@ |
b4e1fa2c AM |
289 | |
290 | mutex_create_func(mutex, | |
d8778560 AM |
291 | # ifdef UNIV_DEBUG |
292 | - cmutex_name, | |
b4e1fa2c AM |
293 | # ifdef UNIV_SYNC_DEBUG |
294 | level, | |
295 | # endif /* UNIV_SYNC_DEBUG */ | |
d8778560 AM |
296 | -# endif /* UNIV_DEBUG */ |
297 | cfile_name, | |
298 | - cline); | |
299 | + cline, | |
300 | +# endif /* UNIV_DEBUG */ | |
301 | + cmutex_name); | |
302 | } | |
303 | /******************************************************************//** | |
304 | NOTE! Please use the corresponding macro mutex_free(), not directly | |
db82db79 AM |
305 | --- a/storage/innobase/sync/sync0arr.c |
306 | +++ b/storage/innobase/sync/sync0arr.c | |
adf0fb13 | 307 | @@ -489,13 +489,12 @@ |
b4e1fa2c AM |
308 | mutex = cell->old_wait_mutex; |
309 | ||
310 | fprintf(file, | |
311 | - "Mutex at %p created file %s line %lu, lock var %lu\n" | |
312 | + "Mutex at %p '%s', lock var %lu\n" | |
313 | #ifdef UNIV_SYNC_DEBUG | |
314 | "Last time reserved in file %s line %lu, " | |
315 | #endif /* UNIV_SYNC_DEBUG */ | |
316 | "waiters flag %lu\n", | |
adf0fb13 AM |
317 | - (void*) mutex, innobase_basename(mutex->cfile_name), |
318 | - (ulong) mutex->cline, | |
b4e1fa2c AM |
319 | + (void*) mutex, mutex->cmutex_name, |
320 | (ulong) mutex->lock_word, | |
321 | #ifdef UNIV_SYNC_DEBUG | |
322 | mutex->file_name, (ulong) mutex->line, | |
adf0fb13 | 323 | @@ -513,9 +512,8 @@ |
b4e1fa2c AM |
324 | rwlock = cell->old_wait_rw_lock; |
325 | ||
326 | fprintf(file, | |
327 | - " RW-latch at %p created in file %s line %lu\n", | |
adf0fb13 | 328 | - (void*) rwlock, innobase_basename(rwlock->cfile_name), |
b4e1fa2c AM |
329 | - (ulong) rwlock->cline); |
330 | + " RW-latch at %p '%s'\n", | |
331 | + (void*) rwlock, rwlock->lock_name); | |
332 | writer = rw_lock_get_writer(rwlock); | |
333 | if (writer != RW_LOCK_NOT_LOCKED) { | |
334 | fprintf(file, | |
db82db79 AM |
335 | --- a/storage/innobase/sync/sync0rw.c |
336 | +++ b/storage/innobase/sync/sync0rw.c | |
adf0fb13 | 337 | @@ -242,10 +242,10 @@ |
b4e1fa2c AM |
338 | # ifdef UNIV_SYNC_DEBUG |
339 | ulint level, /*!< in: level */ | |
340 | # endif /* UNIV_SYNC_DEBUG */ | |
341 | - const char* cmutex_name, /*!< in: mutex name */ | |
d8778560 | 342 | -#endif /* UNIV_DEBUG */ |
b4e1fa2c | 343 | const char* cfile_name, /*!< in: file name where created */ |
d8778560 AM |
344 | - ulint cline) /*!< in: file line where created */ |
345 | + ulint cline, /*!< in: file line where created */ | |
346 | +#endif /* UNIV_DEBUG */ | |
347 | + const char* cmutex_name) /*!< in: mutex name */ | |
b4e1fa2c | 348 | { |
d8778560 AM |
349 | /* If this is the very first time a synchronization object is |
350 | created, then the following call initializes the sync system. */ | |
adf0fb13 | 351 | @@ -254,14 +254,15 @@ |
b4e1fa2c AM |
352 | mutex_create(rw_lock_mutex_key, rw_lock_get_mutex(lock), |
353 | SYNC_NO_ORDER_CHECK); | |
354 | ||
355 | - lock->mutex.cfile_name = cfile_name; | |
356 | - lock->mutex.cline = cline; | |
357 | + ut_d(lock->mutex.cfile_name = cfile_name); | |
358 | + ut_d(lock->mutex.cline = cline); | |
359 | ||
360 | - ut_d(lock->mutex.cmutex_name = cmutex_name); | |
361 | + lock->mutex.cmutex_name = cmutex_name; | |
362 | ut_d(lock->mutex.mutex_type = 1); | |
363 | #else /* INNODB_RW_LOCKS_USE_ATOMICS */ | |
364 | # ifdef UNIV_DEBUG | |
365 | - UT_NOT_USED(cmutex_name); | |
366 | + UT_NOT_USED(cfile_name); | |
367 | + UT_NOT_USED(cline); | |
368 | # endif | |
369 | #endif /* INNODB_RW_LOCKS_USE_ATOMICS */ | |
370 | ||
adf0fb13 | 371 | @@ -284,8 +285,7 @@ |
b4e1fa2c AM |
372 | |
373 | ut_d(lock->magic_n = RW_LOCK_MAGIC_N); | |
374 | ||
375 | - lock->cfile_name = cfile_name; | |
376 | - lock->cline = (unsigned int) cline; | |
377 | + lock->lock_name = cmutex_name; | |
378 | ||
379 | lock->count_os_wait = 0; | |
380 | lock->last_s_file_name = "not yet reserved"; | |
adf0fb13 | 381 | @@ -405,11 +405,10 @@ |
b4e1fa2c AM |
382 | if (srv_print_latch_waits) { |
383 | fprintf(stderr, | |
384 | "Thread %lu spin wait rw-s-lock at %p" | |
385 | - " cfile %s cline %lu rnds %lu\n", | |
386 | + " '%s' rnds %lu\n", | |
387 | (ulong) os_thread_pf(os_thread_get_curr_id()), | |
388 | (void*) lock, | |
adf0fb13 AM |
389 | - innobase_basename(lock->cfile_name), |
390 | - (ulong) lock->cline, (ulong) i); | |
b4e1fa2c AM |
391 | + lock->lock_name, (ulong) i); |
392 | } | |
393 | ||
394 | /* We try once again to obtain the lock */ | |
adf0fb13 | 395 | @@ -442,11 +441,9 @@ |
b4e1fa2c AM |
396 | if (srv_print_latch_waits) { |
397 | fprintf(stderr, | |
398 | "Thread %lu OS wait rw-s-lock at %p" | |
399 | - " cfile %s cline %lu\n", | |
400 | + " '%s'\n", | |
401 | os_thread_pf(os_thread_get_curr_id()), | |
adf0fb13 AM |
402 | - (void*) lock, |
403 | - innobase_basename(lock->cfile_name), | |
b4e1fa2c AM |
404 | - (ulong) lock->cline); |
405 | + (void*) lock, lock->lock_name); | |
406 | } | |
407 | ||
408 | /* these stats may not be accurate */ | |
13ceb006 | 409 | @@ -668,10 +665,9 @@ |
b4e1fa2c AM |
410 | if (srv_print_latch_waits) { |
411 | fprintf(stderr, | |
412 | "Thread %lu spin wait rw-x-lock at %p" | |
413 | - " cfile %s cline %lu rnds %lu\n", | |
414 | + " '%s' rnds %lu\n", | |
415 | os_thread_pf(os_thread_get_curr_id()), (void*) lock, | |
adf0fb13 AM |
416 | - innobase_basename(lock->cfile_name), |
417 | - (ulong) lock->cline, (ulong) i); | |
b4e1fa2c AM |
418 | + lock->lock_name, (ulong) i); |
419 | } | |
420 | ||
421 | sync_array_reserve_cell(sync_primary_wait_array, | |
13ceb006 | 422 | @@ -692,10 +688,9 @@ |
b4e1fa2c AM |
423 | if (srv_print_latch_waits) { |
424 | fprintf(stderr, | |
425 | "Thread %lu OS wait for rw-x-lock at %p" | |
426 | - " cfile %s cline %lu\n", | |
427 | + " '%s'\n", | |
428 | os_thread_pf(os_thread_get_curr_id()), (void*) lock, | |
adf0fb13 AM |
429 | - innobase_basename(lock->cfile_name), |
430 | - (ulong) lock->cline); | |
b4e1fa2c AM |
431 | + lock->lock_name); |
432 | } | |
433 | ||
434 | /* these stats may not be accurate */ | |
db82db79 AM |
435 | --- a/storage/innobase/sync/sync0sync.c |
436 | +++ b/storage/innobase/sync/sync0sync.c | |
adf0fb13 | 437 | @@ -270,13 +270,13 @@ |
b4e1fa2c AM |
438 | /*==============*/ |
439 | mutex_t* mutex, /*!< in: pointer to memory */ | |
d8778560 AM |
440 | #ifdef UNIV_DEBUG |
441 | - const char* cmutex_name, /*!< in: mutex name */ | |
b4e1fa2c AM |
442 | # ifdef UNIV_SYNC_DEBUG |
443 | ulint level, /*!< in: level */ | |
444 | # endif /* UNIV_SYNC_DEBUG */ | |
d8778560 AM |
445 | -#endif /* UNIV_DEBUG */ |
446 | const char* cfile_name, /*!< in: file name where created */ | |
447 | - ulint cline) /*!< in: file line where created */ | |
448 | + ulint cline, /*!< in: file line where created */ | |
449 | +#endif /* UNIV_DEBUG */ | |
450 | + const char* cmutex_name) /*!< in: mutex name */ | |
451 | { | |
452 | #if defined(HAVE_ATOMIC_BUILTINS) | |
453 | mutex_reset_lock_word(mutex); | |
adf0fb13 | 454 | @@ -294,11 +294,13 @@ |
b4e1fa2c AM |
455 | mutex->file_name = "not yet reserved"; |
456 | mutex->level = level; | |
457 | #endif /* UNIV_SYNC_DEBUG */ | |
458 | +#ifdef UNIV_DEBUG | |
459 | mutex->cfile_name = cfile_name; | |
460 | mutex->cline = cline; | |
461 | +#endif /* UNIV_DEBUG */ | |
462 | mutex->count_os_wait = 0; | |
463 | -#ifdef UNIV_DEBUG | |
464 | mutex->cmutex_name= cmutex_name; | |
465 | +#ifdef UNIV_DEBUG | |
466 | mutex->count_using= 0; | |
467 | mutex->mutex_type= 0; | |
468 | mutex->lspent_time= 0; | |
adf0fb13 | 469 | @@ -552,10 +554,9 @@ |
b4e1fa2c AM |
470 | #ifdef UNIV_SRV_PRINT_LATCH_WAITS |
471 | fprintf(stderr, | |
472 | "Thread %lu spin wait mutex at %p" | |
473 | - " cfile %s cline %lu rnds %lu\n", | |
474 | + " '%s' rnds %lu\n", | |
475 | (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, | |
adf0fb13 AM |
476 | - innobase_basename(mutex->cfile_name), |
477 | - (ulong) mutex->cline, (ulong) i); | |
b4e1fa2c AM |
478 | + mutex->cmutex_name, (ulong) i); |
479 | #endif | |
480 | ||
481 | mutex_spin_round_count += i; | |
adf0fb13 | 482 | @@ -630,10 +631,9 @@ |
b4e1fa2c AM |
483 | |
484 | #ifdef UNIV_SRV_PRINT_LATCH_WAITS | |
485 | fprintf(stderr, | |
486 | - "Thread %lu OS wait mutex at %p cfile %s cline %lu rnds %lu\n", | |
487 | + "Thread %lu OS wait mutex at %p '%s' rnds %lu\n", | |
488 | (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex, | |
adf0fb13 AM |
489 | - innobase_basename(mutex->cfile_name), |
490 | - (ulong) mutex->cline, (ulong) i); | |
b4e1fa2c AM |
491 | + mutex->cmutex_name, (ulong) i); |
492 | #endif | |
493 | ||
494 | mutex_os_wait_count++; | |
adf0fb13 | 495 | @@ -881,9 +881,8 @@ |
b4e1fa2c | 496 | |
df1b5770 AM |
497 | if (mutex->magic_n == MUTEX_MAGIC_N) { |
498 | fprintf(stderr, | |
499 | - "Mutex created at %s %lu\n", | |
adf0fb13 AM |
500 | - innobase_basename(mutex->cfile_name), |
501 | - (ulong) mutex->cline); | |
df1b5770 AM |
502 | + "Mutex '%s'\n", |
503 | + mutex->cmutex_name); | |
b4e1fa2c | 504 | |
df1b5770 AM |
505 | if (mutex_get_lock_word(mutex) != 0) { |
506 | ulint line; |