summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authormarko@hundin.mysql.fi <>2005-05-06 11:45:59 +0300
committermarko@hundin.mysql.fi <>2005-05-06 11:45:59 +0300
commit2f0424cd62255a358bb359655fc8007cba3589cb (patch)
tree62eff238f5dc661e7e582eb505822b283b2a8fe9 /innobase
parent5496b7babbfdc0b689f21bdad4a3bee36dbf8754 (diff)
parentf9e7e2ee900fdde3f46a6d2399a0b52e3e9a1394 (diff)
downloadmariadb-git-2f0424cd62255a358bb359655fc8007cba3589cb.tar.gz
Merge
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/lock0lock.h11
-rw-r--r--innobase/include/srv0srv.h8
-rw-r--r--innobase/lock/lock0lock.c35
-rw-r--r--innobase/srv/srv0srv.c29
4 files changed, 61 insertions, 22 deletions
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index 710c945375c..45a81a4ac77 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -565,8 +565,15 @@ lock_rec_print(
Prints info of locks for all transactions. */
void
-lock_print_info(
-/*============*/
+lock_print_info_summary(
+/*====================*/
+ FILE* file); /* in: file where to print */
+/*************************************************************************
+Prints info of locks for each transaction. */
+
+void
+lock_print_info_all_transactions(
+/*=============================*/
FILE* file); /* in: file where to print */
/*************************************************************************
Validates the lock queue on a table. */
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index 4a1833a1a21..9d96a372291 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -466,9 +466,11 @@ Outputs to a file the output of the InnoDB Monitor. */
void
srv_printf_innodb_monitor(
/*======================*/
- FILE* file); /* in: output stream */
-/************************************************************************
-Function to pass InnoDB status variables to MySQL */
+ FILE* file, /* in: output stream */
+ ulint* trx_start, /* out: file position of the start of
+ the list of active transactions */
+ ulint* trx_end); /* out: file position of the end of
+ the list of active transactions */
void
srv_export_innodb_status(void);
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index 512f487b3f5..73ecc717e0e 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -4226,21 +4226,10 @@ lock_get_n_rec_locks(void)
Prints info of locks for all transactions. */
void
-lock_print_info(
-/*============*/
+lock_print_info_summary(
+/*====================*/
FILE* file) /* in: file where to print */
{
- lock_t* lock;
- trx_t* trx;
- ulint space;
- ulint page_no;
- page_t* page;
- ibool load_page_first = TRUE;
- ulint nth_trx = 0;
- ulint nth_lock = 0;
- ulint i;
- mtr_t mtr;
-
/* We must protect the MySQL thd->query field with a MySQL mutex, and
because the MySQL mutex must be reserved before the kernel_mutex of
InnoDB, we call innobase_mysql_prepare_print_arbitrary_thd() here. */
@@ -4279,6 +4268,26 @@ lock_print_info(
fprintf(file,
"Total number of lock structs in row lock hash table %lu\n",
(ulong) lock_get_n_rec_locks());
+}
+
+/*************************************************************************
+Prints info of locks for each transaction. */
+
+void
+lock_print_info_all_transactions(
+/*=============================*/
+ FILE* file) /* in: file where to print */
+{
+ lock_t* lock;
+ ulint space;
+ ulint page_no;
+ page_t* page;
+ ibool load_page_first = TRUE;
+ ulint nth_trx = 0;
+ ulint nth_lock = 0;
+ ulint i;
+ mtr_t mtr;
+ trx_t* trx;
fprintf(file, "LIST OF TRANSACTIONS FOR EACH SESSION:\n");
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index a4bfdb6162d..f901425a5f9 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1602,7 +1602,11 @@ Outputs to a file the output of the InnoDB Monitor. */
void
srv_printf_innodb_monitor(
/*======================*/
- FILE* file) /* in: output stream */
+ FILE* file, /* in: output stream */
+ ulint* trx_start, /* out: file position of the start of
+ the list of active transactions */
+ ulint* trx_end) /* out: file position of the end of
+ the list of active transactions */
{
double time_elapsed;
time_t current_time;
@@ -1651,7 +1655,24 @@ srv_printf_innodb_monitor(
mutex_exit(&dict_foreign_err_mutex);
- lock_print_info(file);
+ lock_print_info_summary(file);
+ if (trx_start) {
+ long t = ftell(file);
+ if (t < 0) {
+ *trx_start = ULINT_UNDEFINED;
+ } else {
+ *trx_start = (ulint) t;
+ }
+ }
+ lock_print_info_all_transactions(file);
+ if (trx_end) {
+ long t = ftell(file);
+ if (t < 0) {
+ *trx_end = ULINT_UNDEFINED;
+ } else {
+ *trx_end = (ulint) t;
+ }
+ }
fputs("--------\n"
"FILE I/O\n"
"--------\n", file);
@@ -1865,13 +1886,13 @@ loop:
last_monitor_time = time(NULL);
if (srv_print_innodb_monitor) {
- srv_printf_innodb_monitor(stderr);
+ srv_printf_innodb_monitor(stderr, NULL, NULL);
}
if (srv_innodb_status) {
mutex_enter(&srv_monitor_file_mutex);
rewind(srv_monitor_file);
- srv_printf_innodb_monitor(srv_monitor_file);
+ srv_printf_innodb_monitor(srv_monitor_file, NULL, NULL);
os_file_set_eof(srv_monitor_file);
mutex_exit(&srv_monitor_file_mutex);
}