Commit 2575b77a authored by Mikael Ronstrom's avatar Mikael Ronstrom

Added counter of number of missed wakeups of InnoDB threads

parent f3b2bf77
......@@ -433,6 +433,8 @@ static SHOW_VAR innodb_status_variables[]= {
(char*) &export_vars.innodb_rows_read, SHOW_LONG},
{"rows_updated",
(char*) &export_vars.innodb_rows_updated, SHOW_LONG},
{"wake_ups",
(char*) &export_vars.innodb_wake_ups, SHOW_LONG},
{NullS, NullS, SHOW_LONG}
};
......
......@@ -251,6 +251,9 @@ extern ulint srv_read_ahead_seq;
/* variable to count the number of random read-aheads were done */
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 */
typedef struct export_var_struct export_struc;
......@@ -545,6 +548,7 @@ struct export_var_struct{
ulint innodb_rows_inserted;
ulint innodb_rows_updated;
ulint innodb_rows_deleted;
ulint innodb_wake_ups;
};
/* The server system struct */
......
......@@ -1939,6 +1939,7 @@ srv_export_innodb_status(void)
export_vars.innodb_rows_inserted = srv_n_rows_inserted;
export_vars.innodb_rows_updated = srv_n_rows_updated;
export_vars.innodb_rows_deleted = srv_n_rows_deleted;
export_vars.innodb_wake_ups = sync_wake_ups;
mutex_exit(&srv_innodb_monitor_mutex);
}
......
......@@ -110,6 +110,10 @@ struct sync_array_struct {
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
/**********************************************************************
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_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;
......@@ -884,6 +892,7 @@ sync_arr_wake_threads_if_sema_free(void)
event = sync_cell_get_event(cell);
os_event_set(event);
sync_wake_ups++;
}
}
......
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