~tsarev/percona-server/5.5-processlist_rows_stats-sporadic_fails-fix

« back to all changes in this revision

Viewing changes to innodb_show_lock_name.patch

  • Committer: kinoyasu
  • Date: 2011-05-10 11:57:42 UTC
  • Revision ID: kinoyasu@gauntlet4-20110510115742-3i3194rn2m8fipm2
port Yasufumi patches to 5.5.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
9
9
--- a/storage/innobase/handler/ha_innodb.cc     2010-12-03 17:34:35.285040381 +0900
10
10
+++ b/storage/innobase/handler/ha_innodb.cc     2010-12-03 17:35:12.974975252 +0900
11
 
@@ -9575,8 +9575,8 @@
 
11
@@ -9588,9 +9588,8 @@
12
12
                        rw_lock_wait_time += mutex->lspent_time;
13
13
                }
14
14
 #else /* UNIV_DEBUG */
15
15
-               buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s:%lu",
16
 
-                                    mutex->cfile_name, (ulong) mutex->cline);
 
16
-                                    innobase_basename(mutex->cfile_name),
 
17
-                                    (ulong) mutex->cline);
17
18
+               buf1len= (uint) my_snprintf(buf1, sizeof(buf1), "%s",
18
19
+                                    mutex->cmutex_name);
19
20
                buf2len= (uint) my_snprintf(buf2, sizeof(buf2), "os_waits=%lu",
20
21
                                     (ulong) mutex->count_os_wait);
21
22
 
22
 
@@ -9591,9 +9591,8 @@
 
23
@@ -9605,10 +9604,8 @@
23
24
 
24
25
        if (block_mutex) {
25
26
                buf1len = (uint) my_snprintf(buf1, sizeof buf1,
26
27
-                                            "combined %s:%lu",
27
 
-                                            block_mutex->cfile_name,
 
28
-                                            innobase_basename(
 
29
-                                               block_mutex->cfile_name),
28
30
-                                            (ulong) block_mutex->cline);
29
31
+                                            "combined %s",
30
32
+                                            block_mutex->cmutex_name);
31
33
                buf2len = (uint) my_snprintf(buf2, sizeof buf2,
32
34
                                             "os_waits=%lu",
33
35
                                             (ulong) block_mutex_oswait_count);
34
 
@@ -9622,8 +9621,8 @@
 
36
@@ -9637,9 +9634,8 @@
35
37
                        continue;
36
38
                }
37
39
 
38
40
-               buf1len = my_snprintf(buf1, sizeof buf1, "%s:%lu",
39
 
-                                    lock->cfile_name, (ulong) lock->cline);
 
41
-                                    innobase_basename(lock->cfile_name),
 
42
-                                    (ulong) lock->cline);
40
43
+               buf1len = my_snprintf(buf1, sizeof buf1, "%s",
41
44
+                                    lock->lock_name);
42
45
                buf2len = my_snprintf(buf2, sizeof buf2, "os_waits=%lu",
43
46
                                      (ulong) lock->count_os_wait);
44
47
 
45
 
@@ -9637,9 +9636,8 @@
 
48
@@ -9653,10 +9649,8 @@
46
49
 
47
50
        if (block_lock) {
48
51
                buf1len = (uint) my_snprintf(buf1, sizeof buf1,
49
52
-                                            "combined %s:%lu",
50
 
-                                            block_lock->cfile_name,
 
53
-                                            innobase_basename(
 
54
-                                               block_lock->cfile_name),
51
55
-                                            (ulong) block_lock->cline);
52
56
+                                            "combined %s",
53
57
+                                            block_lock->lock_name);
174
178
diff -ruN a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h
175
179
--- a/storage/innobase/include/sync0sync.h      2010-12-03 15:49:59.227955503 +0900
176
180
+++ b/storage/innobase/include/sync0sync.h      2010-12-03 17:35:12.982023946 +0900
177
 
@@ -159,14 +159,14 @@
 
181
@@ -158,14 +158,14 @@
178
182
 # ifdef UNIV_DEBUG
