MySQL 8.0.29
Source Code Documentation
pfs_instr.h File Reference

Performance schema instruments (declarations). More...

Go to the source code of this file.

Classes

struct  PFS_instr
 Base structure for wait instruments. More...
 
struct  PFS_mutex
 Instrumented mutex implementation. More...
 
struct  PFS_rwlock
 Instrumented rwlock implementation. More...
 
struct  PFS_cond
 Instrumented condition implementation. More...
 
struct  PFS_file
 Instrumented File and FILE implementation. More...
 
struct  PFS_table
 Instrumented table implementation. More...
 
struct  PFS_socket
 Instrumented socket implementation. More...
 
struct  PFS_metadata_lock
 Instrumented metadata lock implementation. More...
 
struct  PFS_thread
 Instrumented thread implementation. More...
 

Macros

#define WAIT_STACK_LOGICAL_SIZE   5
 Maximum number of nested waits. More...
 
#define WAIT_STACK_BOTTOM   1
 Maximum number dummy waits records. More...
 
#define WAIT_STACK_SIZE   (WAIT_STACK_BOTTOM + WAIT_STACK_LOGICAL_SIZE)
 Physical size of the waits stack. More...
 

Functions

void carry_global_memory_stat_alloc_delta (PFS_memory_stat_alloc_delta *delta, uint index)
 
void carry_global_memory_stat_free_delta (PFS_memory_stat_free_delta *delta, uint index)
 
PFS_mutexsanitize_mutex (PFS_mutex *unsafe)
 
PFS_rwlocksanitize_rwlock (PFS_rwlock *unsafe)
 
PFS_condsanitize_cond (PFS_cond *unsafe)
 
PFS_threadsanitize_thread (PFS_thread *unsafe)
 Sanitize a PFS_thread pointer. More...
 
PFS_filesanitize_file (PFS_file *unsafe)
 
PFS_socketsanitize_socket (PFS_socket *unsafe)
 
PFS_metadata_locksanitize_metadata_lock (PFS_metadata_lock *unsafe)
 
int init_instruments (const PFS_global_param *param)
 Initialize all the instruments instance buffers. More...
 
void cleanup_instruments (void)
 Cleanup all the instruments buffers. More...
 
int init_file_hash (const PFS_global_param *param)
 Initialize the file name hash. More...
 
void cleanup_file_hash (void)
 Cleanup the file name hash. More...
 
PFS_mutexcreate_mutex (PFS_mutex_class *klass, const void *identity)
 Create instrumentation for a mutex instance. More...
 
void destroy_mutex (PFS_mutex *pfs)
 Destroy instrumentation for a mutex instance. More...
 
PFS_rwlockcreate_rwlock (PFS_rwlock_class *klass, const void *identity)
 Create instrumentation for a rwlock instance. More...
 
void destroy_rwlock (PFS_rwlock *pfs)
 Destroy instrumentation for a rwlock instance. More...
 
PFS_condcreate_cond (PFS_cond_class *klass, const void *identity)
 Create instrumentation for a condition instance. More...
 
void destroy_cond (PFS_cond *pfs)
 Destroy instrumentation for a condition instance. More...
 
PFS_threadcreate_thread (PFS_thread_class *klass, PSI_thread_seqnum seqnum, const void *identity, ulonglong processlist_id)
 Create instrumentation for a thread instance. More...
 
PFS_threadfind_thread_by_processlist_id (ulonglong processlist_id)
 Find a PFS thread given a processlist id. More...
 
PFS_threadfind_thread_by_internal_id (ulonglong thread_id)
 Find a PFS thread given an internal thread id. More...
 
void destroy_thread (PFS_thread *pfs)
 Destroy instrumentation for a thread instance. More...
 
PFS_filefind_or_create_file (PFS_thread *thread, PFS_file_class *klass, const char *filename, uint len, bool create)
 Find or create instrumentation for a file instance by file name. More...
 
PFS_filestart_file_rename (PFS_thread *thread, const char *old_name)
 Before the rename operation: Find the file instrumentation by name, then delete the filename from the filename hash. More...
 
int end_file_rename (PFS_thread *thread, PFS_file *pfs, const char *new_name, int rename_result)
 After the rename operation: Assign the new filename to the file instrumentation instance, then add to the filename hash. More...
 
PFS_filefind_file (PFS_thread *thread, PFS_file_class *klass, const char *filename, uint len)
 Find a file instrumentation instance by name. More...
 
void release_file (PFS_file *pfs)
 Release instrumentation for a file instance. More...
 
void delete_file_name (PFS_thread *thread, PFS_file *pfs)
 Delete file name from the hash table. More...
 
void destroy_file (PFS_thread *thread, PFS_file *pfs, bool delete_name)
 Destroy instrumentation for a file instance. More...
 
PFS_tablecreate_table (PFS_table_share *share, PFS_thread *opening_thread, const void *identity)
 Create instrumentation for a table instance. More...
 
void destroy_table (PFS_table *pfs)
 Destroy instrumentation for a table instance. More...
 
PFS_socketcreate_socket (PFS_socket_class *klass, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)
 Create instrumentation for a socket instance. More...
 
void destroy_socket (PFS_socket *pfs)
 Destroy instrumentation for a socket instance. More...
 
PFS_metadata_lockcreate_metadata_lock (void *identity, const MDL_key *mdl_key, opaque_mdl_type mdl_type, opaque_mdl_duration mdl_duration, opaque_mdl_status mdl_status, const char *src_file, uint src_line)
 
void destroy_metadata_lock (PFS_metadata_lock *pfs)
 
void reset_events_waits_by_instance (void)
 Reset the wait statistics per object instance. More...
 
