38class PFS_opaque_container_page;
54#ifdef HAVE_ARPA_INET_H
229 if (m_has_io_stats) {
230 safe_aggregate_io(server_share, &m_table_stat, m_share);
231 m_has_io_stats =
false;
233 if (m_has_lock_stats) {
234 safe_aggregate_lock(&m_table_stat, m_share);
235 m_has_lock_stats =
false;
246 void sanitized_aggregate();
252 void sanitized_aggregate_io();
258 void sanitized_aggregate_lock();
280 static void safe_aggregate_io(
const TABLE_SHARE *optional_server_share,
352#define WAIT_STACK_LOGICAL_SIZE 5
359#define WAIT_STACK_BOTTOM 1
364#define WAIT_STACK_SIZE (WAIT_STACK_BOTTOM + WAIT_STACK_LOGICAL_SIZE)
654 struct sockaddr_storage m_sock_addr;
659 void reset_session_connect_attrs();
678 void rebase_memory_stats();
689 set_history_derived_flags();
692 void set_history_derived_flags();
703 m_has_memory_stats =
false;
704 m_instr_class_memory_stats = array;
708 if (!m_has_memory_stats) {
711 return m_instr_class_memory_stats;
715 if (!m_has_memory_stats) {
716 rebase_memory_stats();
717 m_has_memory_stats =
true;
719 return m_instr_class_memory_stats;
721 void mem_cnt_alloc(
size_t size);
722 void mem_cnt_free(
size_t size);
768 const void *identity,
ulonglong processlist_id);
788 const void *identity);
792 const struct sockaddr *addr, socklen_t addr_len);
799 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:44
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:56
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:161
const void * m_identity
Condition identity, typically a pthread_cond_t.
Definition: pfs_instr.h:170
PFS_cond_class * m_class
Condition class.
Definition: pfs_instr.h:172
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:167
PFS_cond_stat m_cond_stat
Condition instance usage statistics.
Definition: pfs_instr.h:174
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:163
bool m_timed
Timed flag.
Definition: pfs_instr.h:165
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:287
Statistics for FILE usage.
Definition: pfs_stat.h:307
Instrumented File and FILE implementation.
Definition: pfs_instr.h:178
uint32 get_version()
Definition: pfs_instr.h:179
PFS_file_class * m_class
File class.
Definition: pfs_instr.h:186
PFS_file_stat m_file_stat
File usage statistics.
Definition: pfs_instr.h:188
bool m_temporary
True if a temporary file.
Definition: pfs_instr.h:190
const void * m_identity
File identity.
Definition: pfs_instr.h:182
PFS_file_name m_file_name
File name.
Definition: pfs_instr.h:184
Performance schema global sizing parameters.
Definition: pfs_server.h:112
Definition: pfs_histogram.h:37
Definition: pfs_name.h:245
Per host statistics.
Definition: pfs_host.h:63
Base structure for wait instruments.
Definition: pfs_instr.h:90
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:98
bool m_enabled
Enabled flag.
Definition: pfs_instr.h:94
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:92
bool m_timed
Timed flag.
Definition: pfs_instr.h:96
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:102
const void * m_identity
Mutex identity, typically a pthread_mutex_t.
Definition: pfs_instr.h:111
PFS_mutex_class * m_class
Mutex class.
Definition: pfs_instr.h:113
bool m_timed
Timed flag.
Definition: pfs_instr.h:106
PFS_thread * m_owner
Current owner.
Definition: pfs_instr.h:117
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:104
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:108
PFS_mutex_stat m_mutex_stat
Instrument statistics.
Definition: pfs_instr.h:115
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:128
uint m_readers
Current count of readers.
Definition: pfs_instr.h:145
PFS_thread * m_writer
Current writer thread.
Definition: pfs_instr.h:143
PFS_rwlock_class * m_class
RWLock class.
Definition: pfs_instr.h:139
PFS_rwlock_stat m_rwlock_stat
Instrument statistics.
Definition: pfs_instr.h:141
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:130
const void * m_identity
RWLock identity, typically a pthread_rwlock_t.
Definition: pfs_instr.h:137
bool m_timed
Timed flag.
Definition: pfs_instr.h:132
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:134
Definition: pfs_name.h:117
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:288
const void * m_identity
Socket identity, typically int.
Definition: pfs_instr.h:299
bool m_idle
Idle flag.
Definition: pfs_instr.h:309
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:290
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:294
bool m_timed
Timed flag.
Definition: pfs_instr.h:292
uint32 get_version()
Definition: pfs_instr.h:296
socklen_t m_addr_len
Length of address.
Definition: pfs_instr.h:307
PFS_thread * m_thread_owner
Owning thread, if applicable.
Definition: pfs_instr.h:301
my_socket m_fd
Socket file descriptor.
Definition: pfs_instr.h:303
struct sockaddr_storage m_sock_addr
Raw socket address.
Definition: pfs_instr.h:305
PFS_socket_stat m_socket_stat
Socket usage statistics.
Definition: pfs_instr.h:313
PFS_socket_class * m_class
Socket class.
Definition: pfs_instr.h:311
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:739
Instrumented table implementation.
Definition: pfs_instr.h:194
PFS_table_stat m_table_stat
Table statistics.
Definition: pfs_instr.h:271
ulonglong m_owner_event_id
Event Owner.
Definition: pfs_instr.h:265
const void * m_identity
Table identity, typically a handler.
Definition: pfs_instr.h:269
bool m_lock_timed
True if table lock instrumentation is timed.
Definition: pfs_instr.h:214
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:261
bool m_has_io_stats
True if table I/O statistics have been collected.
Definition: pfs_instr.h:217
PFS_thread * m_thread_owner
Thread Owner.
Definition: pfs_instr.h:263
bool m_lock_enabled
True if table lock instrumentation is enabled.
Definition: pfs_instr.h:204
PFS_TL_LOCK_TYPE m_external_lock
Current external lock.
Definition: pfs_instr.h:275
bool m_io_enabled
True if table I/O instrumentation is enabled.
Definition: pfs_instr.h:199
PFS_TL_LOCK_TYPE m_internal_lock
Current internal lock.
Definition: pfs_instr.h:273
bool m_io_timed
True if table I/O instrumentation is timed.
Definition: pfs_instr.h:209
void aggregate(const TABLE_SHARE *server_share)
Aggregate this table handle statistics to the parents.
Definition: pfs_instr.h:228
bool m_has_lock_stats
True if table lock statistics have been collected.
Definition: pfs_instr.h:220
PFS_table_share * m_share
Table share.
Definition: pfs_instr.h:267
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:277
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:348
Instrumented thread implementation.
Definition: pfs_instr.h:374
bool m_secondary
Executed on secondary engine.
Definition: pfs_instr.h:635
bool m_flag_events_statements_history_long
Derived flag flag_events_statements_history_long, per thread.
Definition: pfs_instr.h:429
uint m_session_connect_attrs_cs_number
Character set in which m_connect_attrs are encoded.
Definition: pfs_instr.h:675
uint m_events_statements_count
Size of m_events_statements_stack.
Definition: pfs_instr.h:640
THD * m_cnt_thd
Definition: pfs_instr.h:646
PFS_user * m_user
Definition: pfs_instr.h:648
LF_PINS * m_user_hash_pins
Pins for user_hash.
Definition: pfs_instr.h:470
PFS_events_transactions m_transaction_current
Definition: pfs_instr.h:643
PFS_events_waits * m_events_waits_current
Current wait event in the event stack.
Definition: pfs_instr.h:448
PFS_events_statements * m_statement_stack
Definition: pfs_instr.h:641
bool m_system_thread
True if a system thread.
Definition: pfs_instr.h:489
LF_PINS * m_account_hash_pins
Pins for account_hash.
Definition: pfs_instr.h:472
uint m_session_connect_attrs_length
Length used by m_connect_attrs.
Definition: pfs_instr.h:670
bool m_flag_events_stages_history_long
Derived flag flag_events_stages_history_long, per thread.
Definition: pfs_instr.h:413
telemetry_session_t * m_telemetry_session
Definition: pfs_instr.h:731
bool m_statements_history_full
True if the circular buffer m_statements_history is full.
Definition: pfs_instr.h:545
PSI_stage_progress * m_stage_progress
Current stage progress.
Definition: pfs_instr.h:622
bool m_flag_events_transactions_history
Derived flag flag_events_transactions_history, per thread.
Definition: pfs_instr.h:437
bool m_waits_history_full
True if the circular buffer m_waits_history is full.
Definition: pfs_instr.h:523
LF_PINS * m_filename_hash_pins
Pins for filename_hash.
Definition: pfs_instr.h:460
PFS_host_name m_host_name
Host name.
Definition: pfs_instr.h:583
void set_enabled(bool enabled)
Definition: pfs_instr.h:685
PFS_events_stages * m_stages_history
Stages history circular buffer.
Definition: pfs_instr.h:542
LF_PINS * m_digest_hash_pins
Pins for digest_hash.
Definition: pfs_instr.h:474
bool m_history
Thread history instrumentation flag.
Definition: pfs_instr.h:380
int m_command
Current command.
Definition: pfs_instr.h:608
pfs_lock m_session_lock
Internal lock, for session attributes.
Definition: pfs_instr.h:571
void set_history(bool history)
Definition: pfs_instr.h:687
socklen_t m_sock_addr_len
Length of address.
Definition: pfs_instr.h:656
PFS_thread_class * m_class
Thread class.
Definition: pfs_instr.h:487
const char * current_key_name
Definition: pfs_instr.h:724
ulonglong m_thread_internal_id
Internal thread identifier, unique.
Definition: pfs_instr.h:478
void set_instr_class_memory_stats(PFS_memory_safe_stat *array)
Definition: pfs_instr.h:702
PFS_schema_name m_db_name
Database name.
Definition: pfs_instr.h:589
bool m_flag_events_stages_history
Derived flag flag_events_stages_history, per thread.
Definition: pfs_instr.h:405
uint m_peer_port
Remote (peer) port.
Definition: pfs_instr.h:652
ulonglong m_parent_thread_internal_id
Parent internal thread identifier.
Definition: pfs_instr.h:480
uint m_processlist_info_length
Length of m_processlist_info_length.
Definition: pfs_instr.h:632
LF_PINS * m_setup_actor_hash_pins
Pins for setup_actor_hash.
Definition: pfs_instr.h:464
PFS_memory_safe_stat * m_instr_class_memory_stats
Per thread memory aggregated statistics.
Definition: pfs_instr.h:700
LF_PINS * m_setup_object_hash_pins
Pins for setup_object_hash.
Definition: pfs_instr.h:466
my_thread_os_id_t m_thread_os_id
External (Operating system) thread identifier, if any.
Definition: pfs_instr.h:485
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:458
enum_vio_type m_connection_type
Connection type.
Definition: pfs_instr.h:610
bool m_flag_events_waits_history_long
Derived flag flag_events_waits_history_long, per thread.
Definition: pfs_instr.h:397
bool m_stages_history_full
True if the circular buffer m_stages_history is full.
Definition: pfs_instr.h:534
LF_PINS * m_program_hash_pins
Pins for routine_hash.
Definition: pfs_instr.h:476
PFS_account * m_account
Definition: pfs_instr.h:649
bool m_debug_session_notified
Definition: pfs_instr.h:734
uint m_statements_history_index
Current index in the circular buffer m_statements_history.
Definition: pfs_instr.h:547
bool m_flag_events_statements_history
Derived flag flag_events_statements_history, per thread.
Definition: pfs_instr.h:421
THD * m_thd
Definition: pfs_instr.h:645
uint m_transactions_history_index
Current index in the circular buffer m_transactions_history.
Definition: pfs_instr.h:558
bool m_flag_events_waits_history
Derived flag flag_events_waits_history, per thread.
Definition: pfs_instr.h:389
ulonglong m_event_id
Event ID counter.
Definition: pfs_instr.h:450
void * m_user_data
User-defined data.
Definition: pfs_instr.h:606
bool m_enabled
Thread instrumentation flag.
Definition: pfs_instr.h:378
PFS_session_all_memory_stat m_session_all_memory_stat
Definition: pfs_instr.h:727
PFS_events_waits * m_waits_history
Waits history circular buffer.
Definition: pfs_instr.h:531
pfs_lock m_stmt_lock
Internal lock, for statement attributes.
Definition: pfs_instr.h:618
PFS_memory_safe_stat * write_instr_class_memory_stats()
Definition: pfs_instr.h:714
PFS_events_statements * m_statements_history
Statements history circular buffer.
Definition: pfs_instr.h:553
PFS_events_stages m_stage_current
Definition: pfs_instr.h:637
uint m_groupname_length
Length of m_groupname.
Definition: pfs_instr.h:600
const PFS_memory_safe_stat * read_instr_class_memory_stats() const
Definition: pfs_instr.h:707
telemetry_t * m_telemetry
Copy of g_telemetry.
Definition: pfs_instr.h:730
time_t m_start_time
Start time.
Definition: pfs_instr.h:612
uint m_stages_history_index
Current index in the circular buffer m_stages_history.
Definition: pfs_instr.h:536
bool m_flag_events_transactions_history_long
Derived flag flag_events_transactions_history_long, per thread.
Definition: pfs_instr.h:445
PFS_user_name m_user_name
User name.
Definition: pfs_instr.h:577
ulong m_processlist_id
External (.
Definition: pfs_instr.h:483
uint m_waits_history_index
Current index in the circular buffer m_waits_history.
Definition: pfs_instr.h:525
bool m_transactions_history_full
True if the circular buffer m_transactions_history is full.
Definition: pfs_instr.h:556
PFS_events_transactions * m_transactions_history
Statements history circular buffer.
Definition: pfs_instr.h:564
LF_PINS * m_host_hash_pins
Pins for host_hash.
Definition: pfs_instr.h:468
PFS_stage_key m_stage
Processlist state (derived from stage).
Definition: pfs_instr.h:620
PFS_host * m_host
Definition: pfs_instr.h:647
char * m_session_connect_attrs
Buffer for the connection attributes.
Definition: pfs_instr.h:665
LF_PINS * m_table_share_hash_pins
Pins for table_share_hash.
Definition: pfs_instr.h:462
Statistics for transaction usage.
Definition: pfs_stat.h:458
Definition: pfs_name.h:224
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:691
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:153
uint32 get_version()
Definition: pfs_lock.h:341
Definition: server_telemetry_traces_bits.h:136
Include file for Sun RPC to compile out of the box.
enum_vio_type
Definition: violite.h:78
static void alive(server *s)
Definition: xcom_transport.cc:159