179
183
 #  ifdef UNIV_SYNC_DEBUG
180
184
 #   define mutex_create(K, M, level)                           \
192
196
 # endif        /* UNIV_DEBUG */
193
197
 
194
198
 # define mutex_enter(M)                                                \
195
 
@@ -186,14 +186,14 @@
 
199
@@ -185,14 +185,14 @@
196
200
 # ifdef UNIV_DEBUG
197
201
 #  ifdef UNIV_SYNC_DEBUG
198
202
 #   define mutex_create(K, M, level)                   \
210
214
 # endif        /* UNIV_DEBUG */
211
215
 
212
216
 # define mutex_enter(M)        mutex_enter_func((M), __FILE__, __LINE__)
213
 
@@ -218,13 +218,13 @@
 
217
@@ -217,13 +217,13 @@
214
218
 /*==============*/
215
219
        mutex_t*        mutex,          /*!< in: pointer to memory */
216
220
 #ifdef UNIV_DEBUG
227
231
 
228
232
 /******************************************************************//**
229
233
 NOTE! Use the corresponding macro mutex_free(), not directly this function!
230
 
@@ -292,13 +292,13 @@
 
234
@@ -291,13 +291,13 @@
231
235
        PSI_mutex_key   key,            /*!< in: Performance Schema key */
232
236
        mutex_t*        mutex,          /*!< in: pointer to memory */
233
237
 # ifdef UNIV_DEBUG
244
248
 /******************************************************************//**
245
249
 NOTE! Please use the corresponding macro mutex_enter(), not directly
246
250
 this function!
247
 
@@ -723,9 +723,9 @@
 
251
@@ -722,9 +722,9 @@
248
252
        ulint   line;           /*!< Line where the mutex was locked */
249
253
        ulint   level;          /*!< Level in the global latching order */
250
254
 #endif /* UNIV_SYNC_DEBUG */
255
259
        os_thread_id_t thread_id; /*!< The thread id of the thread
256
260
                                which locked the mutex. */
257
261
        ulint           magic_n;        /*!< MUTEX_MAGIC_N */
258
 
@@ -740,9 +740,9 @@
 
262
@@ -739,9 +739,9 @@
259
263
        ulong           count_os_yield; /*!< count of os_wait */
260
264
        ulonglong       lspent_time;    /*!< mutex os_wait timer msec */
261
265
        ulonglong       lmax_spent_time;/*!< mutex os_wait timer msec */
306
310
diff -ruN a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
307
311
--- a/storage/innobase/sync/sync0arr.c  2010-12-03 15:09:51.304953409 +0900
308
312
+++ b/storage/innobase/sync/sync0arr.c  2010-12-03 17:35:12.985024561 +0900
309
 
@@ -488,12 +488,12 @@
 
313
@@ -489,13 +489,12 @@
310
314
                mutex = cell->old_wait_mutex;
311
315
 
312
316
                fprintf(file,
316
320
                        "Last time reserved in file %s line %lu, "
317
321
 #endif /* UNIV_SYNC_DEBUG */
318
322
                        "waiters flag %lu\n",
319
 
-                       (void*) mutex, mutex->cfile_name, (ulong) mutex->cline,
 
323
-                       (void*) mutex, innobase_basename(mutex->cfile_name),
 
324
-                       (ulong) mutex->cline,
320
325
+                       (void*) mutex, mutex->cmutex_name,
321
326
                        (ulong) mutex->lock_word,
322
327
 #ifdef UNIV_SYNC_DEBUG
323
328
                        mutex->file_name, (ulong) mutex->line,
324
 
@@ -511,9 +511,8 @@
 
329
@@ -513,9 +512,8 @@
325
330
                rwlock = cell->old_wait_rw_lock;
326
331
 
327
332
                fprintf(file,
328
333
-                       " RW-latch at %p created in file %s line %lu\n",
329
 
-                       (void*) rwlock, rwlock->cfile_name,
 
334
-                       (void*) rwlock, innobase_basename(rwlock->cfile_name),
330
335
-                       (ulong) rwlock->cline);
331
336
+                       " RW-latch at %p '%s'\n",
332
337
+                       (void*) rwlock, rwlock->lock_name);
336
341
diff -ruN a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c
337
342
--- a/storage/innobase/sync/sync0rw.c   2010-11-03 07:01:13.000000000 +0900
338
343
+++ b/storage/innobase/sync/sync0rw.c   2010-12-03 17:35:12.987029059 +0900
339
 
