InnoDB: Remove debug functions unless #ifdef UNIV_DEBUG

innobase/btr/btr0btr.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/buf/buf0buf.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/buf/buf0flu.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/buf/buf0lru.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/buf/buf0rea.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/data/data0type.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/dict/dict0dict.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/fsp/fsp0fsp.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/fut/fut0lst.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/ibuf/ibuf0ibuf.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/btr0btr.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/buf0buf.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/buf0buf.ic:
  Remove global declaration of buf_dbg_counter
innobase/include/buf0flu.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/buf0lru.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/data0type.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/dict0dict.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/fsp0fsp.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/fut0lst.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/lock0lock.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/mem0dbg.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/mem0dbg.ic:
  Add #ifdef UNIV_MEM_DEBUG around debug code
innobase/include/mem0pool.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/mtr0mtr.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/pars0opt.h:
  Add #ifdef UNIV_SQL_DEBUG around debug code
innobase/include/sync0rw.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/sync0sync.h:
  Add #ifdef UNIV_DEBUG around debug code
innobase/include/trx0sys.h:
  Add #ifdef UNIV_HOTBACKUP around InnoDB Hot Backup specific code
innobase/lock/lock0lock.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/mem/mem0dbg.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/mem/mem0pool.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/mtr/mtr0mtr.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/pars/pars0opt.c:
  Add #ifdef UNIV_SQL_DEBUG around debug code
innobase/srv/srv0start.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/sync/sync0rw.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/sync/sync0sync.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/trx/trx0roll.c:
  Add #ifdef UNIV_DEBUG around debug code
innobase/trx/trx0sys.c:
  Add #ifdef UNIV_HOTBACKUP around InnoDB Hot Backup specific code
This commit is contained in:
unknown 2004-04-07 14:19:26 +03:00
commit 095d64633b
38 changed files with 144 additions and 24 deletions

View file

@ -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. */

View file

@ -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 */

View file

@ -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 */

View file

@ -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 */
}