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