@@ -241,10 +241,10 @@
 
344
@@ -242,10 +242,10 @@
340
345
 # ifdef UNIV_SYNC_DEBUG
341
346
        ulint           level,          /*!< in: level */
342
347
 # endif /* UNIV_SYNC_DEBUG */
350
355
 {
351
356
        /* If this is the very first time a synchronization object is
352
357
        created, then the following call initializes the sync system. */
353
 
@@ -253,14 +253,15 @@
 
358
@@ -254,14 +254,15 @@
354
359
        mutex_create(rw_lock_mutex_key, rw_lock_get_mutex(lock),
355
360
                     SYNC_NO_ORDER_CHECK);
356
361
 
370
375
 # endif
371
376
 #endif /* INNODB_RW_LOCKS_USE_ATOMICS */
372
377
 
373
 
@@ -283,8 +284,7 @@
 
378
@@ -284,8 +285,7 @@
374
379
 
375
380
        ut_d(lock->magic_n = RW_LOCK_MAGIC_N);
376
381
 
380
385
 
381
386
        lock->count_os_wait = 0;
382
387
        lock->last_s_file_name = "not yet reserved";
383
 
@@ -404,10 +404,10 @@
 
388
@@ -405,11 +405,10 @@
384
389
        if (srv_print_latch_waits) {
385
390
                fprintf(stderr,
386
391
                        "Thread %lu spin wait rw-s-lock at %p"
388
393
+                       " '%s' rnds %lu\n",
389
394
                        (ulong) os_thread_pf(os_thread_get_curr_id()),
390
395
                        (void*) lock,
391
 
-                       lock->cfile_name, (ulong) lock->cline, (ulong) i);
 
396
-                       innobase_basename(lock->cfile_name),
 
397
-                       (ulong) lock->cline, (ulong) i);
392
398
+                       lock->lock_name, (ulong) i);
393
399
        }
394
400
 
395
401
        /* We try once again to obtain the lock */
396
 
@@ -440,10 +440,9 @@
 
402
@@ -442,11 +441,9 @@
397
403
                if (srv_print_latch_waits) {
398
404
                        fprintf(stderr,
399
405
                                "Thread %lu OS wait rw-s-lock at %p"
400
406
-                               " cfile %s cline %lu\n",
401
407
+                               " '%s'\n",
402
408
                                os_thread_pf(os_thread_get_curr_id()),
403
 
-                               (void*) lock, lock->cfile_name,
 
409
-                               (void*) lock,
 
410
-                               innobase_basename(lock->cfile_name),
404
411
-                               (ulong) lock->cline);
405
412
+                               (void*) lock, lock->lock_name);
406
413
                }
407
414
 
408
415
                /* these stats may not be accurate */
409
 
@@ -662,9 +661,9 @@
 
416
@@ -665,10 +662,9 @@
410
417
        if (srv_print_latch_waits) {
411
418
                fprintf(stderr,
412
419
                        "Thread %lu spin wait rw-x-lock at %p"
413
420
-                       " cfile %s cline %lu rnds %lu\n",
414
421
+                       " '%s' rnds %lu\n",
415
422
                        os_thread_pf(os_thread_get_curr_id()), (void*) lock,
416
 
-                       lock->cfile_name, (ulong) lock->cline, (ulong) i);
 
423
-                       innobase_basename(lock->cfile_name),
 
424
-                       (ulong) lock->cline, (ulong) i);
417
425
+                       lock->lock_name, (ulong) i);
418
426
        }
419
427
 
