38class PFS_opaque_container_page;
54#ifdef HAVE_ARPA_INET_H
227 if (m_has_io_stats) {
228 safe_aggregate_io(server_share, &m_table_stat, m_share);
229 m_has_io_stats =
false;
231 if (m_has_lock_stats) {
232 safe_aggregate_lock(&m_table_stat, m_share);
233 m_has_lock_stats =
false;
244 void sanitized_aggregate(
void);
250 void sanitized_aggregate_io(
void);
256 void sanitized_aggregate_lock(
void);
278 static void safe_aggregate_io(
const TABLE_SHARE *optional_server_share,
350#define WAIT_STACK_LOGICAL_SIZE 5
357#define WAIT_STACK_BOTTOM 1
362#define WAIT_STACK_SIZE (WAIT_STACK_BOTTOM + WAIT_STACK_LOGICAL_SIZE)
652 struct sockaddr_storage m_sock_addr;
657 void reset_session_connect_attrs();
676 void rebase_memory_stats();
687 set_history_derived_flags();
690 void set_history_derived_flags();
701 m_has_memory_stats =
false;
702 m_instr_class_memory_stats = array;
706 if (!m_has_memory_stats) {
709 return m_instr_class_memory_stats;
713 if (!m_has_memory_stats) {
714 rebase_memory_stats();
715 m_has_memory_stats =
true;
717 return m_instr_class_memory_stats;
719 void mem_cnt_alloc(
size_t size);
720 void mem_cnt_free(
size_t size);
758 const void *identity,
ulonglong processlist_id);
778 const void *identity);
782 const struct sockaddr *addr, socklen_t addr_len);
789 const char *src_file,
uint src_line);
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
int opaque_mdl_duration
Definition: psi_mdl_bits.h:41
int opaque_mdl_status
Definition: psi_mdl_bits.h:44
int opaque_mdl_type
Definition: psi_mdl_bits.h:35
unsigned int PSI_thread_seqnum
Instrumented thread sequence number.
Definition: psi_thread_bits.h:58
Header for compiler-dependent features.
Common definition used by mysys, performance schema and server & client.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
uint32_t uint32
Definition: my_inttypes.h:66
Common #defines and includes for file and socket I/O.
static my_thread_id thread_id
Definition: my_thr_init.cc:62
Portable wrapper for gettid().
unsigned long long my_thread_os_id_t
Definition: my_thread_os_id.h:47
int my_socket
Definition: mysql.h:64
#define NAME_LEN
Definition: mysql_com.h:66
static mysql_service_status_t create(const char *service_names[], reference_caching_channel *out_channel) noexcept
Definition: component.cc:35
Data types for columns used in the performance schema tables (declarations)
#define COL_INFO_SIZE
Size of INFO columns, in bytes.
Definition: pfs_column_types.h:70
Performance schema connection slice (declarations).
Events waits data structures (declarations).
Events statements data structures (declarations).
Events transactions data structures (declarations).
Events waits data structures (declarations).
const char * filename
Definition: pfs_example_component_population.cc:66
#define PFS_ALIGNED
Definition: pfs_global.h:54
PFS_single_stat * thread_instr_class_waits_array_end
PFS_single_stat * thread_instr_class_waits_array_start
Performance schema instruments metadata (declarations).
#define PFS_MAX_OS_NAME_LENGTH
Maximum length of the thread os name.
Definition: pfs_instr_class.h:65
Performance schema internal locks (declarations).
Object names (declarations).
Private interface for the server (declarations).
Statistics (declarations).
required bool enabled
Definition: replication_group_member_actions.proto:32
struct sockaddr sockaddr
Definition: sock_probe_win32.h:62
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
Metadata lock object key.
Definition: mdl.h:364
Per account statistics.
Definition: pfs_account.h:66
Instrumentation metadata for a condition.
Definition: pfs_instr_class.h:337
Statistics for conditions usage.
Definition: pfs_stat.h:237
Instrumented condition implementation.
Definition: pfs_instr.h:159
const void * m_identity
Condition identity, typically a pthread_cond_t.
Definition: pfs_instr.h:168
PFS_cond_class * m_class
Condition class.
Definition: pfs_instr.h:170
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:165
PFS_cond_stat m_cond_stat
Condition instance usage statistics.
Definition: pfs_instr.h:172
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:161
bool m_timed
Timed flag.
Definition: pfs_instr.h:163
A connection slice, an arbitrary grouping of several connections.
Definition: pfs_con_slice.h:53
Statistics for all server errors.
Definition: pfs_stat.h:556
A stage record.
Definition: pfs_events_stages.h:44
A statement record.
Definition: pfs_events_statements.h:46
A transaction record.
Definition: pfs_events_transactions.h:84
A wait event record.
Definition: pfs_events_waits.h:68
Instrumentation metadata for a file.
Definition: pfs_instr_class.h:535
Definition: pfs_name.h:285
Statistics for FILE usage.
Definition: pfs_stat.h:307
Instrumented File and FILE implementation.
Definition: pfs_instr.h:176
uint32 get_version()
Definition: pfs_instr.h:177
PFS_file_class * m_class
File class.
Definition: pfs_instr.h:184
PFS_file_stat m_file_stat
File usage statistics.
Definition: pfs_instr.h:186
bool m_temporary
True if a temporary file.
Definition: pfs_instr.h:188
const void * m_identity
File identity.
Definition: pfs_instr.h:180
PFS_file_name m_file_name
File name.
Definition: pfs_instr.h:182
Performance schema global sizing parameters.
Definition: pfs_server.h:112
Definition: pfs_histogram.h:37
Definition: pfs_name.h:243
Per host statistics.
Definition: pfs_host.h:63
Base structure for wait instruments.
Definition: pfs_instr.h:88
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:96
bool m_enabled
Enabled flag.
Definition: pfs_instr.h:92
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:90
bool m_timed
Timed flag.
Definition: pfs_instr.h:94
Memory statistics.
Definition: pfs_stat.h:912
Definition: pfs_stat.h:936
Definition: pfs_stat.h:882
Definition: pfs_stat.h:887
Instrumentation metadata for a mutex.
Definition: pfs_instr_class.h:317
Statistics for mutex usage.
Definition: pfs_stat.h:176
Instrumented mutex implementation.
Definition: pfs_instr.h:100
const void * m_identity
Mutex identity, typically a pthread_mutex_t.
Definition: pfs_instr.h:109
PFS_mutex_class * m_class
Mutex class.
Definition: pfs_instr.h:111
bool m_timed
Timed flag.
Definition: pfs_instr.h:104
PFS_thread * m_owner
Current owner.
Definition: pfs_instr.h:115
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:102
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:106
PFS_mutex_stat m_mutex_stat
Instrument statistics.
Definition: pfs_instr.h:113
Instrumentation metadata for a read write lock.
Definition: pfs_instr_class.h:327
Statistics for rwlock usage.
Definition: pfs_stat.h:203
Instrumented rwlock implementation.
Definition: pfs_instr.h:126
uint m_readers
Current count of readers.
Definition: pfs_instr.h:143
PFS_thread * m_writer
Current writer thread.
Definition: pfs_instr.h:141
PFS_rwlock_class * m_class
RWLock class.
Definition: pfs_instr.h:137
PFS_rwlock_stat m_rwlock_stat
Instrument statistics.
Definition: pfs_instr.h:139
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:128
const void * m_identity
RWLock identity, typically a pthread_rwlock_t.
Definition: pfs_instr.h:135
bool m_timed
Timed flag.
Definition: pfs_instr.h:130
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:132
Definition: pfs_name.h:115
Definition: pfs_stat.h:1135
Single statistic.
Definition: pfs_stat.h:51
Instrumentation metadata for a socket.
Definition: pfs_instr_class.h:564
Statistics for SOCKET usage.
Definition: pfs_stat.h:874
Instrumented socket implementation.
Definition: pfs_instr.h:286
const void * m_identity
Socket identity, typically int.
Definition: pfs_instr.h:297
bool m_idle
Idle flag.
Definition: pfs_instr.h:307
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:288
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:292
bool m_timed
Timed flag.
Definition: pfs_instr.h:290
uint32 get_version()
Definition: pfs_instr.h:294
socklen_t m_addr_len
Length of address.
Definition: pfs_instr.h:305
PFS_thread * m_thread_owner
Owning thread, if applicable.
Definition: pfs_instr.h:299
my_socket m_fd
Socket file descriptor.
Definition: pfs_instr.h:301
struct sockaddr_storage m_sock_addr
Raw socket address.
Definition: pfs_instr.h:303
PFS_socket_stat m_socket_stat
Socket usage statistics.
Definition: pfs_instr.h:311
PFS_socket_class * m_class
Socket class.
Definition: pfs_instr.h:309
Statistics for stage usage.
Definition: pfs_stat.h:322
Statistics for statement usage.
Definition: pfs_stat.h:375
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:404
Statistics for TABLE usage.
Definition: pfs_stat.h:737
Instrumented table implementation.
Definition: pfs_instr.h:192
PFS_table_stat m_table_stat
Table statistics.
Definition: pfs_instr.h:269
ulonglong m_owner_event_id
Event Owner.
Definition: pfs_instr.h:263
const void * m_identity
Table identity, typically a handler.
Definition: pfs_instr.h:267
bool m_lock_timed
True if table lock instrumentation is timed.
Definition: pfs_instr.h:212
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:259
bool m_has_io_stats
True if table I/O statistics have been collected.
Definition: pfs_instr.h:215
PFS_thread * m_thread_owner
Thread Owner.
Definition: pfs_instr.h:261
bool m_lock_enabled
True if table lock instrumentation is enabled.
Definition: pfs_instr.h:202
PFS_TL_LOCK_TYPE m_external_lock
Current external lock.
Definition: pfs_instr.h:273
bool m_io_enabled
True if table I/O instrumentation is enabled.
Definition: pfs_instr.h:197
PFS_TL_LOCK_TYPE m_internal_lock
Current internal lock.
Definition: pfs_instr.h:271
bool m_io_timed
True if table I/O instrumentation is timed.
Definition: pfs_instr.h:207
void aggregate(const TABLE_SHARE *server_share)
Aggregate this table handle statistics to the parents.
Definition: pfs_instr.h:226
bool m_has_lock_stats
True if table lock statistics have been collected.
Definition: pfs_instr.h:218
PFS_table_share * m_share
Table share.
Definition: pfs_instr.h:265
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:275
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:348
Instrumented thread implementation.
Definition: pfs_instr.h:372
bool m_secondary
Executed on secondary engine.
Definition: pfs_instr.h:633
bool m_flag_events_statements_history_long
Derived flag flag_events_statements_history_long, per thread.
Definition: pfs_instr.h:427
uint m_session_connect_attrs_cs_number
Character set in which m_connect_attrs are encoded.
Definition: pfs_instr.h:673
uint m_events_statements_count
Size of m_events_statements_stack.
Definition: pfs_instr.h:638
THD * m_cnt_thd
Definition: pfs_instr.h:644
PFS_user * m_user
Definition: pfs_instr.h:646
LF_PINS * m_user_hash_pins
Pins for user_hash.
Definition: pfs_instr.h:468
PFS_events_transactions m_transaction_current
Definition: pfs_instr.h:641
PFS_events_waits * m_events_waits_current
Current wait event in the event stack.
Definition: pfs_instr.h:446
PFS_events_statements * m_statement_stack
Definition: pfs_instr.h:639
bool m_system_thread
True if a system thread.
Definition: pfs_instr.h:487
LF_PINS * m_account_hash_pins
Pins for account_hash.
Definition: pfs_instr.h:470
uint m_session_connect_attrs_length
Length used by m_connect_attrs.
Definition: pfs_instr.h:668
bool m_flag_events_stages_history_long
Derived flag flag_events_stages_history_long, per thread.
Definition: pfs_instr.h:411
bool m_statements_history_full
True if the circular buffer m_statements_history is full.
Definition: pfs_instr.h:543
PSI_stage_progress * m_stage_progress
Current stage progress.
Definition: pfs_instr.h:620
bool m_flag_events_transactions_history
Derived flag flag_events_transactions_history, per thread.
Definition: pfs_instr.h:435
bool m_waits_history_full
True if the circular buffer m_waits_history is full.
Definition: pfs_instr.h:521
LF_PINS * m_filename_hash_pins
Pins for filename_hash.
Definition: pfs_instr.h:458
PFS_host_name m_host_name
Host name.
Definition: pfs_instr.h:581
void set_enabled(bool enabled)
Definition: pfs_instr.h:683
PFS_events_stages * m_stages_history
Stages history circular buffer.
Definition: pfs_instr.h:540
LF_PINS * m_digest_hash_pins
Pins for digest_hash.
Definition: pfs_instr.h:472
bool m_history
Thread history instrumentation flag.
Definition: pfs_instr.h:378
int m_command
Current command.
Definition: pfs_instr.h:606
pfs_lock m_session_lock
Internal lock, for session attributes.
Definition: pfs_instr.h:569
void set_history(bool history)
Definition: pfs_instr.h:685
socklen_t m_sock_addr_len
Length of address.
Definition: pfs_instr.h:654
PFS_thread_class * m_class
Thread class.
Definition: pfs_instr.h:485
const char * current_key_name
Definition: pfs_instr.h:722
ulonglong m_thread_internal_id
Internal thread identifier, unique.
Definition: pfs_instr.h:476
void set_instr_class_memory_stats(PFS_memory_safe_stat *array)
Definition: pfs_instr.h:700
PFS_schema_name m_db_name
Database name.
Definition: pfs_instr.h:587
bool m_flag_events_stages_history
Derived flag flag_events_stages_history, per thread.
Definition: pfs_instr.h:403
uint m_peer_port
Remote (peer) port.
Definition: pfs_instr.h:650
ulonglong m_parent_thread_internal_id
Parent internal thread identifier.
Definition: pfs_instr.h:478
uint m_processlist_info_length
Length of m_processlist_info_length.
Definition: pfs_instr.h:630
LF_PINS * m_setup_actor_hash_pins
Pins for setup_actor_hash.
Definition: pfs_instr.h:462
PFS_memory_safe_stat * m_instr_class_memory_stats
Per thread memory aggregated statistics.
Definition: pfs_instr.h:698
LF_PINS * m_setup_object_hash_pins
Pins for setup_object_hash.
Definition: pfs_instr.h:464
my_thread_os_id_t m_thread_os_id
External (Operating system) thread identifier, if any.
Definition: pfs_instr.h:483
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:456
enum_vio_type m_connection_type
Connection type.
Definition: pfs_instr.h:608
bool m_flag_events_waits_history_long
Derived flag flag_events_waits_history_long, per thread.
Definition: pfs_instr.h:395
bool m_stages_history_full
True if the circular buffer m_stages_history is full.
Definition: pfs_instr.h:532
LF_PINS * m_program_hash_pins
Pins for routine_hash.
Definition: pfs_instr.h:474
PFS_account * m_account
Definition: pfs_instr.h:647
uint m_statements_history_index
Current index in the circular buffer m_statements_history.
Definition: pfs_instr.h:545
bool m_flag_events_statements_history
Derived flag flag_events_statements_history, per thread.
Definition: pfs_instr.h:419
THD * m_thd
Definition: pfs_instr.h:643
uint m_transactions_history_index
Current index in the circular buffer m_transactions_history.
Definition: pfs_instr.h:556
bool m_flag_events_waits_history
Derived flag flag_events_waits_history, per thread.
Definition: pfs_instr.h:387
ulonglong m_event_id
Event ID counter.
Definition: pfs_instr.h:448
void * m_user_data
User-defined data.
Definition: pfs_instr.h:604
bool m_enabled
Thread instrumentation flag.
Definition: pfs_instr.h:376
PFS_session_all_memory_stat m_session_all_memory_stat
Definition: pfs_instr.h:725
PFS_events_waits * m_waits_history
Waits history circular buffer.
Definition: pfs_instr.h:529
pfs_lock m_stmt_lock
Internal lock, for statement attributes.
Definition: pfs_instr.h:616
PFS_memory_safe_stat * write_instr_class_memory_stats()
Definition: pfs_instr.h:712
PFS_events_statements * m_statements_history
Statements history circular buffer.
Definition: pfs_instr.h:551
PFS_events_stages m_stage_current
Definition: pfs_instr.h:635
uint m_groupname_length
Length of m_groupname.
Definition: pfs_instr.h:598
const PFS_memory_safe_stat * read_instr_class_memory_stats() const
Definition: pfs_instr.h:705
time_t m_start_time
Start time.
Definition: pfs_instr.h:610
uint m_stages_history_index
Current index in the circular buffer m_stages_history.
Definition: pfs_instr.h:534
bool m_flag_events_transactions_history_long
Derived flag flag_events_transactions_history_long, per thread.
Definition: pfs_instr.h:443
PFS_user_name m_user_name
User name.
Definition: pfs_instr.h:575
ulong m_processlist_id
External (.
Definition: pfs_instr.h:481
uint m_waits_history_index
Current index in the circular buffer m_waits_history.
Definition: pfs_instr.h:523
bool m_transactions_history_full
True if the circular buffer m_transactions_history is full.
Definition: pfs_instr.h:554
PFS_events_transactions * m_transactions_history
Statements history circular buffer.
Definition: pfs_instr.h:562
LF_PINS * m_host_hash_pins
Pins for host_hash.
Definition: pfs_instr.h:466
PFS_stage_key m_stage
Processlist state (derived from stage).
Definition: pfs_instr.h:618
PFS_host * m_host
Definition: pfs_instr.h:645
char * m_session_connect_attrs
Buffer for the connection attributes.
Definition: pfs_instr.h:663
LF_PINS * m_table_share_hash_pins
Pins for table_share_hash.
Definition: pfs_instr.h:460
Statistics for transaction usage.
Definition: pfs_stat.h:458
Definition: pfs_name.h:222
Per user statistics.
Definition: pfs_user.h:62
Interface for an instrumented condition.
Definition: psi_cond_bits.h:63
Interface for an instrumented mutex.
Definition: psi_mutex_bits.h:96
Interface for an instrumented rwlock.
Definition: psi_rwlock_bits.h:70
Interface for an instrumented socket descriptor.
Definition: psi_socket_bits.h:68
Interface for an instrumented stage progress.
Definition: psi_stage_bits.h:62
This structure is shared between different table objects.
Definition: table.h:688
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:151
uint32 get_version()
Definition: pfs_lock.h:341
Include file for Sun RPC to compile out of the box.
unsigned int uint
Definition: uca-dump.cc:29
enum_vio_type
Definition: violite.h:78
static void alive(server *s)
Definition: xcom_transport.cc:159