6

MySQL 5.5 のソース コードを読んでいて、プロジェクト全体の多くのソース ファイルに表示されるマクロ HAVE_PSI_INTERFACE に混乱しました。

たとえば、ソース ファイル storage/example/ha_example.cc には、次のコードがあります。

#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

では、HAVE_PSI_INTERFACE は何を意味するのでしょうか? 具体的には、PSI は何の略ですか? そして、マクロ HAVE_PSI_INTERFACE は何に使用されますか?

ありがとう。

4

1 に答える 1

3

PSI の略: パフォーマンス スキーマ インストルメンテーション インターフェース。

ここで psi.h ファイルを見つけることができます(コメント付き)

于 2013-08-20T08:27:05.070 に答える