39class PFS_opaque_container_page;
55#ifdef HAVE_ARPA_INET_H
230 if (m_has_io_stats) {
231 safe_aggregate_io(server_share, &m_table_stat, m_share);
232 m_has_io_stats =
false;
234 if (m_has_lock_stats) {
235 safe_aggregate_lock(&m_table_stat, m_share);
236 m_has_lock_stats =
false;
247 void sanitized_aggregate();
253 void sanitized_aggregate_io();
259 void sanitized_aggregate_lock();
281 static void safe_aggregate_io(
const TABLE_SHARE *optional_server_share,
353#define WAIT_STACK_LOGICAL_SIZE 5
360#define WAIT_STACK_BOTTOM 1
365#define WAIT_STACK_SIZE (WAIT_STACK_BOTTOM + WAIT_STACK_LOGICAL_SIZE)
655 struct sockaddr_storage m_sock_addr;
660 void reset_session_connect_attrs();
679 void rebase_memory_stats();
690 set_history_derived_flags();
693 void set_history_derived_flags();
704 m_has_memory_stats =
false;
705 m_instr_class_memory_stats = array;
709 if (!m_has_memory_stats) {
712 return m_instr_class_memory_stats;
716 if (!m_has_memory_stats) {
717 rebase_memory_stats();
718 m_has_memory_stats =
true;
720 return m_instr_class_memory_stats;
722 void mem_cnt_alloc(
size_t size);
723 void mem_cnt_free(
size_t size);
769 const void *identity,
ulonglong processlist_id);
789 const void *identity);
793 const struct sockaddr *addr, socklen_t addr_len);
800 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:36
int opaque_mdl_duration
Definition: psi_mdl_bits.h:42
int opaque_mdl_status
Definition: psi_mdl_bits.h:45
int opaque_mdl_type
Definition: psi_mdl_bits.h:36
unsigned int PSI_thread_seqnum
Instrumented thread sequence number.
Definition: psi_thread_bits.h:59
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:56
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
static my_thread_id thread_id
Definition: my_thr_init.cc:63
Portable wrapper for gettid().
unsigned long long my_thread_os_id_t
Definition: my_thread_os_id.h:48
int my_socket
Definition: mysql.h:65
#define NAME_LEN
Definition: mysql_com.h:67
static mysql_service_status_t create(my_h_string *) noexcept
Definition: mysql_string_all_empty.cc:43
size_t size(const char *const c)
Definition: base64.h:46
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:71
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:67
#define PFS_ALIGNED
Definition: pfs_global.h:57
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:67
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:33
struct sockaddr sockaddr
Definition: sock_probe_win32.h:63
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Metadata lock object key.
Definition: mdl.h:365
Per account statistics.
Definition: pfs_account.h:67
Instrumentation metadata for a condition.
Definition: pfs_instr_class.h:347
Statistics for conditions usage.
Definition: pfs_stat.h:238
Instrumented condition implementation.
Definition: pfs_instr.h:162
const void * m_identity
Condition identity, typically a pthread_cond_t.
Definition: pfs_instr.h:171
PFS_cond_class * m_class
Condition class.
Definition: pfs_instr.h:173
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:168
PFS_cond_stat m_cond_stat
Condition instance usage statistics.
Definition: pfs_instr.h:175
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:164
bool m_timed
Timed flag.
Definition: pfs_instr.h:166
A connection slice, an arbitrary grouping of several connections.
Definition: pfs_con_slice.h:54
Statistics for all server errors.
Definition: pfs_stat.h:557
A stage record.
Definition: pfs_events_stages.h:45
A statement record.
Definition: pfs_events_statements.h:47
A transaction record.
Definition: pfs_events_transactions.h:86
A wait event record.
Definition: pfs_events_waits.h:69
Instrumentation metadata for a file.
Definition: pfs_instr_class.h:587
Definition: pfs_name.h:610
Statistics for FILE usage.
Definition: pfs_stat.h:308
Instrumented File and FILE implementation.
Definition: pfs_instr.h:179
uint32 get_version()
Definition: pfs_instr.h:180
PFS_file_class * m_class
File class.
Definition: pfs_instr.h:187
PFS_file_stat m_file_stat
File usage statistics.
Definition: pfs_instr.h:189
bool m_temporary
True if a temporary file.
Definition: pfs_instr.h:191
const void * m_identity
File identity.
Definition: pfs_instr.h:183
PFS_file_name m_file_name
File name.
Definition: pfs_instr.h:185
Performance schema global sizing parameters.
Definition: pfs_server.h:120
Definition: pfs_histogram.h:38
Definition: pfs_name.h:522
Per host statistics.
Definition: pfs_host.h:64
Base structure for wait instruments.
Definition: pfs_instr.h:91
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:99
bool m_enabled
Enabled flag.
Definition: pfs_instr.h:95
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:93
bool m_timed
Timed flag.
Definition: pfs_instr.h:97
Memory statistics.
Definition: pfs_stat.h:913
Definition: pfs_stat.h:937
Definition: pfs_stat.h:883
Definition: pfs_stat.h:888
Instrumentation metadata for a mutex.
Definition: pfs_instr_class.h:327
Statistics for mutex usage.
Definition: pfs_stat.h:177
Instrumented mutex implementation.
Definition: pfs_instr.h:103
const void * m_identity
Mutex identity, typically a pthread_mutex_t.
Definition: pfs_instr.h:112
PFS_mutex_class * m_class
Mutex class.
Definition: pfs_instr.h:114
bool m_timed
Timed flag.
Definition: pfs_instr.h:107
PFS_thread * m_owner
Current owner.
Definition: pfs_instr.h:118
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:105
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:109
PFS_mutex_stat m_mutex_stat
Instrument statistics.
Definition: pfs_instr.h:116
Instrumentation metadata for a read write lock.
Definition: pfs_instr_class.h:337
Statistics for rwlock usage.
Definition: pfs_stat.h:204
Instrumented rwlock implementation.
Definition: pfs_instr.h:129
uint m_readers
Current count of readers.
Definition: pfs_instr.h:146
PFS_thread * m_writer
Current writer thread.
Definition: pfs_instr.h:144
PFS_rwlock_class * m_class
RWLock class.
Definition: pfs_instr.h:140
PFS_rwlock_stat m_rwlock_stat
Instrument statistics.
Definition: pfs_instr.h:142
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:131
const void * m_identity
RWLock identity, typically a pthread_rwlock_t.
Definition: pfs_instr.h:138
bool m_timed
Timed flag.
Definition: pfs_instr.h:133
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:135
Definition: pfs_name.h:194
Definition: pfs_stat.h:1136
Single statistic.
Definition: pfs_stat.h:52
Instrumentation metadata for a socket.
Definition: pfs_instr_class.h:616
Statistics for SOCKET usage.
Definition: pfs_stat.h:875
Instrumented socket implementation.
Definition: pfs_instr.h:289
const void * m_identity
Socket identity, typically int.
Definition: pfs_instr.h:300
bool m_idle
Idle flag.
Definition: pfs_instr.h:310
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:291
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:295
bool m_timed
Timed flag.
Definition: pfs_instr.h:293
uint32 get_version()
Definition: pfs_instr.h:297
socklen_t m_addr_len
Length of address.
Definition: pfs_instr.h:308
PFS_thread * m_thread_owner
Owning thread, if applicable.
Definition: pfs_instr.h:302
my_socket m_fd
Socket file descriptor.
Definition: pfs_instr.h:304
struct sockaddr_storage m_sock_addr
Raw socket address.
Definition: pfs_instr.h:306
PFS_socket_stat m_socket_stat
Socket usage statistics.
Definition: pfs_instr.h:314
PFS_socket_class * m_class
Socket class.
Definition: pfs_instr.h:312
Statistics for stage usage.
Definition: pfs_stat.h:323
Statistics for statement usage.
Definition: pfs_stat.h:376
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:456
Statistics for TABLE usage.
Definition: pfs_stat.h:740
Instrumented table implementation.
Definition: pfs_instr.h:195
PFS_table_stat m_table_stat
Table statistics.
Definition: pfs_instr.h:272
ulonglong m_owner_event_id
Event Owner.
Definition: pfs_instr.h:266
const void * m_identity
Table identity, typically a handler.
Definition: pfs_instr.h:270
bool m_lock_timed
True if table lock instrumentation is timed.
Definition: pfs_instr.h:215
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:262
bool m_has_io_stats
True if table I/O statistics have been collected.
Definition: pfs_instr.h:218
PFS_thread * m_thread_owner
Thread Owner.
Definition: pfs_instr.h:264
bool m_lock_enabled
True if table lock instrumentation is enabled.
Definition: pfs_instr.h:205
PFS_TL_LOCK_TYPE m_external_lock
Current external lock.
Definition: pfs_instr.h:276
bool m_io_enabled
True if table I/O instrumentation is enabled.
Definition: pfs_instr.h:200
PFS_TL_LOCK_TYPE m_internal_lock
Current internal lock.
Definition: pfs_instr.h:274
bool m_io_timed
True if table I/O instrumentation is timed.
Definition: pfs_instr.h:210
void aggregate(const TABLE_SHARE *server_share)
Aggregate this table handle statistics to the parents.
Definition: pfs_instr.h:229
bool m_has_lock_stats
True if table lock statistics have been collected.
Definition: pfs_instr.h:221
PFS_table_share * m_share
Table share.
Definition: pfs_instr.h:268
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:278
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:358
Instrumented thread implementation.
Definition: pfs_instr.h:375
bool m_secondary
Executed on secondary engine.
Definition: pfs_instr.h:636
bool m_flag_events_statements_history_long
Derived flag flag_events_statements_history_long, per thread.
Definition: pfs_instr.h:430
uint m_session_connect_attrs_cs_number
Character set in which m_connect_attrs are encoded.
Definition: pfs_instr.h:676
uint m_events_statements_count
Size of m_events_statements_stack.
Definition: pfs_instr.h:641
THD * m_cnt_thd
Definition: pfs_instr.h:647
PFS_user * m_user
Definition: pfs_instr.h:649
LF_PINS * m_user_hash_pins
Pins for user_hash.
Definition: pfs_instr.h:471
PFS_events_transactions m_transaction_current
Definition: pfs_instr.h:644
PFS_events_waits * m_events_waits_current
Current wait event in the event stack.
Definition: pfs_instr.h:449
PFS_events_statements * m_statement_stack
Definition: pfs_instr.h:642
bool m_system_thread
True if a system thread.
Definition: pfs_instr.h:490
LF_PINS * m_account_hash_pins
Pins for account_hash.
Definition: pfs_instr.h:473
uint m_session_connect_attrs_length
Length used by m_connect_attrs.
Definition: pfs_instr.h:671
bool m_flag_events_stages_history_long
Derived flag flag_events_stages_history_long, per thread.
Definition: pfs_instr.h:414
telemetry_session_t * m_telemetry_session
Definition: pfs_instr.h:732
bool m_statements_history_full
True if the circular buffer m_statements_history is full.
Definition: pfs_instr.h:546
PSI_stage_progress * m_stage_progress
Current stage progress.
Definition: pfs_instr.h:623
bool m_flag_events_transactions_history
Derived flag flag_events_transactions_history, per thread.
Definition: pfs_instr.h:438
bool m_waits_history_full
True if the circular buffer m_waits_history is full.
Definition: pfs_instr.h:524
LF_PINS * m_filename_hash_pins
Pins for filename_hash.
Definition: pfs_instr.h:461
PFS_host_name m_host_name
Host name.
Definition: pfs_instr.h:584
void set_enabled(bool enabled)
Definition: pfs_instr.h:686
PFS_events_stages * m_stages_history
Stages history circular buffer.
Definition: pfs_instr.h:543
LF_PINS * m_digest_hash_pins
Pins for digest_hash.
Definition: pfs_instr.h:475
bool m_history
Thread history instrumentation flag.
Definition: pfs_instr.h:381
int m_command
Current command.
Definition: pfs_instr.h:609
pfs_lock m_session_lock
Internal lock, for session attributes.
Definition: pfs_instr.h:572
void set_history(bool history)
Definition: pfs_instr.h:688
socklen_t m_sock_addr_len
Length of address.
Definition: pfs_instr.h:657
PFS_thread_class * m_class
Thread class.
Definition: pfs_instr.h:488
const char * current_key_name
Definition: pfs_instr.h:725
ulonglong m_thread_internal_id
Internal thread identifier, unique.
Definition: pfs_instr.h:479
void set_instr_class_memory_stats(PFS_memory_safe_stat *array)
Definition: pfs_instr.h:703
PFS_schema_name m_db_name
Database name.
Definition: pfs_instr.h:590
bool m_flag_events_stages_history
Derived flag flag_events_stages_history, per thread.
Definition: pfs_instr.h:406
uint m_peer_port
Remote (peer) port.
Definition: pfs_instr.h:653
ulonglong m_parent_thread_internal_id
Parent internal thread identifier.
Definition: pfs_instr.h:481
uint m_processlist_info_length
Length of m_processlist_info_length.
Definition: pfs_instr.h:633
LF_PINS * m_setup_actor_hash_pins
Pins for setup_actor_hash.
Definition: pfs_instr.h:465
PFS_memory_safe_stat * m_instr_class_memory_stats
Per thread memory aggregated statistics.
Definition: pfs_instr.h:701
LF_PINS * m_setup_object_hash_pins
Pins for setup_object_hash.
Definition: pfs_instr.h:467
my_thread_os_id_t m_thread_os_id
External (Operating system) thread identifier, if any.
Definition: pfs_instr.h:486
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:459
enum_vio_type m_connection_type
Connection type.
Definition: pfs_instr.h:611
bool m_flag_events_waits_history_long
Derived flag flag_events_waits_history_long, per thread.
Definition: pfs_instr.h:398
bool m_stages_history_full
True if the circular buffer m_stages_history is full.
Definition: pfs_instr.h:535
LF_PINS * m_program_hash_pins
Pins for routine_hash.
Definition: pfs_instr.h:477
PFS_account * m_account
Definition: pfs_instr.h:650
bool m_debug_session_notified
Definition: pfs_instr.h:735
uint m_statements_history_index
Current index in the circular buffer m_statements_history.
Definition: pfs_instr.h:548
bool m_flag_events_statements_history
Derived flag flag_events_statements_history, per thread.
Definition: pfs_instr.h:422
THD * m_thd
Definition: pfs_instr.h:646
uint m_transactions_history_index
Current index in the circular buffer m_transactions_history.
Definition: pfs_instr.h:559
bool m_flag_events_waits_history
Derived flag flag_events_waits_history, per thread.
Definition: pfs_instr.h:390
ulonglong m_event_id
Event ID counter.
Definition: pfs_instr.h:451
void * m_user_data
User-defined data.
Definition: pfs_instr.h:607
bool m_enabled
Thread instrumentation flag.
Definition: pfs_instr.h:379
PFS_session_all_memory_stat m_session_all_memory_stat
Definition: pfs_instr.h:728
PFS_events_waits * m_waits_history
Waits history circular buffer.
Definition: pfs_instr.h:532
pfs_lock m_stmt_lock
Internal lock, for statement attributes.
Definition: pfs_instr.h:619
PFS_memory_safe_stat * write_instr_class_memory_stats()
Definition: pfs_instr.h:715
PFS_events_statements * m_statements_history
Statements history circular buffer.
Definition: pfs_instr.h:554
PFS_events_stages m_stage_current
Definition: pfs_instr.h:638
uint m_groupname_length
Length of m_groupname.
Definition: pfs_instr.h:601
const PFS_memory_safe_stat * read_instr_class_memory_stats() const
Definition: pfs_instr.h:708
telemetry_t * m_telemetry
Copy of g_telemetry.
Definition: pfs_instr.h:731
time_t m_start_time
Start time.
Definition: pfs_instr.h:613
uint m_stages_history_index
Current index in the circular buffer m_stages_history.
Definition: pfs_instr.h:537
bool m_flag_events_transactions_history_long
Derived flag flag_events_transactions_history_long, per thread.
Definition: pfs_instr.h:446
PFS_user_name m_user_name
User name.
Definition: pfs_instr.h:578
ulong m_processlist_id
External (.
Definition: pfs_instr.h:484
uint m_waits_history_index
Current index in the circular buffer m_waits_history.
Definition: pfs_instr.h:526
bool m_transactions_history_full
True if the circular buffer m_transactions_history is full.
Definition: pfs_instr.h:557
PFS_events_transactions * m_transactions_history
Statements history circular buffer.
Definition: pfs_instr.h:565
LF_PINS * m_host_hash_pins
Pins for host_hash.
Definition: pfs_instr.h:469
PFS_stage_key m_stage
Processlist state (derived from stage).
Definition: pfs_instr.h:621
PFS_host * m_host
Definition: pfs_instr.h:648
char * m_session_connect_attrs
Buffer for the connection attributes.
Definition: pfs_instr.h:666
LF_PINS * m_table_share_hash_pins
Pins for table_share_hash.
Definition: pfs_instr.h:463
Statistics for transaction usage.
Definition: pfs_stat.h:459
Definition: pfs_name.h:478
Per user statistics.
Definition: pfs_user.h:63
Interface for an instrumented condition.
Definition: psi_cond_bits.h:64
Interface for an instrumented mutex.
Definition: psi_mutex_bits.h:97
Interface for an instrumented rwlock.
Definition: psi_rwlock_bits.h:71
Interface for an instrumented socket descriptor.
Definition: psi_socket_bits.h:69
Interface for an instrumented stage progress.
Definition: psi_stage_bits.h:63
This structure is shared between different table objects.
Definition: table.h:701
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:154
uint32 get_version()
Definition: pfs_lock.h:342
Definition: server_telemetry_traces_bits.h:137
Include file for Sun RPC to compile out of the box.
enum_vio_type
Definition: violite.h:79
static void alive(server *s)
Definition: xcom_transport.cc:174