summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--innobase/btr/btr0btr.c2
-rw-r--r--innobase/buf/buf0buf.c14
-rw-r--r--innobase/buf/buf0flu.c10
-rw-r--r--innobase/buf/buf0lru.c4
-rw-r--r--innobase/buf/buf0rea.c10
-rw-r--r--innobase/data/data0type.c2
-rw-r--r--innobase/dict/dict0dict.c2
-rw-r--r--innobase/fsp/fsp0fsp.c6
-rw-r--r--innobase/fut/fut0lst.c2
-rw-r--r--innobase/ibuf/ibuf0ibuf.c8
-rw-r--r--innobase/include/btr0btr.h2
-rw-r--r--innobase/include/buf0buf.h10
-rw-r--r--innobase/include/buf0buf.ic4
-rw-r--r--innobase/include/buf0flu.h2
-rw-r--r--innobase/include/buf0lru.h2
-rw-r--r--innobase/include/data0type.h2
-rw-r--r--innobase/include/dict0dict.h14
-rw-r--r--innobase/include/fsp0fsp.h2
-rw-r--r--innobase/include/fut0lst.h3
-rw-r--r--innobase/include/lock0lock.h6
-rw-r--r--innobase/include/mem0dbg.h4
-rw-r--r--innobase/include/mem0dbg.ic3
-rw-r--r--innobase/include/mem0pool.h3
-rw-r--r--innobase/include/mtr0mtr.h2
-rw-r--r--innobase/include/pars0opt.h2
-rw-r--r--innobase/include/sync0rw.h2
-rw-r--r--innobase/include/sync0sync.h2
-rw-r--r--innobase/include/trx0sys.h2
-rw-r--r--innobase/lock/lock0lock.c16
-rw-r--r--innobase/mem/mem0dbg.c2
-rw-r--r--innobase/mem/mem0pool.c2
-rw-r--r--innobase/mtr/mtr0mtr.c2
-rw-r--r--innobase/pars/pars0opt.c2
-rw-r--r--innobase/srv/srv0start.c2
-rw-r--r--innobase/sync/sync0rw.c2
-rw-r--r--innobase/sync/sync0sync.c9
-rw-r--r--innobase/trx/trx0roll.c2
-rw-r--r--innobase/trx/trx0sys.c2
38 files changed, 144 insertions, 24 deletions
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index 2e9de9b39bf..70bcd1eea1f 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -2162,6 +2162,7 @@ btr_discard_page(
ut_ad(btr_check_node_ptr(tree, merge_page, mtr));
}
+#ifdef UNIV_DEBUG
/*****************************************************************
Prints size info of a B-tree. */
@@ -2282,6 +2283,7 @@ btr_print_tree(
btr_validate_tree(tree);
}
+#endif /* UNIV_DEBUG */
/****************************************************************
Checks that the node pointer to a page is appropriate. */
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index b744430a76e..a7bf9cf1d2f 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -201,12 +201,14 @@ the read requests for the whole area. */
buf_pool_t* buf_pool = NULL; /* The buffer buf_pool of the database */
-ulint buf_dbg_counter = 0; /* This is used to insert validation
+#ifdef UNIV_DEBUG
+static ulint buf_dbg_counter = 0; /* This is used to insert validation
operations in excution in the
debug version */
ibool buf_debug_prints = FALSE; /* If this is set TRUE,
the program prints info whenever
read-ahead or flush occurs */
+#endif /* UNIV_DEBUG */
/************************************************************************
Calculates a page checksum which is stored to the page when it is written
@@ -1455,10 +1457,12 @@ buf_page_create(
/* If we get here, the page was not in buf_pool: init it there */
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr, "Creating space %lu page %lu to buffer\n",
space, offset);
}
+#endif /* UNIV_DEBUG */
block = free_block;
@@ -1609,9 +1613,11 @@ buf_page_io_complete(
rw_lock_x_unlock_gen(&(block->lock), BUF_IO_READ);
rw_lock_x_unlock_gen(&(block->read_lock), BUF_IO_READ);
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fputs("Has read ", stderr);
}
+#endif /* UNIV_DEBUG */
} else {
ut_ad(io_type == BUF_IO_WRITE);
@@ -1624,17 +1630,21 @@ buf_page_io_complete(
buf_pool->n_pages_written++;
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fputs("Has written ", stderr);
}
+#endif /* UNIV_DEBUG */
}
mutex_exit(&(buf_pool->mutex));
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr, "page space %lu page no %lu\n",
block->space, block->offset);
}
+#endif /* UNIV_DEBUG */
}
/*************************************************************************
@@ -1663,6 +1673,7 @@ buf_pool_invalidate(void)
mutex_exit(&(buf_pool->mutex));
}
+#ifdef UNIV_DEBUG
/*************************************************************************
Validates the buffer buf_pool data structure. */
@@ -1861,6 +1872,7 @@ buf_print(void)
ut_a(buf_validate());
}
+#endif /* UNIV_DEBUG */
/*************************************************************************
Returns the number of pending buf pool ios. */
diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c
index 7456e5d6f61..8a4ae2ff369 100644
--- a/innobase/buf/buf0flu.c
+++ b/innobase/buf/buf0flu.c
@@ -31,6 +31,7 @@ flushed along with the original page. */
#define BUF_FLUSH_AREA ut_min(BUF_READ_AHEAD_AREA,\
buf_pool->curr_size / 16)
+#ifdef UNIV_DEBUG
/**********************************************************************
Validates the flush list. */
static
@@ -38,6 +39,7 @@ ibool
buf_flush_validate_low(void);
/*========================*/
/* out: TRUE if ok */
+#endif /* UNIV_DEBUG */
/************************************************************************
Inserts a modified block into the flush list. */
@@ -488,11 +490,13 @@ buf_flush_try_page(
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
}
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Flushing page space %lu, page no %lu \n",
block->space, block->offset);
}
+#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
@@ -548,11 +552,13 @@ buf_flush_try_page(
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Flushing single page space %lu, page no %lu \n",
block->space, block->offset);
}
+#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
@@ -779,6 +785,7 @@ buf_flush_batch(
buf_flush_buffered_writes();
+#ifdef UNIV_DEBUG
if (buf_debug_prints && page_count > 0) {
ut_a(flush_type == BUF_FLUSH_LRU
|| flush_type == BUF_FLUSH_LIST);
@@ -787,6 +794,7 @@ buf_flush_batch(
: "Flushed %lu pages in flush list flush\n",
page_count);
}
+#endif /* UNIV_DEBUG */
return(page_count);
}
@@ -878,6 +886,7 @@ buf_flush_free_margin(void)
}
}
+#ifdef UNIV_DEBUG
/**********************************************************************
Validates the flush list. */
static
@@ -927,3 +936,4 @@ buf_flush_validate(void)
return(ret);
}
+#endif /* UNIV_DEBUG */
diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c
index 0ced7e23abe..8ad47487607 100644
--- a/innobase/buf/buf0lru.c
+++ b/innobase/buf/buf0lru.c
@@ -125,11 +125,13 @@ buf_LRU_search_and_free_block(
if (buf_flush_ready_for_replace(block)) {
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Putting space %lu page %lu to free list\n",
block->space, block->offset);
}
+#endif /* UNIV_DEBUG */
buf_LRU_block_remove_hashed_page(block);
@@ -705,6 +707,7 @@ buf_LRU_block_free_hashed_page(
buf_LRU_block_free_non_file_page(block);
}
+#ifdef UNIV_DEBUG
/**************************************************************************
Validates the LRU list. */
@@ -835,3 +838,4 @@ buf_LRU_print(void)
mutex_exit(&(buf_pool->mutex));
}
+#endif /* UNIV_DEBUG */
diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
index 83397c9c7fa..7de778a5956 100644
--- a/innobase/buf/buf0rea.c
+++ b/innobase/buf/buf0rea.c
@@ -101,11 +101,13 @@ buf_read_page_low(
block = buf_page_init_for_read(mode, space, offset);
if (block != NULL) {
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Posting read request for page %lu, sync %lu\n",
offset, sync);
}
+#endif /* UNIV_DEBUG */
fil_io(OS_FILE_READ | wake_later,
sync, space, offset, 0, UNIV_PAGE_SIZE,
@@ -242,11 +244,13 @@ buf_read_ahead_random(
os_aio_simulated_wake_handler_threads();
+#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) {
fprintf(stderr,
"Random read-ahead space %lu offset %lu pages %lu\n",
space, offset, count);
}
+#endif /* UNIV_DEBUG */
return(count);
}
@@ -500,11 +504,13 @@ buf_read_ahead_linear(
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
+#ifdef UNIV_DEBUG
if (buf_debug_prints && (count > 0)) {
fprintf(stderr,
"LINEAR read-ahead space %lu offset %lu pages %lu\n",
space, offset, count);
}
+#endif /* UNIV_DEBUG */
return(count);
}
@@ -549,11 +555,13 @@ buf_read_ibuf_merge_pages(
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Ibuf merge read-ahead space %lu pages %lu\n",
space, n_stored);
}
+#endif /* UNIV_DEBUG */
}
/************************************************************************
@@ -613,8 +621,10 @@ buf_read_recv_pages(
/* Flush pages from the end of the LRU list if necessary */
buf_flush_free_margin();
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Recovery applies read-ahead pages %lu\n", n_stored);
}
+#endif /* UNIV_DEBUG */
}
diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c
index 077012553ba..0243ee64536 100644
--- a/innobase/data/data0type.c
+++ b/innobase/data/data0type.c
@@ -15,6 +15,7 @@ Created 1/16/1996 Heikki Tuuri
dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0};
dtype_t* dtype_binary = &dtype_binary_val;
+#ifdef UNIV_DEBUG
/*************************************************************************
Validates a data type structure. */
@@ -33,6 +34,7 @@ dtype_validate(
return(TRUE);
}
+#endif /* UNIV_DEBUG */
/*************************************************************************
Prints a data type structure. */
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index d895f00b249..fa80532a32d 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -3819,6 +3819,7 @@ dict_foreign_print_low(
fputs(" )\n", stderr);
}
+#ifdef UNIV_DEBUG
/**************************************************************************
Prints a table data. */
@@ -3851,6 +3852,7 @@ dict_table_print_by_name(
dict_table_print_low(table);
mutex_exit(&(dict_sys->mutex));
}
+#endif /* UNIV_DEBUG */
/**************************************************************************
Prints a table data. */
diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c
index 53f5e885df8..7c9c072fadd 100644
--- a/innobase/fsp/fsp0fsp.c
+++ b/innobase/fsp/fsp0fsp.c
@@ -3236,7 +3236,8 @@ fseg_validate_low(
return(TRUE);
}
-
+
+#ifdef UNIV_DEBUG
/***********************************************************************
Validates a segment. */
@@ -3261,6 +3262,7 @@ fseg_validate(
return(ret);
}
+#endif /* UNIV_DEBUG */
/***********************************************************************
Writes info of a segment. */
@@ -3311,6 +3313,7 @@ fseg_print_low(
n_frag, n_free, n_not_full, n_used);
}
+#ifdef UNIV_DEBUG
/***********************************************************************
Writes info of a segment. */
@@ -3331,6 +3334,7 @@ fseg_print(
fseg_print_low(inode, mtr);
}
+#endif /* UNIV_DEBUG */
/***********************************************************************
Validates the file space system and its segments. */
diff --git a/innobase/fut/fut0lst.c b/innobase/fut/fut0lst.c
index ff112b586c4..228670f6145 100644
--- a/innobase/fut/fut0lst.c
+++ b/innobase/fut/fut0lst.c
@@ -490,6 +490,7 @@ flst_validate(
return(TRUE);
}
+#ifdef UNIV_DEBUG
/************************************************************************
Prints info of a file-based list. */
@@ -515,3 +516,4 @@ flst_print(
buf_frame_get_space_id(frame), buf_frame_get_page_no(frame),
(ulint) (base - frame), len);
}
+#endif /* UNIV_DEBUG */
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index 2745af42ff7..83bb23b036f 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -172,13 +172,15 @@ because ibuf merge is done to a page when it is read in, and it is
still physically like the index page even if the index would have been
dropped! So, there seems to be no problem. */
+#ifdef UNIV_DEBUG
/**********************************************************************
Validates the ibuf data structures when the caller owns ibuf_mutex. */
-
+static
ibool
ibuf_validate_low(void);
/*===================*/
/* out: TRUE if ok */
+#endif /* UNIV_DEBUG */
/**********************************************************************
Sets the flag in the current OS thread local storage denoting that it is
@@ -2753,9 +2755,10 @@ reset_bit:
#endif
}
+#ifdef UNIV_DEBUG
/**********************************************************************
Validates the ibuf data structures when the caller owns ibuf_mutex. */
-
+static
ibool
ibuf_validate_low(void)
/*===================*/
@@ -2782,6 +2785,7 @@ ibuf_validate_low(void)
return(TRUE);
}
+#endif /* UNIV_DEBUG */
/**********************************************************************
Prints info of ibuf. */
diff --git a/innobase/include/btr0btr.h b/innobase/include/btr0btr.h
index 8606fcd2a5c..e904db3272f 100644
--- a/innobase/include/btr0btr.h
+++ b/innobase/include/btr0btr.h
@@ -392,6 +392,7 @@ btr_page_free_low(
page_t* page, /* in: page to be freed, x-latched */
ulint level, /* in: page level */
mtr_t* mtr); /* in: mtr */
+#ifdef UNIV_DEBUG
/*****************************************************************
Prints size info of a B-tree. */
@@ -408,6 +409,7 @@ btr_print_tree(
dict_tree_t* tree, /* in: tree */
ulint width); /* in: print this many entries from start
and end */
+#endif /* UNIV_DEBUG */
/****************************************************************
Checks the size and number of fields in a record based on the definition of
the index. */
diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h
index 5ac9c83a5f9..11c9047a8fc 100644
--- a/innobase/include/buf0buf.h
+++ b/innobase/include/buf0buf.h
@@ -53,9 +53,11 @@ Created 11/5/1995 Heikki Tuuri
#define BUF_KEEP_OLD 52
extern buf_pool_t* buf_pool; /* The buffer pool of the database */
+#ifdef UNIV_DEBUG
extern ibool buf_debug_prints;/* If this is set TRUE, the program
prints info whenever read or flush
occurs */
+#endif /* UNIV_DEBUG */
/************************************************************************
Initializes the buffer pool of the database. */
@@ -452,12 +454,14 @@ buf_pool_is_block(
/*==============*/
/* out: TRUE if pointer to block */
void* ptr); /* in: pointer to memory */
+#ifdef UNIV_DEBUG
/*************************************************************************
Validates the buffer pool data structure. */
ibool
buf_validate(void);
/*==============*/
+#endif /* UNIV_DEBUG */
/************************************************************************
Prints a page to stderr. */
@@ -816,7 +820,7 @@ struct buf_pool_struct{
ulint n_pend_reads; /* number of pending read operations */
- time_t last_printout_time; /* when buf_print was last time
+ time_t last_printout_time; /* when buf_print_io was last time
called */
ulint n_pages_read; /* number read operations */
ulint n_pages_written;/* number write operations */
@@ -828,10 +832,10 @@ struct buf_pool_struct{
counted as page gets; this field
is NOT protected by the buffer
pool mutex */
- ulint n_page_gets_old;/* n_page_gets when buf_print was
+ ulint n_page_gets_old;/* n_page_gets when buf_print_io was
last time called: used to calculate
hit rate */
- ulint n_pages_read_old;/* n_pages_read when buf_print was
+ ulint n_pages_read_old;/* n_pages_read when buf_print_io was
last time called */
ulint n_pages_written_old;/* number write operations */
ulint n_pages_created_old;/* number of pages created in
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index 16deade0901..7e2a9b59378 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -11,10 +11,6 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0rea.h"
#include "mtr0mtr.h"
-extern ulint buf_dbg_counter; /* This is used to insert validation
- operations in execution in the
- debug version */
-
/************************************************************************
Recommends a move of a block to the start of the LRU list if there is danger
of dropping from the buffer pool. NOTE: does not reserve the buffer pool
diff --git a/innobase/include/buf0flu.h b/innobase/include/buf0flu.h
index 1b40acaa269..6f39eef7210 100644
--- a/innobase/include/buf0flu.h
+++ b/innobase/include/buf0flu.h
@@ -97,6 +97,7 @@ buf_flush_ready_for_replace(
/* out: TRUE if can replace immediately */
buf_block_t* block); /* in: buffer control block, must be in state
BUF_BLOCK_FILE_PAGE and in the LRU list */
+#ifdef UNIV_DEBUG
/**********************************************************************
Validates the flush list. */
@@ -104,6 +105,7 @@ ibool
buf_flush_validate(void);
/*====================*/
/* out: TRUE if ok */
+#endif /* UNIV_DEBUG */
/* When buf_flush_free_margin is called, it tries to make this many blocks
available to replacement in the free list and at the end of the LRU list (to
diff --git a/innobase/include/buf0lru.h b/innobase/include/buf0lru.h
index eb9d43d3b93..a9d57ecb36e 100644
--- a/innobase/include/buf0lru.h
+++ b/innobase/include/buf0lru.h
@@ -100,6 +100,7 @@ void
buf_LRU_make_block_old(
/*===================*/
buf_block_t* block); /* in: control block */
+#ifdef UNIV_DEBUG
/**************************************************************************
Validates the LRU list. */
@@ -112,6 +113,7 @@ Prints the LRU list. */
void
buf_LRU_print(void);
/*===============*/
+#endif /* UNIV_DEBUG */
#ifndef UNIV_NONINL
#include "buf0lru.ic"
diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h
index 4da686bf2e1..d10d20cf69e 100644
--- a/innobase/include/data0type.h
+++ b/innobase/include/data0type.h
@@ -190,6 +190,7 @@ dtype_read_for_order_and_null_size(
/*===============================*/
dtype_t* type, /* in: type struct */
byte* buf); /* in: buffer for the stored order info */
+#ifdef UNIV_DEBUG
/*************************************************************************
Validates a data type structure. */
@@ -198,6 +199,7 @@ dtype_validate(
/*===========*/
/* out: TRUE if ok */
dtype_t* type); /* in: type struct to validate */
+#endif /* UNIV_DEBUG */
/*************************************************************************
Prints a data type structure. */
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index 835c2c2b2e6..fadbcf37a43 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -301,18 +301,19 @@ dict_table_get_index_noninline(
dict_table_t* table, /* in: table */
char* name); /* in: index name */
/**************************************************************************
-Prints a table definition. */
+Prints a table data. */
void
-dict_table_print(
-/*=============*/
+dict_table_print_low(
+/*=================*/
dict_table_t* table); /* in: table */
+#ifdef UNIV_DEBUG
/**************************************************************************
-Prints a table data. */
+Prints a table definition. */
void
-dict_table_print_low(
-/*=================*/
+dict_table_print(
+/*=============*/
dict_table_t* table); /* in: table */
/**************************************************************************
Prints a table data when we know the table name. */
@@ -321,6 +322,7 @@ void
dict_table_print_by_name(
/*=====================*/
char* name);
+#endif /* UNIV_DEBUG */
/**************************************************************************
Outputs info on foreign keys of a table. */
diff --git a/innobase/include/fsp0fsp.h b/innobase/include/fsp0fsp.h
index 3494f336b1e..82c144bc766 100644
--- a/innobase/include/fsp0fsp.h
+++ b/innobase/include/fsp0fsp.h
@@ -297,6 +297,7 @@ void
fsp_print(
/*======*/
ulint space); /* in: space id */
+#ifdef UNIV_DEBUG
/***********************************************************************
Validates a segment. */
@@ -314,6 +315,7 @@ fseg_print(
/*=======*/
fseg_header_t* header, /* in: segment header */
mtr_t* mtr); /* in: mtr */
+#endif /* UNIV_DEBUG */
/* Flags for fsp_reserve_free_extents */
#define FSP_NORMAL 1000000
diff --git a/innobase/include/fut0lst.h b/innobase/include/fut0lst.h
index 5427e2248da..3f679d61ab5 100644
--- a/innobase/include/fut0lst.h
+++ b/innobase/include/fut0lst.h
@@ -181,6 +181,7 @@ flst_validate(
/* out: TRUE if ok */
flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr1); /* in: mtr */
+#ifdef UNIV_DEBUG
/************************************************************************
Prints info of a file-based list. */
@@ -189,7 +190,7 @@ flst_print(
/*=======*/
flst_base_node_t* base, /* in: pointer to base node of list */
mtr_t* mtr); /* in: mtr */
-
+#endif /* UNIV_DEBUG */
#ifndef UNIV_NONINL
#include "fut0lst.ic"
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index 94ef3b33ebc..9ccea5ad7a4 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -19,7 +19,9 @@ Created 5/7/1996 Heikki Tuuri
#include "read0types.h"
#include "hash0hash.h"
+#ifdef UNIV_DEBUG
extern ibool lock_print_waits;
+#endif /* UNIV_DEBUG */
/* Buffer for storing information about the most recent deadlock error */
extern FILE* lock_latest_err_file;
@@ -455,6 +457,7 @@ lock_check_trx_id_sanity(
dict_index_t* index, /* in: clustered index */
ibool has_kernel_mutex);/* in: TRUE if the caller owns the
kernel mutex */
+#ifdef UNIV_DEBUG
/*************************************************************************
Validates the lock queue on a single record. */
@@ -464,6 +467,7 @@ lock_rec_queue_validate(
/* out: TRUE if ok */
rec_t* rec, /* in: record to look at */
dict_index_t* index); /* in: index, or NULL if not known */
+#endif /* UNIV_DEBUG */
/*************************************************************************
Prints info of a table lock. */
@@ -487,6 +491,7 @@ void
lock_print_info(
/*============*/
FILE* file); /* in: file where to print */
+#ifdef UNIV_DEBUG
/*************************************************************************
Validates the lock queue on a table. */
@@ -511,6 +516,7 @@ ibool
lock_validate(void);
/*===============*/
/* out: TRUE if ok */
+#endif /* UNIV_DEBUG */
/* The lock system */
extern lock_sys_t* lock_sys;
diff --git a/innobase/include/mem0dbg.h b/innobase/include/mem0dbg.h
index 6c92d669be3..61c66cc218c 100644
--- a/innobase/include/mem0dbg.h
+++ b/innobase/include/mem0dbg.h
@@ -31,6 +31,7 @@ check fields at the both ends of the field. */
#define MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT)
#endif
+#ifdef UNIV_DEBUG
/*******************************************************************
Checks a memory heap for consistency and prints the contents if requested.
Outputs the sum of sizes of buffers given to the user (only in
@@ -60,6 +61,7 @@ mem_heap_validate_or_print(
ulint* n_blocks); /* out: number of blocks in the heap,
if a NULL pointer is passed as this
argument, it is ignored */
+#endif /* UNIV_DEBUG */
#ifdef UNIV_MEM_DEBUG
/******************************************************************
Prints the contents of a memory heap. */
@@ -69,6 +71,7 @@ mem_heap_print(
/*===========*/
mem_heap_t* heap); /* in: memory heap */
#endif /* UNIV_MEM_DEBUG */
+#ifdef UNIV_DEBUG
/******************************************************************
Checks that an object is a memory heap (or a block of it) */
@@ -85,6 +88,7 @@ mem_heap_validate(
/*==============*/
/* out: TRUE if ok */
mem_heap_t* heap); /* in: memory heap */
+#endif /* UNIV_DEBUG */
#ifdef UNIV_MEM_DEBUG
/*********************************************************************
TRUE if no memory is currently allocated. */
diff --git a/innobase/include/mem0dbg.ic b/innobase/include/mem0dbg.ic
index 6efac719760..2e79c814529 100644
--- a/innobase/include/mem0dbg.ic
+++ b/innobase/include/mem0dbg.ic
@@ -56,6 +56,7 @@ mem_hash_insert(
mem_heap_t* heap, /* in: the created heap */
char* file_name, /* in: file name of creation */
ulint line); /* in: line where created */
+#ifdef UNIV_MEM_DEBUG
/*******************************************************************
Removes a memory heap (which is going to be freed by the caller)
from the list of live memory heaps. Returns the size of the heap
@@ -71,7 +72,7 @@ mem_hash_remove(
mem_heap_t* heap, /* in: the heap to be freed */
char* file_name, /* in: file name of freeing */
ulint line); /* in: line where freed */
-
+#endif /* UNIV_MEM_DEBUG */
void
mem_field_header_set_len(byte* field, ulint len);
diff --git a/innobase/include/mem0pool.h b/innobase/include/mem0pool.h
index 43707bd5f61..95cf19676fb 100644
--- a/innobase/include/mem0pool.h
+++ b/innobase/include/mem0pool.h
@@ -83,6 +83,7 @@ Releases the mem pool mutex. */
void
mem_pool_mutex_exit(void);
/*=====================*/
+#ifdef UNIV_DEBUG
/************************************************************************
Validates a memory pool. */
@@ -99,7 +100,7 @@ mem_pool_print_info(
/*================*/
FILE* outfile,/* in: output file to write to */
mem_pool_t* pool); /* in: memory pool */
-
+#endif /* UNIV_DEBUG */
#ifndef UNIV_NONINL
#include "mem0pool.ic"
diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h
index d999b7cc5b7..6117927504f 100644
--- a/innobase/include/mtr0mtr.h
+++ b/innobase/include/mtr0mtr.h
@@ -250,6 +250,7 @@ mtr_memo_contains(
mtr_t* mtr, /* in: mtr */
void* object, /* in: object to search */
ulint type); /* in: type of object */
+#ifdef UNIV_DEBUG
/*************************************************************
Prints info of an mtr handle. */
@@ -257,6 +258,7 @@ void
mtr_print(
/*======*/
mtr_t* mtr); /* in: mtr */
+#endif /* UNIV_DEBUG */
/*######################################################################*/
#define MTR_BUF_MEMO_SIZE 200 /* number of slots in memo */
diff --git a/innobase/include/pars0opt.h b/innobase/include/pars0opt.h
index d091c3ee2d0..ac0e885d05a 100644
--- a/innobase/include/pars0opt.h
+++ b/innobase/include/pars0opt.h
@@ -43,6 +43,7 @@ opt_find_all_cols(
to add new found columns */
plan_t* plan, /* in: plan or NULL */
que_node_t* exp); /* in: expression or condition */
+#ifdef UNIV_SQL_DEBUG
/************************************************************************
Prints info of a query plan. */
@@ -50,6 +51,7 @@ void
opt_print_query_plan(
/*=================*/
sel_node_t* sel_node); /* in: select node */
+#endif /* UNIV_SQL_DEBUG */
#ifndef UNIV_NONINL
#include "pars0opt.ic"
diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h
index d71691b4353..82123a529a3 100644
--- a/innobase/include/sync0rw.h
+++ b/innobase/include/sync0rw.h
@@ -85,6 +85,7 @@ void
rw_lock_free(
/*=========*/
rw_lock_t* lock); /* in: rw-lock */
+#ifdef UNIV_DEBUG
/**********************************************************************
Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */
@@ -93,6 +94,7 @@ ibool
rw_lock_validate(
/*=============*/
rw_lock_t* lock);
+#endif /* UNIV_DEBUG */
/******************************************************************
NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */
diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h
index 3348da2851c..abc5350b6c0 100644
--- a/innobase/include/sync0sync.h
+++ b/innobase/include/sync0sync.h
@@ -127,6 +127,7 @@ void
sync_print(
/*=======*/
FILE* file); /* in: file where to print */
+#ifdef UNIV_DEBUG
/**********************************************************************
Checks that the mutex has been initialized. */
@@ -134,6 +135,7 @@ ibool
mutex_validate(
/*===========*/
mutex_t* mutex);
+#endif /* UNIV_DEBUG */
/**********************************************************************
Sets the mutex latching level field. */
diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h
index 755bcb28611..c7ef4d1929d 100644
--- a/innobase/include/trx0sys.h
+++ b/innobase/include/trx0sys.h
@@ -268,6 +268,7 @@ the magic number shows it valid. */
void
trx_sys_print_mysql_binlog_offset(void);
/*===================================*/
+#ifdef UNIV_HOTBACKUP
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
@@ -277,6 +278,7 @@ trx_sys_print_mysql_binlog_offset_from_page(
/*========================================*/
byte* page); /* in: buffer containing the trx system header page,
i.e., page number TRX_SYS_PAGE_NO in the tablespace */
+#endif /* UNIV_HOTBACKUP */
/*********************************************************************
Prints to stderr the MySQL master log offset info in the trx system header if
the magic number shows it valid. */
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index 47bc37113c4..e141e30ae97 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -266,7 +266,9 @@ waiting, in its lock queue. Solution: We can copy the locks as gap type
locks, so that also the waiting locks are transformed to granted gap type
locks on the inserted record. */
+#ifdef UNIV_DEBUG
ibool lock_print_waits = FALSE;
+#endif /* UNIV_DEBUG */
/* The lock system */
lock_sys_t* lock_sys = NULL;
@@ -1326,7 +1328,8 @@ lock_rec_has_expl(
return(NULL);
}
-
+
+#ifdef UNIV_DEBUG
/*************************************************************************
Checks if some other transaction has a lock request in the queue. */
static
@@ -1369,6 +1372,7 @@ lock_rec_other_has_expl_req(
return(NULL);
}
+#endif /* UNIV_DEBUG */
/*************************************************************************
Checks if some other transaction has a conflicting explicit lock request
@@ -1657,11 +1661,13 @@ lock_rec_enqueue_waiting(
ut_a(que_thr_stop(thr));
+#ifdef UNIV_DEBUG
if (lock_print_waits) {
fprintf(stderr, "Lock wait for trx %lu in index ",
ut_dulint_get_low(trx->id));
ut_print_name(stderr, index->name);
}
+#endif /* UNIV_DEBUG */
return(DB_LOCK_WAIT);
}
@@ -1997,10 +2003,12 @@ lock_grant(
lock->trx->auto_inc_lock = lock;
}
+#ifdef UNIV_DEBUG
if (lock_print_waits) {
fprintf(stderr, "Lock wait for trx %lu ends\n",
ut_dulint_get_low(lock->trx->id));
}
+#endif /* UNIV_DEBUG */
/* If we are resolving a deadlock by choosing another transaction
as a victim, then our original transaction may not be in the
@@ -3071,9 +3079,11 @@ lock_deadlock_recursive(
lock_table_print(ef, start->wait_lock);
}
+#ifdef UNIV_DEBUG
if (lock_print_waits) {
fputs("Deadlock detected\n", stderr);
}
+#endif /* UNIV_DEBUG */
if (ut_dulint_cmp(wait_lock->trx->undo_no,
start->undo_no) >= 0) {
@@ -3920,7 +3930,7 @@ loop:
if (trx == NULL) {
lock_mutex_exit_kernel();
- /* lock_validate(); */
+ ut_ad(lock_validate());
return;
}
@@ -4022,6 +4032,7 @@ loop:
goto loop;
}
+#ifdef UNIV_DEBUG
/*************************************************************************
Validates the lock queue on a table. */
@@ -4332,6 +4343,7 @@ lock_validate(void)
return(TRUE);
}
+#endif /* UNIV_DEBUG */
/*============ RECORD LOCK CHECKS FOR ROW OPERATIONS ====================*/
diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c
index 92c1235220e..6c97ef9eb8e 100644
--- a/innobase/mem/mem0dbg.c
+++ b/innobase/mem/mem0dbg.c
@@ -375,6 +375,7 @@ mem_hash_remove(
}
#endif /* UNIV_MEM_DEBUG */
+#ifdef UNIV_DEBUG
/*******************************************************************
Checks a memory heap for consistency and prints the contents if requested.
Outputs the sum of sizes of buffers given to the user (only in
@@ -585,6 +586,7 @@ mem_heap_validate(
return(TRUE);
}
+#endif /* UNIV_DEBUG */
#ifdef UNIV_MEM_DEBUG
/*********************************************************************
diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c
index 9a5d16cd4a2..3c409e3fceb 100644
--- a/innobase/mem/mem0pool.c
+++ b/innobase/mem/mem0pool.c
@@ -566,6 +566,7 @@ mem_area_free(
ut_ad(mem_pool_validate(pool));
}
+#ifdef UNIV_DEBUG
/************************************************************************
Validates a memory pool. */
@@ -643,6 +644,7 @@ mem_pool_print_info(
pool->reserved);
mutex_exit(&(pool->mutex));
}
+#endif /* UNIV_DEBUG */
/************************************************************************
Returns the amount of reserved memory. */
diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c
index aaf2c9601f4..46473cb3ffe 100644
--- a/innobase/mtr/mtr0mtr.c
+++ b/innobase/mtr/mtr0mtr.c
@@ -508,6 +508,7 @@ mtr_read_dulint(
return(mach_read_from_8(ptr));
}
+#ifdef UNIV_DEBUG
/*************************************************************
Prints info of an mtr handle. */
@@ -521,3 +522,4 @@ mtr_print(
dyn_array_get_data_size(&(mtr->memo)),
dyn_array_get_data_size(&(mtr->log)));
}
+#endif /* UNIV_DEBUG */
diff --git a/innobase/pars/pars0opt.c b/innobase/pars/pars0opt.c
index 5cc2e39b438..98bb1b12396 100644
--- a/innobase/pars/pars0opt.c
+++ b/innobase/pars/pars0opt.c
@@ -1190,6 +1190,7 @@ opt_search_plan(
#endif
}
+#ifdef UNIV_SQL_DEBUG
/************************************************************************
Prints info of a query plan. */
@@ -1235,3 +1236,4 @@ opt_print_query_plan(
UT_LIST_GET_LEN(plan->end_conds));
}
}
+#endif /* UNIV_SQL_DEBUG */
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index f9b66b6e5fc..4a7d5448c52 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -1348,7 +1348,9 @@ NetWare. */
os_thread_create(&srv_master_thread, NULL, thread_ids + 1 +
SRV_MAX_N_IO_THREADS);
+#ifdef UNIV_DEBUG
/* buf_debug_prints = TRUE; */
+#endif /* UNIV_DEBUG */
sum_of_data_file_sizes = 0;
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index e3caa24cb1e..9dd5148e27a 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -157,6 +157,7 @@ rw_lock_free(
mutex_exit(&rw_lock_list_mutex);
}
+#ifdef UNIV_DEBUG
/**********************************************************************
Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */
@@ -184,6 +185,7 @@ rw_lock_validate(
return(TRUE);
}
+#endif /* UNIV_DEBUG */
/**********************************************************************
Lock an rw-lock in shared mode for the current thread. If the rw-lock is
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 3539d7de817..c534dc6823d 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -275,6 +275,7 @@ mutex_enter_nowait(
return(1);
}
+#ifdef UNIV_DEBUG
/**********************************************************************
Checks that the mutex has been initialized. */
@@ -288,6 +289,7 @@ mutex_validate(
return(TRUE);
}
+#endif /* UNIV_DEBUG */
/**********************************************************************
Sets the waiters field in a mutex. */
@@ -1034,8 +1036,11 @@ sync_thread_add_level(
} else if (level == SYNC_DICT_HEADER) {
ut_a(sync_thread_levels_g(array, SYNC_DICT_HEADER));
} else if (level == SYNC_DICT) {
- ut_a(buf_debug_prints
- || sync_thread_levels_g(array, SYNC_DICT));
+ ut_a(
+#ifdef UNIV_DEBUG
+ buf_debug_prints ||
+#endif /* UNIV_DEBUG */
+ sync_thread_levels_g(array, SYNC_DICT));
} else {
ut_error;
}
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index eed5e79a20f..92a5373aabd 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -1140,10 +1140,12 @@ trx_finish_rollback_off_kernel(
return;
}
+#ifdef UNIV_DEBUG
if (lock_print_waits) {
fprintf(stderr, "Trx %lu rollback finished\n",
ut_dulint_get_low(trx->id));
}
+#endif /* UNIV_DEBUG */
trx_commit_off_kernel(trx);
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c
index e0c30df17af..b52ec2bae0f 100644
--- a/innobase/trx/trx0sys.c
+++ b/innobase/trx/trx0sys.c
@@ -599,6 +599,7 @@ trx_sys_update_mysql_binlog_offset(
MLOG_4BYTES, mtr);
}
+#ifdef UNIV_HOTBACKUP
/*********************************************************************
Prints to stderr the MySQL binlog info in the system header if the
magic number shows it valid. */
@@ -626,6 +627,7 @@ trx_sys_print_mysql_binlog_offset_from_page(
sys_header + TRX_SYS_MYSQL_LOG_INFO + TRX_SYS_MYSQL_LOG_NAME);
}
}
+#endif /* UNIV_HOTBACKUP */
/*********************************************************************
Prints to stderr the MySQL binlog offset info in the trx system header if