]> git.pld-linux.org Git - packages/mysql.git/blame - innodb_show_status.patch
- Try to fix lang config on upgrade.
[packages/mysql.git] / innodb_show_status.patch
CommitLineData
b4e1fa2c
AM
1# name : innodb_show_status.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!
8diff -ruN a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
9--- a/storage/innobase/buf/buf0buf.c 2010-11-03 07:01:13.000000000 +0900
10+++ b/storage/innobase/buf/buf0buf.c 2010-12-03 15:07:31.786968193 +0900
11@@ -4812,14 +4812,16 @@
12 buf_flush_list_mutex_enter(buf_pool);
13
14 fprintf(file,
15- "Buffer pool size %lu\n"
16- "Free buffers %lu\n"
17- "Database pages %lu\n"
18- "Old database pages %lu\n"
19- "Modified db pages %lu\n"
20+ "Buffer pool size %lu\n"
21+ "Buffer pool size, bytes %lu\n"
22+ "Free buffers %lu\n"
23+ "Database pages %lu\n"
24+ "Old database pages %lu\n"
25+ "Modified db pages %lu\n"
26 "Pending reads %lu\n"
27 "Pending writes: LRU %lu, flush list %lu, single page %lu\n",
28 (ulong) buf_pool->curr_size,
29+ (ulong) buf_pool->curr_size * UNIV_PAGE_SIZE,
30 (ulong) UT_LIST_GET_LEN(buf_pool->free),
31 (ulong) UT_LIST_GET_LEN(buf_pool->LRU),
32 (ulong) buf_pool->LRU_old_len,
33diff -ruN a/storage/innobase/buf/buf0flu.c b/storage/innobase/buf/buf0flu.c
34--- a/storage/innobase/buf/buf0flu.c 2010-12-03 20:58:26.000000000 +0300
35+++ b/storage/innobase/buf/buf0flu.c 2011-01-07 03:37:41.000000000 +0300
36@@ -75,7 +75,7 @@
37 static buf_flush_stat_t buf_flush_stat_sum;
38
39 /** Number of pages flushed through non flush_list flushes. */
40-static ulint buf_lru_flush_page_count = 0;
41+// static ulint buf_lru_flush_page_count = 0;
42
43 /* @} */
44
45diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
46--- a/storage/innobase/fil/fil0fil.c 2010-11-03 07:01:13.000000000 +0900
47+++ b/storage/innobase/fil/fil0fil.c 2010-12-03 15:07:31.790357112 +0900
48@@ -4858,3 +4858,30 @@
49
50 fil_system = NULL;
51 }
52+
53+/*************************************************************************
54+Return local hash table informations. */
55+
56+ulint
57+fil_system_hash_cells(void)
58+/*=======================*/
59+{
60+ if (fil_system) {
61+ return (fil_system->spaces->n_cells
62+ + fil_system->name_hash->n_cells);
63+ } else {
64+ return 0;
65+ }
66+}
67+
68+ulint
69+fil_system_hash_nodes(void)
70+/*=======================*/
71+{
72+ if (fil_system) {
73+ return (UT_LIST_GET_LEN(fil_system->space_list)
74+ * (sizeof(fil_space_t) + MEM_BLOCK_HEADER_SIZE));
75+ } else {
76+ return 0;
77+ }
78+}
79diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
80--- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:06:58.727955654 +0900
81+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:07:31.799376984 +0900
82@@ -584,6 +584,8 @@
83 (char*) &export_vars.innodb_buffer_pool_pages_dirty, SHOW_LONG},
84 {"buffer_pool_pages_flushed",
85 (char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG},
86+ {"buffer_pool_pages_LRU_flushed",
87+ (char*) &export_vars.innodb_buffer_pool_pages_LRU_flushed, SHOW_LONG},
88 {"buffer_pool_pages_free",
89 (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG},
90 #ifdef UNIV_DEBUG
91@@ -10975,6 +10977,16 @@
92 "Force InnoDB to not use next-key locking, to use only row-level locking.",
93 NULL, NULL, FALSE);
94
95+static MYSQL_SYSVAR_ULONG(show_verbose_locks, srv_show_verbose_locks,
96+ PLUGIN_VAR_OPCMDARG,
97+ "Whether to show records locked in SHOW INNODB STATUS.",
98+ NULL, NULL, 0, 0, 1, 0);
99+
100+static MYSQL_SYSVAR_ULONG(show_locks_held, srv_show_locks_held,
101+ PLUGIN_VAR_RQCMDARG,
102+ "Number of locks held to print for each InnoDB transaction in SHOW INNODB STATUS.",
103+ NULL, NULL, 10, 0, 1000, 0);
104+
105 #ifdef UNIV_LOG_ARCHIVE
106 static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir,
107 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
108@@ -11162,7 +11174,7 @@
109
110 static MYSQL_SYSVAR_STR(version, innodb_version_str,
111 PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_READONLY,
112- "InnoDB version", NULL, NULL, INNODB_VERSION_STR);
113+ "Percona-InnoDB-plugin version", NULL, NULL, INNODB_VERSION_STR);
114
115 static MYSQL_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,
116 PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
117@@ -11247,6 +11259,8 @@
118 MYSQL_SYSVAR(thread_concurrency),
119 MYSQL_SYSVAR(thread_sleep_delay),
120 MYSQL_SYSVAR(autoinc_lock_mode),
121+ MYSQL_SYSVAR(show_verbose_locks),
122+ MYSQL_SYSVAR(show_locks_held),
123 MYSQL_SYSVAR(version),
124 MYSQL_SYSVAR(use_sys_malloc),
125 MYSQL_SYSVAR(use_native_aio),
126diff -ruN a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h
127--- a/storage/innobase/include/fil0fil.h 2010-11-03 07:01:13.000000000 +0900
128+++ b/storage/innobase/include/fil0fil.h 2010-12-03 15:07:31.812028575 +0900
129@@ -726,6 +726,17 @@
130 /*============================*/
131 ulint id); /*!< in: space id */
132
133+/*************************************************************************
134+Return local hash table informations. */
135+
136+ulint
137+fil_system_hash_cells(void);
138+/*========================*/
139+
140+ulint
141+fil_system_hash_nodes(void);
142+/*========================*/
143+
144 typedef struct fil_space_struct fil_space_t;
145
146 #endif
147diff -ruN a/storage/innobase/include/read0read.h b/storage/innobase/include/read0read.h
148--- a/storage/innobase/include/read0read.h 2010-12-04 02:58:26.000000000 +0900
149+++ b/storage/innobase/include/read0read.h 2011-01-21 19:35:44.127631727 +0900
150@@ -88,6 +88,7 @@
151 void
152 read_view_print(
153 /*============*/
154+ FILE* file,
155 const read_view_t* view); /*!< in: read view */
156 /*********************************************************************//**
157 Create a consistent cursor view for mysql to be used in cursors. In this
158diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
159--- a/storage/innobase/include/srv0srv.h 2010-11-03 07:01:13.000000000 +0900
160+++ b/storage/innobase/include/srv0srv.h 2010-12-03 15:07:31.813958103 +0900
161@@ -145,6 +145,9 @@
162 extern char srv_adaptive_flushing;
163
164
165+extern ulint srv_show_locks_held;
166+extern ulint srv_show_verbose_locks;
167+
168 /* The sort order table of the MySQL latin1_swedish_ci character set
169 collation */
170 extern const byte* srv_latin1_ordering;
171@@ -318,6 +321,8 @@
172 buffer pool to disk */
173 extern ulint srv_buf_pool_flushed;
174
175+extern ulint buf_lru_flush_page_count;
176+
177 /** Number of buffer pool reads that led to the
178 reading of a disk page */
179 extern ulint srv_buf_pool_reads;
180@@ -691,6 +696,7 @@
181 ulint innodb_buffer_pool_reads; /*!< srv_buf_pool_reads */
182 ulint innodb_buffer_pool_wait_free; /*!< srv_buf_pool_wait_free */
183 ulint innodb_buffer_pool_pages_flushed; /*!< srv_buf_pool_flushed */
184+ ulint innodb_buffer_pool_pages_LRU_flushed; /*!< buf_lru_flush_page_count */
185 ulint innodb_buffer_pool_write_requests;/*!< srv_buf_pool_write_requests */
186 ulint innodb_buffer_pool_read_ahead; /*!< srv_read_ahead */
187 ulint innodb_buffer_pool_read_ahead_evicted;/*!< srv_read_ahead evicted*/
188diff -ruN a/storage/innobase/include/thr0loc.h b/storage/innobase/include/thr0loc.h
189--- a/storage/innobase/include/thr0loc.h 2010-11-03 07:01:13.000000000 +0900
190+++ b/storage/innobase/include/thr0loc.h 2010-12-03 15:07:31.815081509 +0900
191@@ -83,6 +83,17 @@
192 thr_local_get_in_ibuf_field(void);
193 /*=============================*/
194
195+/*************************************************************************
196+Return local hash table informations. */
197+
198+ulint
199+thr_local_hash_cells(void);
200+/*=======================*/
201+
202+ulint
203+thr_local_hash_nodes(void);
204+/*=======================*/
205+
206 #ifndef UNIV_NONINL
207 #include "thr0loc.ic"
208 #endif
209diff -ruN a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
210--- a/storage/innobase/lock/lock0lock.c 2010-11-03 07:01:13.000000000 +0900
211+++ b/storage/innobase/lock/lock0lock.c 2010-12-03 15:07:31.819023998 +0900
212@@ -4302,6 +4302,7 @@
213
214 putc('\n', file);
215
216+ if ( srv_show_verbose_locks ) {
217 block = buf_page_try_get(space, page_no, &mtr);
218
219 for (i = 0; i < lock_rec_get_n_bits(lock); ++i) {
220@@ -4328,6 +4329,7 @@
221
222 putc('\n', file);
223 }
224+ }
225
226 mtr_commit(&mtr);
227 if (UNIV_LIKELY_NULL(heap)) {
228@@ -4511,7 +4513,7 @@
229 }
230 }
231
232- if (!srv_print_innodb_lock_monitor) {
233+ if (!srv_print_innodb_lock_monitor && !srv_show_locks_held) {
234 nth_trx++;
235 goto loop;
236 }
237@@ -4583,8 +4585,8 @@
238
239 nth_lock++;
240
241- if (nth_lock >= 10) {
242- fputs("10 LOCKS PRINTED FOR THIS TRX:"
243+ if (nth_lock >= srv_show_locks_held) {
244+ fputs("TOO MANY LOCKS PRINTED FOR THIS TRX:"
245 " SUPPRESSING FURTHER PRINTS\n",
246 file);
247
248diff -ruN a/storage/innobase/read/read0read.c b/storage/innobase/read/read0read.c
249--- a/storage/innobase/read/read0read.c 2010-12-04 02:58:26.000000000 +0900
250+++ b/storage/innobase/read/read0read.c 2011-01-21 19:37:08.292650181 +0900
251@@ -357,34 +357,35 @@
252 void
253 read_view_print(
254 /*============*/
255+ FILE* file,
256 const read_view_t* view) /*!< in: read view */
257 {
258 ulint n_ids;
259 ulint i;
260
261 if (view->type == VIEW_HIGH_GRANULARITY) {
262- fprintf(stderr,
263+ fprintf(file,
264 "High-granularity read view undo_n:o %llu\n",
265 (ullint) view->undo_no);
266 } else {
267- fprintf(stderr, "Normal read view\n");
268+ fprintf(file, "Normal read view\n");
269 }
270
271- fprintf(stderr, "Read view low limit trx n:o " TRX_ID_FMT "\n",
272+ fprintf(file, "Read view low limit trx n:o " TRX_ID_FMT "\n",
273 (ullint) view->low_limit_no);
274
275- fprintf(stderr, "Read view up limit trx id " TRX_ID_FMT "\n",
276+ fprintf(file, "Read view up limit trx id " TRX_ID_FMT "\n",
277 (ullint) view->up_limit_id);
278
279- fprintf(stderr, "Read view low limit trx id " TRX_ID_FMT "\n",
280+ fprintf(file, "Read view low limit trx id " TRX_ID_FMT "\n",
281 (ullint) view->low_limit_id);
282
283- fprintf(stderr, "Read view individually stored trx ids:\n");
284+ fprintf(file, "Read view individually stored trx ids:\n");
285
286 n_ids = view->n_trx_ids;
287
288 for (i = 0; i < n_ids; i++) {
289- fprintf(stderr, "Read view trx id " TRX_ID_FMT "\n",
290+ fprintf(file, "Read view trx id " TRX_ID_FMT "\n",
291 (ullint) read_view_get_nth_trx_id(view, i));
292 }
293 }
294diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
295--- a/storage/innobase/srv/srv0srv.c 2010-11-03 07:01:13.000000000 +0900
296+++ b/storage/innobase/srv/srv0srv.c 2010-12-03 15:07:31.824022673 +0900
297@@ -84,6 +84,7 @@
298 #include "ha_prototypes.h"
299 #include "trx0i_s.h"
300 #include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */
301+#include "read0read.h"
302 #include "mysql/plugin.h"
303 #include "mysql/service_thd_wait.h"
304
305@@ -193,6 +194,9 @@
306 the checkpoints. */
307 UNIV_INTERN char srv_adaptive_flushing = TRUE;
308
309+UNIV_INTERN ulint srv_show_locks_held = 10;
310+UNIV_INTERN ulint srv_show_verbose_locks = 0;
311+
312 /** Maximum number of times allowed to conditionally acquire
313 mutex before switching to blocking wait on the mutex */
314 #define MAX_MUTEX_NOWAIT 20
315@@ -311,6 +315,7 @@
316 /* variable to count the number of pages that were written from buffer
317 pool to the disk */
318 UNIV_INTERN ulint srv_buf_pool_flushed = 0;
319+UNIV_INTERN ulint buf_lru_flush_page_count = 0;
320
321 /** Number of buffer pool reads that led to the
322 reading of a disk page */
323@@ -1787,6 +1792,13 @@
324 ulint n_reserved;
325 ibool ret;
326
327+ ulint btr_search_sys_subtotal;
328+ ulint lock_sys_subtotal;
329+ ulint recv_sys_subtotal;
330+
331+ ulint i;
332+ trx_t* trx;
333+
334 mutex_enter(&srv_innodb_monitor_mutex);
335
336 current_time = time(NULL);
337@@ -1835,31 +1847,6 @@
338
339 mutex_exit(&dict_foreign_err_mutex);
340
341- /* Only if lock_print_info_summary proceeds correctly,
342- before we call the lock_print_info_all_transactions
343- to print all the lock information. */
344- ret = lock_print_info_summary(file, nowait);
345-
346- if (ret) {
347- if (trx_start) {
348- long t = ftell(file);
349- if (t < 0) {
350- *trx_start = ULINT_UNDEFINED;
351- } else {
352- *trx_start = (ulint) t;
353- }
354- }
355- lock_print_info_all_transactions(file);
356- if (trx_end) {
357- long t = ftell(file);
358- if (t < 0) {
359- *trx_end = ULINT_UNDEFINED;
360- } else {
361- *trx_end = (ulint) t;
362- }
363- }
364- }
365-
366 fputs("--------\n"
367 "FILE I/O\n"
368 "--------\n", file);
369@@ -1890,10 +1877,84 @@
370 "BUFFER POOL AND MEMORY\n"
371 "----------------------\n", file);
372 fprintf(file,
373- "Total memory allocated " ULINTPF
374- "; in additional pool allocated " ULINTPF "\n",
375- ut_total_allocated_memory,
376- mem_pool_get_reserved(mem_comm_pool));
377+ "Total memory allocated " ULINTPF
378+ "; in additional pool allocated " ULINTPF "\n",
379+ ut_total_allocated_memory,
380+ mem_pool_get_reserved(mem_comm_pool));
381+ /* Calcurate reserved memories */
382+ if (btr_search_sys && btr_search_sys->hash_index->heap) {
383+ btr_search_sys_subtotal = mem_heap_get_size(btr_search_sys->hash_index->heap);
384+ } else {
385+ btr_search_sys_subtotal = 0;
386+ for (i=0; i < btr_search_sys->hash_index->n_mutexes; i++) {
387+ btr_search_sys_subtotal += mem_heap_get_size(btr_search_sys->hash_index->heaps[i]);
388+ }
389+ }
390+
391+ lock_sys_subtotal = 0;
392+ if (trx_sys) {
393+ mutex_enter(&kernel_mutex);
394+ trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
395+ while (trx) {
396+ lock_sys_subtotal += ((trx->lock_heap) ? mem_heap_get_size(trx->lock_heap) : 0);
397+ trx = UT_LIST_GET_NEXT(mysql_trx_list, trx);
398+ }
399+ mutex_exit(&kernel_mutex);
400+ }
401+
402+ recv_sys_subtotal = ((recv_sys && recv_sys->addr_hash)
403+ ? mem_heap_get_size(recv_sys->heap) : 0);
404+
405+ fprintf(file,
406+ "Internal hash tables (constant factor + variable factor)\n"
407+ " Adaptive hash index %lu \t(%lu + %lu)\n"
408+ " Page hash %lu (buffer pool 0 only)\n"
409+ " Dictionary cache %lu \t(%lu + %lu)\n"
410+ " File system %lu \t(%lu + %lu)\n"
411+ " Lock system %lu \t(%lu + %lu)\n"
412+ " Recovery system %lu \t(%lu + %lu)\n"
413+ " Threads %lu \t(%lu + %lu)\n",
414+
415+ (ulong) (btr_search_sys
416+ ? (btr_search_sys->hash_index->n_cells * sizeof(hash_cell_t)) : 0)
417+ + btr_search_sys_subtotal,
418+ (ulong) (btr_search_sys
419+ ? (btr_search_sys->hash_index->n_cells * sizeof(hash_cell_t)) : 0),
420+ (ulong) btr_search_sys_subtotal,
421+
422+ (ulong) (buf_pool_from_array(0)->page_hash->n_cells * sizeof(hash_cell_t)),
423+
424+ (ulong) (dict_sys ? ((dict_sys->table_hash->n_cells
425+ + dict_sys->table_id_hash->n_cells
426+ ) * sizeof(hash_cell_t)
427+ + dict_sys->size) : 0),
428+ (ulong) (dict_sys ? ((dict_sys->table_hash->n_cells
429+ + dict_sys->table_id_hash->n_cells
430+ ) * sizeof(hash_cell_t)) : 0),
431+ (ulong) (dict_sys ? (dict_sys->size) : 0),
432+
433+ (ulong) (fil_system_hash_cells() * sizeof(hash_cell_t)
434+ + fil_system_hash_nodes()),
435+ (ulong) (fil_system_hash_cells() * sizeof(hash_cell_t)),
436+ (ulong) fil_system_hash_nodes(),
437+
438+ (ulong) ((lock_sys ? (lock_sys->rec_hash->n_cells * sizeof(hash_cell_t)) : 0)
439+ + lock_sys_subtotal),
440+ (ulong) (lock_sys ? (lock_sys->rec_hash->n_cells * sizeof(hash_cell_t)) : 0),
441+ (ulong) lock_sys_subtotal,
442+
443+ (ulong) (((recv_sys && recv_sys->addr_hash)
444+ ? (recv_sys->addr_hash->n_cells * sizeof(hash_cell_t)) : 0)
445+ + recv_sys_subtotal),
446+ (ulong) ((recv_sys && recv_sys->addr_hash)
447+ ? (recv_sys->addr_hash->n_cells * sizeof(hash_cell_t)) : 0),
448+ (ulong) recv_sys_subtotal,
449+
450+ (ulong) (thr_local_hash_cells() * sizeof(hash_cell_t)
451+ + thr_local_hash_nodes()),
452+ (ulong) (thr_local_hash_cells() * sizeof(hash_cell_t)),
453+ (ulong) thr_local_hash_nodes());
454+
455 fprintf(file, "Dictionary memory allocated " ULINTPF "\n",
456 dict_sys->size);
457
458@@ -1909,6 +1970,16 @@
459 fprintf(file, "%lu read views open inside InnoDB\n",
460 UT_LIST_GET_LEN(trx_sys->view_list));
461
462+ if (UT_LIST_GET_LEN(trx_sys->view_list)) {
463+ read_view_t* view = UT_LIST_GET_LAST(trx_sys->view_list);
464+
465+ if (view) {
466+ fprintf(file, "---OLDEST VIEW---\n");
467+ read_view_print(file, view);
468+ fprintf(file, "-----------------\n");
469+ }
470+ }
471+
472 n_reserved = fil_space_get_n_reserved_extents(0);
473 if (n_reserved > 0) {
474 fprintf(file,
475@@ -1952,6 +2023,31 @@
476 srv_n_rows_deleted_old = srv_n_rows_deleted;
477 srv_n_rows_read_old = srv_n_rows_read;
478
479+ /* Only if lock_print_info_summary proceeds correctly,
480+ before we call the lock_print_info_all_transactions
481+ to print all the lock information. */
482+ ret = lock_print_info_summary(file, nowait);
483+
484+ if (ret) {
485+ if (trx_start) {
486+ long t = ftell(file);
487+ if (t < 0) {
488+ *trx_start = ULINT_UNDEFINED;
489+ } else {
490+ *trx_start = (ulint) t;
491+ }
492+ }
493+ lock_print_info_all_transactions(file);
494+ if (trx_end) {
495+ long t = ftell(file);
496+ if (t < 0) {
497+ *trx_end = ULINT_UNDEFINED;
498+ } else {
499+ *trx_end = (ulint) t;
500+ }
501+ }
502+ }
503+
504 fputs("----------------------------\n"
505 "END OF INNODB MONITOR OUTPUT\n"
506 "============================\n", file);
507@@ -1995,6 +2091,7 @@
508 = srv_buf_pool_write_requests;
509 export_vars.innodb_buffer_pool_wait_free = srv_buf_pool_wait_free;
510 export_vars.innodb_buffer_pool_pages_flushed = srv_buf_pool_flushed;
511+ export_vars.innodb_buffer_pool_pages_LRU_flushed = buf_lru_flush_page_count;
512 export_vars.innodb_buffer_pool_reads = srv_buf_pool_reads;
513 export_vars.innodb_buffer_pool_read_ahead
514 = stat.n_ra_pages_read;
515diff -ruN a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c
516--- a/storage/innobase/sync/sync0arr.c 2010-11-03 07:01:13.000000000 +0900
517+++ b/storage/innobase/sync/sync0arr.c 2010-12-03 15:07:31.826041368 +0900
518@@ -477,7 +477,7 @@
519
520 fprintf(file,
521 "--Thread %lu has waited at %s line %lu"
522- " for %.2f seconds the semaphore:\n",
523+ " for %#.5g seconds the semaphore:\n",
524 (ulong) os_thread_pf(cell->thread), cell->file,
525 (ulong) cell->line,
526 difftime(time(NULL), cell->reservation_time));
527diff -ruN a/storage/innobase/thr/thr0loc.c b/storage/innobase/thr/thr0loc.c
528--- a/storage/innobase/thr/thr0loc.c 2010-11-03 07:01:13.000000000 +0900
529+++ b/storage/innobase/thr/thr0loc.c 2010-12-03 15:07:31.828023915 +0900
530@@ -49,6 +49,7 @@
531
532 /** The hash table. The module is not yet initialized when it is NULL. */
533 static hash_table_t* thr_local_hash = NULL;
534+ulint thr_local_hash_n_nodes = 0;
535
536 /** Thread local data */
537 typedef struct thr_local_struct thr_local_t;
538@@ -221,6 +222,7 @@
539 os_thread_pf(os_thread_get_curr_id()),
540 local);
541
542+ thr_local_hash_n_nodes++;
543 mutex_exit(&thr_local_mutex);
544 }
545
546@@ -249,6 +251,7 @@
547
548 HASH_DELETE(thr_local_t, hash, thr_local_hash,
549 os_thread_pf(id), local);
550+ thr_local_hash_n_nodes--;
551
552 mutex_exit(&thr_local_mutex);
553
554@@ -305,3 +308,29 @@
555 hash_table_free(thr_local_hash);
556 thr_local_hash = NULL;
557 }
558+
559+/*************************************************************************
560+Return local hash table informations. */
561+
562+ulint
563+thr_local_hash_cells(void)
564+/*======================*/
565+{
566+ if (thr_local_hash) {
567+ return (thr_local_hash->n_cells);
568+ } else {
569+ return 0;
570+ }
571+}
572+
573+ulint
574+thr_local_hash_nodes(void)
575+/*======================*/
576+{
577+ if (thr_local_hash) {
578+ return (thr_local_hash_n_nodes
579+ * (sizeof(thr_local_t) + MEM_BLOCK_HEADER_SIZE));
580+ } else {
581+ return 0;
582+ }
583+}
584diff -ruN a/storage/innobase/trx/trx0purge.c b/storage/innobase/trx/trx0purge.c
585--- a/storage/innobase/trx/trx0purge.c 2010-12-04 02:58:26.000000000 +0900
586+++ b/storage/innobase/trx/trx0purge.c 2011-01-21 19:40:42.086683671 +0900
587@@ -1201,7 +1201,7 @@
588 /*=====================*/
589 {
590 fprintf(stderr, "InnoDB: Purge system view:\n");
591- read_view_print(purge_sys->view);
592+ read_view_print(stderr, purge_sys->view);
593
594 fprintf(stderr, "InnoDB: Purge trx n:o " TRX_ID_FMT
595 ", undo n:o " TRX_ID_FMT "\n",
This page took 0.110311 seconds and 4 git commands to generate.