1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Added counter of number of missed wakeups of InnoDB threads

This commit is contained in:
Mikael Ronstrom
2008-11-17 22:54:32 +01:00
parent 602f612af0
commit c8d1b89f03
4 changed files with 17 additions and 1 deletions

View File

@@ -433,6 +433,8 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_rows_read, SHOW_LONG}, (char*) &export_vars.innodb_rows_read, SHOW_LONG},
{"rows_updated", {"rows_updated",
(char*) &export_vars.innodb_rows_updated, SHOW_LONG}, (char*) &export_vars.innodb_rows_updated, SHOW_LONG},
{"wake_ups",
(char*) &export_vars.innodb_wake_ups, SHOW_LONG},
{NullS, NullS, SHOW_LONG} {NullS, NullS, SHOW_LONG}
}; };

View File

@@ -251,6 +251,9 @@ extern ulint srv_read_ahead_seq;
/* variable to count the number of random read-aheads were done */ /* variable to count the number of random read-aheads were done */
extern ulint srv_read_ahead_rnd; extern ulint srv_read_ahead_rnd;
/* Number of threads that may have missed a lock wait wakeup */
extern ulint sync_wake_ups;
/* In this structure we store status variables to be passed to MySQL */ /* In this structure we store status variables to be passed to MySQL */
typedef struct export_var_struct export_struc; typedef struct export_var_struct export_struc;
@@ -545,6 +548,7 @@ struct export_var_struct{
ulint innodb_rows_inserted; ulint innodb_rows_inserted;
ulint innodb_rows_updated; ulint innodb_rows_updated;
ulint innodb_rows_deleted; ulint innodb_rows_deleted;
ulint innodb_wake_ups;
}; };
/* The server system struct */ /* The server system struct */

View File

@@ -1939,6 +1939,7 @@ srv_export_innodb_status(void)
export_vars.innodb_rows_inserted = srv_n_rows_inserted; export_vars.innodb_rows_inserted = srv_n_rows_inserted;
export_vars.innodb_rows_updated = srv_n_rows_updated; export_vars.innodb_rows_updated = srv_n_rows_updated;
export_vars.innodb_rows_deleted = srv_n_rows_deleted; export_vars.innodb_rows_deleted = srv_n_rows_deleted;
export_vars.innodb_wake_ups = sync_wake_ups;
mutex_exit(&srv_innodb_monitor_mutex); mutex_exit(&srv_innodb_monitor_mutex);
} }

View File

@@ -110,6 +110,10 @@ struct sync_array_struct {
since creation of the array */ since creation of the array */
}; };
/* Counts the number of times that sync_arr_wake_threads_if_sema_free has
* found a thread that can run because it may have missed a wakeup signal. */
ulint sync_wake_ups = 0;
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
/********************************************************************** /**********************************************************************
This function is called only in the debug version. Detects a deadlock This function is called only in the debug version. Detects a deadlock
@@ -481,7 +485,11 @@ sync_array_cell_print(
|| type == RW_LOCK_WAIT_EX || type == RW_LOCK_WAIT_EX
|| type == RW_LOCK_SHARED) { || type == RW_LOCK_SHARED) {
fputs(type == RW_LOCK_EX ? "X-lock on" : "S-lock on", file); switch(type) {
case RW_LOCK_EX: fputs("X-lock on", file); break;
case RW_LOCK_WAIT_EX: fputs("wait-X-lock on", file); break;
default: fputs("S-lock on", file); break;
}
rwlock = cell->old_wait_rw_lock; rwlock = cell->old_wait_rw_lock;
@@ -884,6 +892,7 @@ sync_arr_wake_threads_if_sema_free(void)
event = sync_cell_get_event(cell); event = sync_cell_get_event(cell);
os_event_set(event); os_event_set(event);
sync_wake_ups++;
} }
} }