Commit 97b49ef9 authored by marko's avatar marko

branches/zip: Add #define UNIV_DEBUG_FILE_ACCESSES to univ.i and

enclose all related debug code in #ifdef UNIV_DEBUG_FILE_ACCESSES.
This should have no effect on the behaviour, as the symbol is
not defined by default.  It only reduces the size of buf_block_t
and removes some assignments and debug functions.
parent 620f54ee
...@@ -612,7 +612,9 @@ buf_block_init( ...@@ -612,7 +612,9 @@ buf_block_init(
block->modify_clock = ut_dulint_zero; block->modify_clock = ut_dulint_zero;
#ifdef UNIV_DEBUG_FILE_ACCESSES
block->file_page_was_freed = FALSE; block->file_page_was_freed = FALSE;
#endif /* UNIV_DEBUG_FILE_ACCESSES */
block->check_index_page_at_flush = FALSE; block->check_index_page_at_flush = FALSE;
block->index = NULL; block->index = NULL;
...@@ -1222,6 +1224,7 @@ buf_page_peek( ...@@ -1222,6 +1224,7 @@ buf_page_peek(
return(FALSE); return(FALSE);
} }
#ifdef UNIV_DEBUG_FILE_ACCESSES
/************************************************************************ /************************************************************************
Sets file_page_was_freed TRUE if the page is found in the buffer pool. Sets file_page_was_freed TRUE if the page is found in the buffer pool.
This function should be called when we free a file page and want the This function should be called when we free a file page and want the
...@@ -1279,6 +1282,7 @@ buf_page_reset_file_page_was_freed( ...@@ -1279,6 +1282,7 @@ buf_page_reset_file_page_was_freed(
return(block); return(block);
} }
#endif /* UNIV_DEBUG_FILE_ACCESSES */
/************************************************************************ /************************************************************************
This is the general function used to get access to a database page. */ This is the general function used to get access to a database page. */
...@@ -1750,8 +1754,9 @@ buf_page_init_for_backup_restore( ...@@ -1750,8 +1754,9 @@ buf_page_init_for_backup_restore(
ut_ad(zip_size <= UNIV_PAGE_SIZE); ut_ad(zip_size <= UNIV_PAGE_SIZE);
ut_ad(ut_is_2pow(zip_size)); ut_ad(ut_is_2pow(zip_size));
block->page_zip.size = zip_size; block->page_zip.size = zip_size;
#ifdef UNIV_DEBUG_FILE_ACCESSES
block->file_page_was_freed = FALSE; block->file_page_was_freed = FALSE;
#endif /* UNIV_DEBUG_FILE_ACCESSES */
} }
#endif /* UNIV_HOTBACKUP */ #endif /* UNIV_HOTBACKUP */
...@@ -1819,7 +1824,9 @@ buf_page_init( ...@@ -1819,7 +1824,9 @@ buf_page_init(
block->n_bytes = 0; block->n_bytes = 0;
block->left_side = TRUE; block->left_side = TRUE;
#ifdef UNIV_DEBUG_FILE_ACCESSES
block->file_page_was_freed = FALSE; block->file_page_was_freed = FALSE;
#endif /* UNIV_DEBUG_FILE_ACCESSES */
} }
/************************************************************************ /************************************************************************
...@@ -1969,7 +1976,9 @@ buf_page_create( ...@@ -1969,7 +1976,9 @@ buf_page_create(
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
ut_a(ibuf_count_get(block->space, block->offset) == 0); ut_a(ibuf_count_get(block->space, block->offset) == 0);
#endif #endif
#ifdef UNIV_DEBUG_FILE_ACCESSES
block->file_page_was_freed = FALSE; block->file_page_was_freed = FALSE;
#endif /* UNIV_DEBUG_FILE_ACCESSES */
/* Page can be found in buf_pool */ /* Page can be found in buf_pool */
mutex_exit(&(buf_pool->mutex)); mutex_exit(&(buf_pool->mutex));
......
...@@ -295,6 +295,7 @@ buf_reset_check_index_page_at_flush( ...@@ -295,6 +295,7 @@ buf_reset_check_index_page_at_flush(
/*================================*/ /*================================*/
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint offset);/* in: page number */ ulint offset);/* in: page number */
#ifdef UNIV_DEBUG_FILE_ACCESSES
/************************************************************************ /************************************************************************
Sets file_page_was_freed TRUE if the page is found in the buffer pool. Sets file_page_was_freed TRUE if the page is found in the buffer pool.
This function should be called when we free a file page and want the This function should be called when we free a file page and want the
...@@ -307,7 +308,7 @@ buf_page_set_file_page_was_freed( ...@@ -307,7 +308,7 @@ buf_page_set_file_page_was_freed(
/* out: control block if found from page hash table, /* out: control block if found from page hash table,
otherwise NULL */ otherwise NULL */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint offset); /* in: page number */ ulint offset);/* in: page number */
/************************************************************************ /************************************************************************
Sets file_page_was_freed FALSE if the page is found in the buffer pool. Sets file_page_was_freed FALSE if the page is found in the buffer pool.
This function should be called when we free a file page and want the This function should be called when we free a file page and want the
...@@ -321,6 +322,7 @@ buf_page_reset_file_page_was_freed( ...@@ -321,6 +322,7 @@ buf_page_reset_file_page_was_freed(
otherwise NULL */ otherwise NULL */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint offset); /* in: page number */ ulint offset); /* in: page number */
#endif /* UNIV_DEBUG_FILE_ACCESSES */
/************************************************************************ /************************************************************************
Recommends a move of a block to the start of the LRU list if there is danger 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 of dropping from the buffer pool. NOTE: does not reserve the buffer pool
...@@ -821,9 +823,11 @@ struct buf_block_struct{ ...@@ -821,9 +823,11 @@ struct buf_block_struct{
an s-latch here; so we can use the an s-latch here; so we can use the
debug utilities in sync0rw */ debug utilities in sync0rw */
#endif #endif
#ifdef UNIV_DEBUG_FILE_ACCESSES
ibool file_page_was_freed; ibool file_page_was_freed;
/* this is set to TRUE when fsp /* this is set to TRUE when fsp
frees a page in buffer pool */ frees a page in buffer pool */
#endif /* UNIV_DEBUG_FILE_ACCESSES */
}; };
#define BUF_BLOCK_MAGIC_N 41526563 #define BUF_BLOCK_MAGIC_N 41526563
......
...@@ -80,6 +80,7 @@ memory is read outside the allocated blocks. */ ...@@ -80,6 +80,7 @@ memory is read outside the allocated blocks. */
#define UNIV_DEBUG_VALGRIND #define UNIV_DEBUG_VALGRIND
#define UNIV_DEBUG_PRINT #define UNIV_DEBUG_PRINT
#define UNIV_DEBUG #define UNIV_DEBUG
#define UNIV_DEBUG_FILE_ACCESSES
#define UNIV_LIST_DEBUG #define UNIV_LIST_DEBUG
#define UNIV_MEM_DEBUG #define UNIV_MEM_DEBUG
#define UNIV_IBUF_DEBUG #define UNIV_IBUF_DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment