mysql – HAVE_PSI_INTERFACE宏用于什么?

前端之家收集整理的这篇文章主要介绍了mysql – HAVE_PSI_INTERFACE宏用于什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我一直在阅读MySQL 5.5的源代码,并对宏HAVE_PSI_INTERFACE感到困惑,它出现在整个项目的许多源文件中.

例如,在源文件storage / example / ha_example.cc中,有以下代码

  1. #ifdef HAVE_PSI_INTERFACE
  2. static PSI_mutex_key ex_key_mutex_example,ex_key_mutex_EXAMPLE_SHARE_mutex;
  3. static PSI_mutex_info all_example_mutexes[]=
  4. {
  5. { &ex_key_mutex_example,"example",PSI_FLAG_GLOBAL},{ &ex_key_mutex_EXAMPLE_SHARE_mutex,"EXAMPLE_SHARE::mutex",0}
  6. };
  7. static void init_example_psi_keys()
  8. {
  9. const char* category= "example";
  10. int count;
  11. if (PSI_server == NULL)
  12. return;
  13. count= array_elements(all_example_mutexes);
  14. PSI_server->register_mutex(category,all_example_mutexes,count);
  15. }
  16. #endif

那么HAVE_PSI_INTERFACE意味着什么?具体来说,PSI代表什么?什么是宏HAVE_PSI_INTERFACE用于?

谢谢.

最佳答案
PSI代表:性能模式检测接口.

你可以找到一个psi.h文件here(带注释)

猜你在找的MySQL相关文章