diff --git a/mysql-test/suite/perfschema/r/threads_innodb.result b/mysql-test/suite/perfschema/r/threads_innodb.result index d79420f6fb5..abfedb57644 100644 --- a/mysql-test/suite/perfschema/r/threads_innodb.result +++ b/mysql-test/suite/perfschema/r/threads_innodb.result @@ -6,4 +6,5 @@ WHERE name LIKE 'thread/innodb/%' GROUP BY name; name type processlist_user processlist_host processlist_db processlist_command processlist_time processlist_state processlist_info parent_thread_id role instrumented thread/innodb/page_cleaner_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES +thread/innodb/page_encrypt_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES thread/innodb/thread_pool_thread BACKGROUND NULL NULL NULL NULL NULL NULL NULL NULL NULL YES diff --git a/mysql-test/suite/perfschema/t/threads_innodb.opt b/mysql-test/suite/perfschema/t/threads_innodb.opt new file mode 100644 index 00000000000..bd33f76701e --- /dev/null +++ b/mysql-test/suite/perfschema/t/threads_innodb.opt @@ -0,0 +1 @@ +--innodb-encryption-threads=2 diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index fce308bcc81..7433e957d0a 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -80,6 +80,10 @@ static uint n_fil_crypt_iops_allocated = 0; #define DEBUG_KEYROTATION_THROTTLING 0 +#ifdef UNIV_PFS_THREAD +mysql_pfs_key_t page_encrypt_thread_key; +#endif /* UNIV_PFS_THREAD */ + /** Statistics variables */ static fil_crypt_stat_t crypt_stat; static ib_mutex_t crypt_stat_mutex; @@ -2145,6 +2149,10 @@ extern "C" UNIV_INTERN os_thread_ret_t DECLARE_THREAD(fil_crypt_thread)(void*) { + my_thread_init(); +#ifdef UNIV_PFS_THREAD + pfs_register_thread(page_encrypt_thread_key); +#endif /* UNIV_PFS_THREAD */ mutex_enter(&fil_crypt_threads_mutex); uint thread_no = srv_n_fil_crypt_threads_started; srv_n_fil_crypt_threads_started++; @@ -2242,6 +2250,7 @@ DECLARE_THREAD(fil_crypt_thread)(void*) /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ + my_thread_end(); return os_thread_exit(); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 890cdbaf429..e0d7e91c10b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -579,6 +579,7 @@ performance schema instrumented if "UNIV_PFS_THREAD" is defined */ static PSI_thread_info all_innodb_threads[] = { PSI_KEY(page_cleaner_thread), + PSI_KEY(page_encrypt_thread), PSI_KEY(trx_rollback_clean_thread), PSI_KEY(thread_pool_thread) }; diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 75718a92a10..fd615742ba3 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -469,6 +469,7 @@ extern ulong srv_buf_dump_status_frequency; # ifdef UNIV_PFS_THREAD extern mysql_pfs_key_t page_cleaner_thread_key; +extern mysql_pfs_key_t page_encrypt_thread_key; extern mysql_pfs_key_t trx_rollback_clean_thread_key; extern mysql_pfs_key_t thread_pool_thread_key;