Index: srv/srv0srv.c =================================================================== --- srv/srv0srv.c (revision 2464) +++ srv/srv0srv.c (working copy) @@ -1800,13 +1800,15 @@ srv_export_innodb_status(void) export_vars.innodb_buffer_pool_reads= srv_buf_pool_reads; export_vars.innodb_buffer_pool_read_ahead_rnd= srv_read_ahead_rnd; export_vars.innodb_buffer_pool_read_ahead_seq= srv_read_ahead_seq; export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU); export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list); export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free); +#ifdef UNIV_DEBUG export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number(); +#endif /* UNIV_DEBUG */ export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size; export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size - UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free); export_vars.innodb_page_size= UNIV_PAGE_SIZE; export_vars.innodb_log_waits= srv_log_waits; export_vars.innodb_os_log_written= srv_os_log_written; Index: buf/buf0buf.c =================================================================== --- buf/buf0buf.c (revision 2464) +++ buf/buf0buf.c (working copy) @@ -2257,12 +2257,13 @@ buf_print(void) mem_free(index_ids); mem_free(counts); ut_a(buf_validate()); } +#ifdef UNIV_DEBUG /************************************************************************* Returns the number of latched pages in the buffer pool. */ ulint buf_get_latched_pages_number(void) { @@ -2287,12 +2288,13 @@ buf_get_latched_pages_number(void) } } mutex_exit(&(buf_pool->mutex)); return fixed_pages_number; } +#endif /* UNIV_DEBUG */ /************************************************************************* Returns the number of pending buf pool ios. */ ulint buf_get_n_pending_ios(void) Index: handler/ha_innodb.cc =================================================================== --- handler/ha_innodb.cc (revision 2464) +++ handler/ha_innodb.cc (working copy) @@ -241,14 +241,16 @@ struct show_var_st innodb_status_variabl {"buffer_pool_pages_dirty", (char*) &export_vars.innodb_buffer_pool_pages_dirty, SHOW_LONG}, {"buffer_pool_pages_flushed", (char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG}, {"buffer_pool_pages_free", (char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG}, +#ifdef UNIV_DEBUG {"buffer_pool_pages_latched", (char*) &export_vars.innodb_buffer_pool_pages_latched, SHOW_LONG}, +#endif /* UNIV_DEBUG */ {"buffer_pool_pages_misc", (char*) &export_vars.innodb_buffer_pool_pages_misc, SHOW_LONG}, {"buffer_pool_pages_total", (char*) &export_vars.innodb_buffer_pool_pages_total, SHOW_LONG}, {"buffer_pool_read_ahead_rnd", (char*) &export_vars.innodb_buffer_pool_read_ahead_rnd, SHOW_LONG}, Index: include/srv0srv.h =================================================================== --- include/srv0srv.h (revision 2464) +++ include/srv0srv.h (working copy) @@ -528,13 +528,15 @@ struct export_var_struct{ ulint innodb_data_reads; ulint innodb_buffer_pool_pages_total; ulint innodb_buffer_pool_pages_data; ulint innodb_buffer_pool_pages_dirty; ulint innodb_buffer_pool_pages_misc; ulint innodb_buffer_pool_pages_free; +#ifdef UNIV_DEBUG ulint innodb_buffer_pool_pages_latched; +#endif /* UNIV_DEBUG */ ulint innodb_buffer_pool_read_requests; ulint innodb_buffer_pool_reads; ulint innodb_buffer_pool_wait_free; ulint innodb_buffer_pool_pages_flushed; ulint innodb_buffer_pool_write_requests; ulint innodb_buffer_pool_read_ahead_seq; Index: include/buf0buf.h =================================================================== --- include/buf0buf.h (revision 2464) +++ include/buf0buf.h (working copy) @@ -492,26 +492,29 @@ buf_validate(void); /************************************************************************* Prints info of the buffer pool data structure. */ void buf_print(void); /*============*/ + +/************************************************************************* +Returns the number of latched pages in the buffer pool. */ + +ulint +buf_get_latched_pages_number(void); +/*==============================*/ #endif /* UNIV_DEBUG */ + /************************************************************************ Prints a page to stderr. */ void buf_page_print( /*===========*/ byte* read_buf); /* in: a database page */ -/************************************************************************* -Returns the number of latched pages in the buffer pool. */ -ulint -buf_get_latched_pages_number(void); -/*==============================*/ /************************************************************************* Returns the number of pending buf pool ios. */ ulint buf_get_n_pending_ios(void); /*=======================*/