420
428
        sync_array_reserve_cell(sync_primary_wait_array,
421
 
@@ -685,9 +684,9 @@
 
429
@@ -689,10 +685,9 @@
422
430
        if (srv_print_latch_waits) {
423
431
                fprintf(stderr,
424
432
                        "Thread %lu OS wait for rw-x-lock at %p"
425
433
-                       " cfile %s cline %lu\n",
426
434
+                       " '%s'\n",
427
435
                        os_thread_pf(os_thread_get_curr_id()), (void*) lock,
428
 
-                       lock->cfile_name, (ulong) lock->cline);
 
436
-                       innobase_basename(lock->cfile_name),
 
437
-                       (ulong) lock->cline);
429
438
+                       lock->lock_name);
430
439
        }
431
440
 
433
442
diff -ruN a/storage/innobase/sync/sync0sync.c b/storage/innobase/sync/sync0sync.c
434
443
--- a/storage/innobase/sync/sync0sync.c 2010-12-03 15:49:59.233955565 +0900
435
444
+++ b/storage/innobase/sync/sync0sync.c 2010-12-03 17:35:12.989024400 +0900
436
 
@@ -269,13 +269,13 @@
 
445
@@ -270,13 +270,13 @@
437
446
 /*==============*/
438
447
        mutex_t*        mutex,          /*!< in: pointer to memory */
439
448
 #ifdef UNIV_DEBUG
450
459
 {
451
460
 #if defined(HAVE_ATOMIC_BUILTINS)
452
461
        mutex_reset_lock_word(mutex);
453
 
@@ -293,11 +293,13 @@
 
462
@@ -294,11 +294,13 @@
454
463
        mutex->file_name = "not yet reserved";
455
464
        mutex->level = level;
456
465
 #endif /* UNIV_SYNC_DEBUG */
465
474
        mutex->count_using=       0;
466
475
        mutex->mutex_type=        0;
467
476
        mutex->lspent_time=       0;
468
 
@@ -551,9 +553,9 @@
 
477
@@ -552,10 +554,9 @@
469
478
 #ifdef UNIV_SRV_PRINT_LATCH_WAITS
470
479
        fprintf(stderr,
471
480
                "Thread %lu spin wait mutex at %p"
472
481
-               " cfile %s cline %lu rnds %lu\n",
473
482
+               " '%s' rnds %lu\n",
474
483
                (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex,
475
 
-               mutex->cfile_name, (ulong) mutex->cline, (ulong) i);
 
484
-               innobase_basename(mutex->cfile_name),
 
485
-               (ulong) mutex->cline, (ulong) i);
476
486
+               mutex->cmutex_name, (ulong) i);
477
487
 #endif
478
488
 
479
489
        mutex_spin_round_count += i;
480
 
@@ -628,9 +630,9 @@
 
490
@@ -630,10 +631,9 @@
481
491
 
482
492
 #ifdef UNIV_SRV_PRINT_LATCH_WAITS
483
493
        fprintf(stderr,
484
494
-               "Thread %lu OS wait mutex at %p cfile %s cline %lu rnds %lu\n",
485
495
+               "Thread %lu OS wait mutex at %p '%s' rnds %lu\n",
486
496
                (ulong) os_thread_pf(os_thread_get_curr_id()), (void*) mutex,
487
 
-               mutex->cfile_name, (ulong) mutex->cline, (ulong) i);
 
497
-               innobase_basename(mutex->cfile_name),
 
498
-               (ulong) mutex->cline, (ulong) i);
488
499
+               mutex->cmutex_name, (ulong) i);
489
500
 #endif
490
501
 
491
502
        mutex_os_wait_count++;
492
 
@@ -878,8 +880,8 @@
 
503
@@ -881,9 +881,8 @@
493
504
 
494
505
        if (mutex->magic_n == MUTEX_MAGIC_N) {
495
506
                fprintf(stderr,
496
507
-                       "Mutex created at %s %lu\n",
497
 
-                       mutex->cfile_name, (ulong) mutex->cline);
 
508
-                       innobase_basename(mutex->cfile_name),
 
509
-                       (ulong) mutex->cline);
498
510
+                       "Mutex '%s'\n",
499
511
+                       mutex->cmutex_name);
500
512