16 #ifndef PFS_INSTR_CLASS_H
17 #define PFS_INSTR_CLASS_H
19 #include "my_global.h"
20 #include "mysql_com.h"
33 #define PFS_MAX_INFO_NAME_LENGTH 128
42 #define PFS_MAX_FULL_PREFIX_NAME_LENGTH 32
44 #include <my_global.h>
83 PFS_CLASS_STATEMENT= 7,
85 PFS_CLASS_TABLE_IO= 9,
86 PFS_CLASS_TABLE_LOCK= 10,
88 PFS_CLASS_LAST= PFS_CLASS_IDLE,
89 PFS_CLASS_MAX= PFS_CLASS_LAST + 1
106 extern int pfs_instr_config_state;
108 static const int PFS_INSTR_CONFIG_NOT_INITIALIZED= 0;
109 static const int PFS_INSTR_CONFIG_ALLOCATED= 1;
110 static const int PFS_INSTR_CONFIG_DEALLOCATED= 2;
114 extern uint mutex_class_start;
115 extern uint rwlock_class_start;
116 extern uint cond_class_start;
117 extern uint file_class_start;
118 extern uint socket_class_start;
119 extern uint wait_class_max;
147 bool is_singleton()
const
149 return m_flags & PSI_FLAG_GLOBAL;
154 bool is_deferred()
const
158 case PFS_CLASS_SOCKET:
245 {
return m_lock.get_version(); }
252 void aggregate_io(
void);
253 void aggregate_lock(
void);
255 inline void aggregate(
void)
261 inline void init_refcount(
void)
266 inline int get_refcount(
void)
271 inline void inc_refcount(
void)
276 inline void dec_refcount(
void)
281 void refresh_setup_object_flags(
PFS_thread *thread);
324 inline uint sanitize_index_count(uint count)
326 if (likely(count <= MAX_INDEXES))
331 #define GLOBAL_TABLE_IO_EVENT_INDEX 0
332 #define GLOBAL_TABLE_LOCK_EVENT_INDEX 1
333 #define GLOBAL_IDLE_EVENT_INDEX 2
393 void register_global_classes();
396 uint rwlock_class_sizing,
397 uint cond_class_sizing);
468 const char *schema_name, uint schema_name_length,
469 const char *
table_name, uint table_name_length);