I read the source code for MySQL 5.5 and was confused by the HAVE_PSI_INTERFACE macro, which appeared in many of the source files for the entire project.
For example, in the repository / example of the source file / ha _example.cc there is the following code:
#ifdef HAVE_PSI_INTERFACE static PSI_mutex_key ex_key_mutex_example, ex_key_mutex_EXAMPLE_SHARE_mutex; static PSI_mutex_info all_example_mutexes[]= { { &ex_key_mutex_example, "example", PSI_FLAG_GLOBAL}, { &ex_key_mutex_EXAMPLE_SHARE_mutex, "EXAMPLE_SHARE::mutex", 0} }; static void init_example_psi_keys() { const char* category= "example"; int count; if (PSI_server == NULL) return; count= array_elements(all_example_mutexes); PSI_server->register_mutex(category, all_example_mutexes, count); } #endif
So what does HAVE_PSI_INTERFACE mean? In particular, what does PSI mean? What is the HAVE_PSI_INTERFACE macro used for?
Thanks.
source share