Commit c2f508b3 authored by marko's avatar marko

Send all SHOW ENGINE INNODB STATUS information to the client also when

UNIV_SYNC_DEBUG is defined.

rw_lock_list_print_info(): Add parameter "file".

mutex_list_print_info(): Add parameter "file".  Make the function static.
parent 0298d355
......@@ -358,8 +358,9 @@ rw_lock_print(
Prints debug info of currently locked rw-locks. */
void
rw_lock_list_print_info(void);
/*=========================*/
rw_lock_list_print_info(
/*====================*/
FILE* file); /* in: file where to print */
/*******************************************************************
Returns the number of currently locked rw-locks.
Works only in the debug version. */
......
......@@ -224,12 +224,6 @@ Counts currently reserved mutexes. Works only in the debug version. */
ulint
mutex_n_reserved(void);
/*==================*/
/**********************************************************************
Prints debug info of currently reserved mutexes. */
void
mutex_list_print_info(void);
/*========================*/
#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
NOT to be used outside this module except in debugging! Gets the value
......
......@@ -758,8 +758,9 @@ rw_lock_is_locked(
Prints debug info of currently locked rw-locks. */
void
rw_lock_list_print_info(void)
/*=========================*/
rw_lock_list_print_info(
/*====================*/
FILE* file) /* in: file where to print */
{
rw_lock_t* lock;
ulint count = 0;
......@@ -769,7 +770,7 @@ rw_lock_list_print_info(void)
fputs("-------------\n"
"RW-LATCH INFO\n"
"-------------\n", stderr);
"-------------\n", file);
lock = UT_LIST_GET_FIRST(rw_lock_list);
......@@ -783,12 +784,12 @@ rw_lock_list_print_info(void)
|| (rw_lock_get_reader_count(lock) != 0)
|| (rw_lock_get_waiters(lock) != 0)) {
fprintf(stderr, "RW-LOCK: %p ", (void*) lock);
fprintf(file, "RW-LOCK: %p ", (void*) lock);
if (rw_lock_get_waiters(lock)) {
fputs(" Waiters for the lock exist\n", stderr);
fputs(" Waiters for the lock exist\n", file);
} else {
putc('\n', stderr);
putc('\n', file);
}
info = UT_LIST_GET_FIRST(lock->debug_list);
......@@ -802,7 +803,7 @@ rw_lock_list_print_info(void)
lock = UT_LIST_GET_NEXT(list, lock);
}
fprintf(stderr, "Total number of rw-locks %ld\n", count);
fprintf(file, "Total number of rw-locks %ld\n", count);
mutex_exit(&rw_lock_list_mutex);
}
......
......@@ -628,10 +628,11 @@ mutex_own(
/**********************************************************************
Prints debug info of currently reserved mutexes. */
static
void
mutex_list_print_info(void)
/*=======================*/
mutex_list_print_info(
/*==================*/
FILE* file) /* in: file where to print */
{
mutex_t* mutex;
const char* file_name;
......@@ -641,7 +642,7 @@ mutex_list_print_info(void)
fputs("----------\n"
"MUTEX INFO\n"
"----------\n", stderr);
"----------\n", file);
mutex_enter(&mutex_list_mutex);
......@@ -653,7 +654,7 @@ mutex_list_print_info(void)
if (mutex_get_lock_word(mutex) != 0) {
mutex_get_debug_info(mutex, &file_name, &line,
&thread_id);
fprintf(stderr,
fprintf(file,
"Locked mutex: addr %p thread %ld"
" file %s line %ld\n",
(void*) mutex, os_thread_pf(thread_id),
......@@ -663,7 +664,7 @@ mutex_list_print_info(void)
mutex = UT_LIST_GET_NEXT(list, mutex);
}
fprintf(stderr, "Total number of mutexes %ld\n", count);
fprintf(file, "Total number of mutexes %ld\n", count);
mutex_exit(&mutex_list_mutex);
}
......@@ -1343,7 +1344,7 @@ sync_print_wait_info(
FILE* file) /* in: file where to print */
{
#ifdef UNIV_SYNC_DEBUG
fprintf(stderr, "Mutex exits %lu, rws exits %lu, rwx exits %lu\n",
fprintf(file, "Mutex exits %lu, rws exits %lu, rwx exits %lu\n",
mutex_exit_count, rw_s_exit_count, rw_x_exit_count);
#endif
......@@ -1369,9 +1370,9 @@ sync_print(
FILE* file) /* in: file where to print */
{
#ifdef UNIV_SYNC_DEBUG
mutex_list_print_info();
mutex_list_print_info(file);
rw_lock_list_print_info();
rw_lock_list_print_info(file);
#endif /* UNIV_SYNC_DEBUG */
sync_array_print_info(file, sync_primary_wait_array);
......
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