2013-08-05 4 views
6

나는 MySQL 5.5 소스 코드를 읽었으며 전체 프로젝트의 많은 소스 파일에 나타나는 매크로 HAVE_PSI_INTERFACE에 혼란스러워했다.HAVE_PSI_INTERFACE 매크로는 무엇을 위해 사용됩니까?

#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은 무엇을 의미 하는가 :

예를 들어, 소스 파일 저장/예/ha_example.cc에서 다음 코드가? 특히, PSI는 무엇을 의미합니까? HAVE_PSI_INTERFACE 매크로는 무엇을 위해 사용됩니까?

감사합니다.

답변

3

PSI의 약자 : 성능 스키마 계측 인터페이스.

psi.h 파일을 찾을 수 있습니다. here (댓글과 함께)

+0

감사합니다. 최근 Instrumentation에 대해 더 많이 알고 있습니다. – lulyon

관련 문제