diff options
author | Marc Alff <marc.alff@sun.com> | 2009-12-04 18:26:15 -0700 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2009-12-04 18:26:15 -0700 |
commit | 04fe40393d9d0ef81cc6a770bda67ab67fe4154e (patch) | |
tree | 9ca152d7f2ac50cfd8b7fca83f87cb06148d97a0 /storage/myisam/mi_static.c | |
parent | 560e76c567c3551f5a4320acfc954200e8330ad8 (diff) | |
download | mariadb-git-04fe40393d9d0ef81cc6a770bda67ab67fe4154e.tar.gz |
WL#2360 Performance schema
Part II, engines instrumentation
Diffstat (limited to 'storage/myisam/mi_static.c')
-rw-r--r-- | storage/myisam/mi_static.c | 73 |
1 files changed, 72 insertions, 1 deletions
diff --git a/storage/myisam/mi_static.c b/storage/myisam/mi_static.c index a3ba785a94f..aaa7405bbb5 100644 --- a/storage/myisam/mi_static.c +++ b/storage/myisam/mi_static.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2002, 2004-2005 MySQL AB +/* Copyright (C) 2000-2002, 2004-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,3 +68,74 @@ uint NEAR myisam_readnext_vec[]= SEARCH_BIGGER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_BIGGER, SEARCH_SMALLER, SEARCH_SMALLER }; + +#ifdef HAVE_PSI_INTERFACE +PSI_mutex_key mi_key_mutex_MYISAM_SHARE_intern_lock, + mi_key_mutex_MI_SORT_INFO_mutex, mi_key_mutex_MI_CHECK_print_msg; + +static PSI_mutex_info all_myisam_mutexes[]= +{ + { &mi_key_mutex_MI_SORT_INFO_mutex, "MI_SORT_INFO::mutex", 0}, + { &mi_key_mutex_MYISAM_SHARE_intern_lock, "MYISAM_SHARE::intern_lock", 0}, + { &mi_key_mutex_MI_CHECK_print_msg, "MI_CHECK::print_msg", 0} +}; + +PSI_rwlock_key mi_key_rwlock_MYISAM_SHARE_key_root_lock, + mi_key_rwlock_MYISAM_SHARE_mmap_lock; + +static PSI_rwlock_info all_myisam_rwlocks[]= +{ + { &mi_key_rwlock_MYISAM_SHARE_key_root_lock, "MYISAM_SHARE::key_root_lock", 0}, + { &mi_key_rwlock_MYISAM_SHARE_mmap_lock, "MYISAM_SHARE::mmap_lock", 0} +}; + +PSI_cond_key mi_key_cond_MI_SORT_INFO_cond; + +static PSI_cond_info all_myisam_conds[]= +{ + { &mi_key_cond_MI_SORT_INFO_cond, "MI_SORT_INFO::cond", 0} +}; + +PSI_file_key mi_key_file_datatmp, mi_key_file_dfile, mi_key_file_kfile, + mi_key_file_log; + +static PSI_file_info all_myisam_files[]= +{ + { & mi_key_file_datatmp, "data_tmp", 0}, + { & mi_key_file_dfile, "dfile", 0}, + { & mi_key_file_kfile, "kfile", 0}, + { & mi_key_file_log, "log", 0} +}; + +PSI_thread_key mi_key_thread_find_all_keys; + +static PSI_thread_info all_myisam_threads[]= +{ + { &mi_key_thread_find_all_keys, "find_all_keys", 0}, +}; + +void init_myisam_psi_keys() +{ + const char* category= "myisam"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_myisam_mutexes); + PSI_server->register_mutex(category, all_myisam_mutexes, count); + + count= array_elements(all_myisam_rwlocks); + PSI_server->register_rwlock(category, all_myisam_rwlocks, count); + + count= array_elements(all_myisam_conds); + PSI_server->register_cond(category, all_myisam_conds, count); + + count= array_elements(all_myisam_files); + PSI_server->register_file(category, all_myisam_files, count); + + count= array_elements(all_myisam_threads); + PSI_server->register_thread(category, all_myisam_threads, count); +} +#endif /* HAVE_PSI_INTERFACE */ + |