Commit 85f3ed5f authored by Monty's avatar Monty Committed by Sergei Golubchik

Added malloc_calls to SHOW GLOBAL STATUS for DEBUG server

parent 0fceb752
...@@ -470,6 +470,7 @@ ulong aborted_threads, aborted_connects, aborted_connects_preauth; ...@@ -470,6 +470,7 @@ ulong aborted_threads, aborted_connects, aborted_connects_preauth;
ulong delayed_insert_timeout, delayed_insert_limit, delayed_queue_size; ulong delayed_insert_timeout, delayed_insert_limit, delayed_queue_size;
ulong delayed_insert_threads, delayed_insert_writes, delayed_rows_in_use; ulong delayed_insert_threads, delayed_insert_writes, delayed_rows_in_use;
ulong delayed_insert_errors,flush_time; ulong delayed_insert_errors,flush_time;
ulong malloc_calls;
ulong specialflag=0; ulong specialflag=0;
ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0;
...@@ -3606,6 +3607,10 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific) ...@@ -3606,6 +3607,10 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
{ {
THD *thd= current_thd; THD *thd= current_thd;
#ifndef DBUG_OFF
statistic_increment(malloc_calls, &LOCK_status);
#endif
/* /*
When thread specific is set, both mysqld_server_initialized and thd When thread specific is set, both mysqld_server_initialized and thd
must be set, and we check that with DBUG_ASSERT. must be set, and we check that with DBUG_ASSERT.
...@@ -7274,6 +7279,9 @@ SHOW_VAR status_vars[]= { ...@@ -7274,6 +7279,9 @@ SHOW_VAR status_vars[]= {
{"Handler_write", (char*) offsetof(STATUS_VAR, ha_write_count), SHOW_LONG_STATUS}, {"Handler_write", (char*) offsetof(STATUS_VAR, ha_write_count), SHOW_LONG_STATUS},
{"Key", (char*) &show_default_keycache, SHOW_FUNC}, {"Key", (char*) &show_default_keycache, SHOW_FUNC},
{"Last_query_cost", (char*) offsetof(STATUS_VAR, last_query_cost), SHOW_DOUBLE_STATUS}, {"Last_query_cost", (char*) offsetof(STATUS_VAR, last_query_cost), SHOW_DOUBLE_STATUS},
#ifndef DBUG_OFF
{"malloc_calls", (char*) &malloc_calls, SHOW_LONG},
#endif
{"Max_statement_time_exceeded", (char*) offsetof(STATUS_VAR, max_statement_time_exceeded), SHOW_LONG_STATUS}, {"Max_statement_time_exceeded", (char*) offsetof(STATUS_VAR, max_statement_time_exceeded), SHOW_LONG_STATUS},
{"Master_gtid_wait_count", (char*) offsetof(STATUS_VAR, master_gtid_wait_count), SHOW_LONG_STATUS}, {"Master_gtid_wait_count", (char*) offsetof(STATUS_VAR, master_gtid_wait_count), SHOW_LONG_STATUS},
{"Master_gtid_wait_timeouts", (char*) offsetof(STATUS_VAR, master_gtid_wait_timeouts), SHOW_LONG_STATUS}, {"Master_gtid_wait_timeouts", (char*) offsetof(STATUS_VAR, master_gtid_wait_timeouts), SHOW_LONG_STATUS},
...@@ -7610,6 +7618,7 @@ static int mysql_init_variables(void) ...@@ -7610,6 +7618,7 @@ static int mysql_init_variables(void)
abort_loop= select_thread_in_use= signal_thread_in_use= 0; abort_loop= select_thread_in_use= signal_thread_in_use= 0;
grant_option= 0; grant_option= 0;
aborted_threads= aborted_connects= aborted_connects_preauth= 0; aborted_threads= aborted_connects= aborted_connects_preauth= 0;
malloc_calls= 0;
subquery_cache_miss= subquery_cache_hit= 0; subquery_cache_miss= subquery_cache_hit= 0;
delayed_insert_threads= delayed_insert_writes= delayed_rows_in_use= 0; delayed_insert_threads= delayed_insert_writes= delayed_rows_in_use= 0;
delayed_insert_errors= thread_created= 0; delayed_insert_errors= thread_created= 0;
......
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