void reset_file_instance_io (void)
 Reset the I/O statistics per file instance. More...
 
void reset_socket_instance_io (void)
 Reset the I/O statistics per socket instance. More...
 
void reset_histogram_global ()
 
void aggregate_all_event_names (PFS_single_stat *from_array, PFS_single_stat *to_array)
 
void aggregate_all_event_names (PFS_single_stat *from_array, PFS_single_stat *to_array_1, PFS_single_stat *to_array_2)
 
void aggregate_all_stages (PFS_stage_stat *from_array, PFS_stage_stat *to_array)
 
void aggregate_all_stages (PFS_stage_stat *from_array, PFS_stage_stat *to_array_1, PFS_stage_stat *to_array_2)
 
void aggregate_all_statements (PFS_statement_stat *from_array, PFS_statement_stat *to_array)
 
void aggregate_all_statements (PFS_statement_stat *from_array, PFS_statement_stat *to_array_1, PFS_statement_stat *to_array_2)
 
void aggregate_all_transactions (PFS_transaction_stat *from_array, PFS_transaction_stat *to_array)
 
void aggregate_all_transactions (PFS_transaction_stat *from_array, PFS_transaction_stat *to_array_1, PFS_transaction_stat *to_array_2)
 
void aggregate_all_errors (PFS_error_stat *from_array, PFS_error_stat *to_array)
 
void aggregate_all_errors (PFS_error_stat *from_array, PFS_error_stat *to_array_1, PFS_error_stat *to_array_2)
 
void aggregate_all_memory_with_reassign (bool alive, PFS_memory_safe_stat *from_array, PFS_memory_shared_stat *to_array, PFS_memory_shared_stat *global_array)
 
void aggregate_all_memory_with_reassign (bool alive, PFS_memory_safe_stat *from_array, PFS_memory_shared_stat *to_array_1, PFS_memory_shared_stat *to_array_2, PFS_memory_shared_stat *global_array)
 
void aggregate_all_memory (bool alive, PFS_memory_safe_stat *from_array, PFS_memory_shared_stat *to_array)
 
void aggregate_all_memory (bool alive, PFS_memory_shared_stat *from_array, PFS_memory_shared_stat *to_array)
 
void aggregate_all_memory (bool alive, PFS_memory_shared_stat *from_array, PFS_memory_shared_stat *to_array_1, PFS_memory_shared_stat *to_array_2)
 
void aggregate_thread (PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void aggregate_thread_waits (PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void aggregate_thread_stages (PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void aggregate_thread_statements (PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void aggregate_thread_transactions (PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void aggregate_thread_errors (PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void aggregate_thread_memory (bool alive, PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void aggregate_thread_status (PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
 
void clear_thread_account (PFS_thread *thread)
 
void set_thread_account (PFS_thread *thread)
 
void update_mutex_derived_flags ()
 Update derived flags for all mutex instances. More...
 
void update_rwlock_derived_flags ()
 Update derived flags for all rwlock instances. More...
 
void update_cond_derived_flags ()
 Update derived flags for all condition instances. More...
 
void update_file_derived_flags ()
 Update derived flags for all file handles. More...
 
void update_table_derived_flags ()
 Update derived flags for all table handles. More...
 
void update_socket_derived_flags ()
 Update derived flags for all socket instances. More...
 
void update_metadata_derived_flags ()
 Update derived flags for all metadata instances. More...
 
void update_thread_derived_flags ()
 Update derived flags for all thread instances. More...
 
void update_instruments_derived_flags ()
 Update derived flags for all instruments. More...
 
void reset_source_file_pointers ()
 Clear the source file pointers from all waits, stages, statements and transaction events. More...
 

Variables

PFS_single_statthread_instr_class_waits_array_start
 
PFS_single_statthread_instr_class_waits_array_end
 
uint statement_stack_max
 Max size of the statements stack. More...
 
size_t pfs_max_digest_length
 Max size of the digests token array. More...
 
size_t pfs_max_sqltext
 Max size of SQL TEXT. More...
 
PFS_stage_statglobal_instr_class_stages_array
 
PFS_statement_statglobal_instr_class_statements_array
 
PFS_histogram global_statements_histogram
 
std::atomic< PFS_memory_shared_stat * > global_instr_class_memory_array
 
long file_handle_max
 Size of the file handle array. More...
 
ulong file_handle_lost
 Number of file handle lost. More...
 
ulong events_waits_history_per_thread
 Number of EVENTS_WAITS_HISTORY records per thread. More...
 
ulong events_stages_history_per_thread
 Number of EVENTS_STAGES_HISTORY records per thread. More...
 
ulong events_statements_history_per_thread
 Number of EVENTS_STATEMENTS_HISTORY records per thread. More...
 
ulong events_transactions_history_per_thread
 Number of EVENTS_TRANSACTIONS_HISTORY records per thread. More...
 
ulong locker_lost
 Number of locker lost. More...
 
ulong statement_lost
 Number of statements lost. More...
 
ulong session_connect_attrs_lost
 Number of connection attributes lost. More...
 
ulong session_connect_attrs_longest_seen
 Longest connection attributes string seen so far, pre-truncation. More...
 
ulong session_connect_attrs_size_per_thread
 Size of connection attribute storage per thread. More...
 
PFS_file ** file_handle_array
 File instrumentation handle array. More...
 
LF_HASH filename_hash
 Hash table for instrumented files. More...
 

Detailed Description

Performance schema instruments (declarations).

Variable Documentation

◆ thread_instr_class_waits_array_end

PFS_single_stat* thread_instr_class_waits_array_end
extern

◆ thread_instr_class_waits_array_start

PFS_single_stat* thread_instr_class_waits_array_start
extern