summaryrefslogtreecommitdiff
path: root/innobase/buf/buf0lru.c
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/buf/buf0lru.c')
-rw-r--r--innobase/buf/buf0lru.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c
index c5faec17890..053161986e4 100644
--- a/innobase/buf/buf0lru.c
+++ b/innobase/buf/buf0lru.c
@@ -97,13 +97,14 @@ scan_again:
}
if (block->space == id) {
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf(
"Dropping space %lu page %lu\n",
(ulong) block->space,
(ulong) block->offset);
}
-
+#endif
if (block->is_hashed) {
page_no = block->offset;
@@ -207,12 +208,16 @@ buf_LRU_search_and_free_block(
while (block != NULL) {
ut_a(block->in_LRU_list);
if (buf_flush_ready_for_replace(block)) {
+
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
- printf(
+ fprintf(stderr,
"Putting space %lu page %lu to free list\n",
(ulong) block->space,
(ulong) block->offset);
}
+#endif /* UNIV_DEBUG */
+
buf_LRU_block_remove_hashed_page(block);
mutex_exit(&(buf_pool->mutex));
@@ -404,28 +409,21 @@ loop:
fprintf(stderr,
"InnoDB: Warning: difficult to find free blocks from\n"
"InnoDB: the buffer pool (%lu search iterations)! Consider\n"
- "InnoDB: increasing the buffer pool size.\n",
- (ulong) n_iterations);
- fprintf(stderr,
+ "InnoDB: increasing the buffer pool size.\n"
"InnoDB: It is also possible that in your Unix version\n"
"InnoDB: fsync is very slow, or completely frozen inside\n"
"InnoDB: the OS kernel. Then upgrading to a newer version\n"
"InnoDB: of your operating system may help. Look at the\n"
- "InnoDB: number of fsyncs in diagnostic info below.\n");
-
- fprintf(stderr,
- "InnoDB: Pending flushes (fsync) log: %lu; buffer pool: %lu\n",
- (ulong) fil_n_pending_log_flushes,
- (ulong) fil_n_pending_tablespace_flushes);
- fprintf(stderr,
- "InnoDB: %lu OS file reads, %lu OS file writes, %lu OS fsyncs\n",
- (ulong) os_n_file_reads,
- (ulong) os_n_file_writes,
- (ulong) os_n_fsyncs);
-
- fprintf(stderr,
+ "InnoDB: number of fsyncs in diagnostic info below.\n"
+ "InnoDB: Pending flushes (fsync) log: %lu; buffer pool: %lu\n"
+ "InnoDB: %lu OS file reads, %lu OS file writes, %lu OS fsyncs\n"
"InnoDB: Starting InnoDB Monitor to print further\n"
- "InnoDB: diagnostics to the standard output.\n");
+ "InnoDB: diagnostics to the standard output.\n",
+ (ulong) n_iterations,
+ (ulong) fil_n_pending_log_flushes,
+ (ulong) fil_n_pending_tablespace_flushes,
+ (ulong) os_n_file_reads, (ulong) os_n_file_writes,
+ (ulong) os_n_fsyncs);
mon_value_was = srv_print_innodb_monitor;
started_monitor = TRUE;
@@ -855,11 +853,12 @@ buf_LRU_block_remove_hashed_page(
(ulong) block);
}
+#ifdef UNIV_DEBUG
buf_print();
buf_LRU_print();
buf_validate();
buf_LRU_validate();
-
+#endif
ut_a(0);
}
@@ -889,6 +888,7 @@ buf_LRU_block_free_hashed_page(
buf_LRU_block_free_non_file_page(block);
}
+#ifdef UNIV_DEBUG
/**************************************************************************
Validates the LRU list. */
@@ -975,7 +975,7 @@ buf_LRU_print(void)
ut_ad(buf_pool);
mutex_enter(&(buf_pool->mutex));
- printf("Pool ulint clock %lu\n", (ulong) buf_pool->ulint_clock);
+ fprintf(stderr, "Pool ulint clock %lu\n", (ulong) buf_pool->ulint_clock);
block = UT_LIST_GET_FIRST(buf_pool->LRU);
@@ -983,39 +983,40 @@ buf_LRU_print(void)
while (block != NULL) {
- printf("BLOCK %lu ", (ulong) block->offset);
+ fprintf(stderr, "BLOCK %lu ", (ulong) block->offset);
if (block->old) {
- printf("old ");
+ fputs("old ", stderr);
}
if (block->buf_fix_count) {
- printf("buffix count %lu ", (ulong) block->buf_fix_count);
+ fprintf(stderr, "buffix count %lu ",
+ (ulong) block->buf_fix_count);
}
if (block->io_fix) {
- printf("io_fix %lu ", (ulong) block->io_fix);
+ fprintf(stderr, "io_fix %lu ", (ulong) block->io_fix);
}
if (ut_dulint_cmp(block->oldest_modification,
ut_dulint_zero) > 0) {
- printf("modif. ");
+ fputs("modif. ", stderr);
}
- printf("LRU pos %lu ", (ulong) block->LRU_position);
-
frame = buf_block_get_frame(block);
- printf("type %lu ", (ulong) fil_page_get_type(frame));
- printf("index id %lu ", (ulong) ut_dulint_get_low(
- btr_page_get_index_id(frame)));
+ fprintf(stderr, "LRU pos %lu type %lu index id %lu ",
+ (ulong) block->LRU_position,
+ (ulong) fil_page_get_type(frame),
+ (ulong) ut_dulint_get_low(btr_page_get_index_id(frame)));
block = UT_LIST_GET_NEXT(LRU, block);
- len++;
- if (len % 10 == 0) {
- printf("\n");
+ if (++len == 10) {
+ len = 0;
+ putc('\n', stderr);
}
}
mutex_exit(&(buf_pool->mutex));
}
+#endif /* UNIV_DEBUG */