Commit 5fed4f3a authored by unknown's avatar unknown
Browse files

InnoDB: Remove unreachable debug code from non-debug builds.


innobase/buf/buf0buf.c:
  Remove buf_dbg_counter unless #ifdef UNIV_DEBUG
  Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/buf/buf0flu.c:
  Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/buf/buf0lru.c:
  Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/buf/buf0rea.c:
  Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/include/buf0buf.h:
  Remove buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/include/buf0buf.ic:
  Remove buf_dbg_counter unless #ifdef UNIV_DEBUG
innobase/include/log0log.h:
  Remove log_do_write and log_debug_writes unless #ifdef UNIV_DEBUG
innobase/log/log0log.c:
  Remove log_do_write and log_debug_writes unless #ifdef UNIV_DEBUG
innobase/log/log0recv.c:
  Remove log_debug_writes unless #ifdef UNIV_DEBUG
innobase/srv/srv0start.c:
  Remove log_do_write and buf_debug_prints unless #ifdef UNIV_DEBUG
innobase/sync/sync0sync.c:
  Remove buf_debug_prints unless #ifdef UNIV_DEBUG
parent 113c6278
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -223,13 +223,14 @@ in the free list to the frames.

buf_pool_t*	buf_pool = NULL; /* The buffer buf_pool of the database */

#ifdef UNIV_DEBUG
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
to a file. Note that we must be careful to calculate the same value on
@@ -1739,10 +1740,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",
			(ulong) space, (ulong) offset);
	}
#endif /* UNIV_DEBUG */

	block = free_block;
	
@@ -1893,9 +1896,11 @@ buf_page_io_complete(

		rw_lock_x_unlock_gen(&(block->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);

@@ -1908,17 +1913,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",
			(ulong) block->space, (ulong) block->offset);
	}
#endif /* UNIV_DEBUG */
}

/*************************************************************************
+6 −0
Original line number Diff line number Diff line
@@ -586,11 +586,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",
				(ulong) block->space, (ulong) block->offset);
		}
#endif /* UNIV_DEBUG */

		buf_flush_write_block_low(block);
		
@@ -674,12 +676,14 @@ 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",
						(ulong) block->space,
			                        (ulong) block->offset);
		}
#endif /* UNIV_DEBUG */

		buf_flush_write_block_low(block);
		
@@ -906,6 +910,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);
@@ -914,6 +919,7 @@ buf_flush_batch(
			: "Flushed %lu pages in flush list flush\n",
			(ulong) page_count);
	}
#endif /* UNIV_DEBUG */
	
        if (page_count != ULINT_UNDEFINED)
          srv_buf_pool_flushed+= page_count;
+2 −0
Original line number Diff line number Diff line
@@ -213,12 +213,14 @@ buf_LRU_search_and_free_block(
	        ut_a(block->in_LRU_list);
		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",
					(ulong) block->space,
				        (ulong) block->offset);
			}
#endif /* UNIV_DEBUG */

			buf_LRU_block_remove_hashed_page(block);

+8 −0
Original line number Diff line number Diff line
@@ -288,12 +288,14 @@ 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",
						(ulong) space, (ulong) offset,
		       				(ulong) count);
	}
#endif /* UNIV_DEBUG */

        ++srv_read_ahead_rnd;
	return(count);
@@ -575,11 +577,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",
		(ulong) space, (ulong) offset, (ulong) count);
	}
#endif /* UNIV_DEBUG */

        ++srv_read_ahead_seq;
	return(count);
@@ -641,11 +645,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",
				(ulong) space_ids[0], (ulong) n_stored);
	}
#endif /* UNIV_DEBUG */
}

/************************************************************************
@@ -711,8 +717,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", (ulong) n_stored);
	}
#endif /* UNIV_DEBUG */
}
+2 −0
Original line number Diff line number Diff line
@@ -56,9 +56,11 @@ Created 11/5/1995 Heikki Tuuri
#define BUF_NO_CHECKSUM_MAGIC 0xDEADBEEFUL

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 */
extern ulint srv_buf_pool_write_requests; /* variable to count write request
                                          issued */

Loading