MySQL 9.1.0
Source Code Documentation
|
Instrumented thread implementation. More...
#include <pfs_instr.h>
Static Public Member Functions | |
static PFS_thread * | get_current_thread () |
Public Attributes | |
bool | m_enabled |
Thread instrumentation flag. More... | |
bool | m_history |
Thread history instrumentation flag. More... | |
bool | m_flag_events_waits_history |
Derived flag flag_events_waits_history, per thread. More... | |
bool | m_flag_events_waits_history_long |
Derived flag flag_events_waits_history_long, per thread. More... | |
bool | m_flag_events_stages_history |
Derived flag flag_events_stages_history, per thread. More... | |
bool | m_flag_events_stages_history_long |
Derived flag flag_events_stages_history_long, per thread. More... | |
bool | m_flag_events_statements_history |
Derived flag flag_events_statements_history, per thread. More... | |
bool | m_flag_events_statements_history_long |
Derived flag flag_events_statements_history_long, per thread. More... | |
bool | m_flag_events_transactions_history |
Derived flag flag_events_transactions_history, per thread. More... | |
bool | m_flag_events_transactions_history_long |
Derived flag flag_events_transactions_history_long, per thread. More... | |
PFS_events_waits * | m_events_waits_current |
Current wait event in the event stack. More... | |
ulonglong | m_event_id |
Event ID counter. More... | |
pfs_lock | m_lock |
Internal lock. More... | |
LF_PINS * | m_filename_hash_pins |
Pins for filename_hash. More... | |
LF_PINS * | m_table_share_hash_pins |
Pins for table_share_hash. More... | |
LF_PINS * | m_setup_actor_hash_pins |
Pins for setup_actor_hash. More... | |
LF_PINS * | m_setup_object_hash_pins |
Pins for setup_object_hash. More... | |
LF_PINS * | m_host_hash_pins |
Pins for host_hash. More... | |
LF_PINS * | m_user_hash_pins |
Pins for user_hash. More... | |
LF_PINS * | m_account_hash_pins |
Pins for account_hash. More... | |
LF_PINS * | m_digest_hash_pins |
Pins for digest_hash. More... | |
LF_PINS * | m_program_hash_pins |
Pins for routine_hash. More... | |
ulonglong | m_thread_internal_id |
Internal thread identifier, unique. More... | |
ulonglong | m_parent_thread_internal_id |
Parent internal thread identifier. More... | |
ulong | m_processlist_id |
External (. More... | |
my_thread_os_id_t | m_thread_os_id |
External (Operating system) thread identifier, if any. More... | |
PFS_thread_class * | m_class |
Thread class. More... | |
bool | m_system_thread |
True if a system thread. More... | |
PFS_events_waits | m_events_waits_stack [WAIT_STACK_SIZE] |
Stack of events waits. More... | |
bool | m_waits_history_full |
True if the circular buffer m_waits_history is full. More... | |
uint | m_waits_history_index |
Current index in the circular buffer m_waits_history . More... | |
PFS_events_waits * | m_waits_history |
Waits history circular buffer. More... | |
bool | m_stages_history_full |
True if the circular buffer m_stages_history is full. More... | |
uint | m_stages_history_index |
Current index in the circular buffer m_stages_history . More... | |
PFS_events_stages * | m_stages_history |
Stages history circular buffer. More... | |
bool | m_statements_history_full |
True if the circular buffer m_statements_history is full. More... | |
uint | m_statements_history_index |
Current index in the circular buffer m_statements_history . More... | |
PFS_events_statements * | m_statements_history |
Statements history circular buffer. More... | |
bool | m_transactions_history_full |
True if the circular buffer m_transactions_history is full. More... | |
uint | m_transactions_history_index |
Current index in the circular buffer m_transactions_history . More... | |
PFS_events_transactions * | m_transactions_history |
Statements history circular buffer. More... | |
pfs_lock | m_session_lock |
Internal lock, for session attributes. More... | |
PFS_user_name | m_user_name |
User name. More... | |
PFS_host_name | m_host_name |
Host name. More... | |
PFS_schema_name | m_db_name |
Database name. More... | |
char | m_groupname [NAME_LEN] |
Resource group name. More... | |
uint | m_groupname_length |
Length of m_groupname . More... | |
char | m_os_name [PFS_MAX_OS_NAME_LENGTH] |
Operating system name. More... | |
void * | m_user_data |
User-defined data. More... | |
int | m_command |
Current command. More... | |
enum_vio_type | m_connection_type |
Connection type. More... | |
time_t | m_start_time |
Start time. More... | |
pfs_lock | m_stmt_lock |
Internal lock, for statement attributes. More... | |
PFS_stage_key | m_stage |
Processlist state (derived from stage). More... | |
PSI_stage_progress * | m_stage_progress |
Current stage progress. More... | |
char | m_processlist_info [COL_INFO_SIZE] |
Processlist info. More... | |
uint | m_processlist_info_length |
Length of m_processlist_info_length . More... | |
bool | m_secondary |
Executed on secondary engine. More... | |
PFS_events_stages | m_stage_current |
uint | m_events_statements_count |
Size of m_events_statements_stack . More... | |
PFS_events_statements * | m_statement_stack |
PFS_events_transactions | m_transaction_current |
THD * | m_thd |
THD * | m_cnt_thd |
PFS_host * | m_host |
PFS_user * | m_user |
PFS_account * | m_account |
uint | m_peer_port |
Remote (peer) port. More... | |
struct sockaddr_storage | m_sock_addr |
Raw socket address. More... | |
socklen_t | m_sock_addr_len |
Length of address. More... | |
char * | m_session_connect_attrs |
Buffer for the connection attributes. More... | |
uint | m_session_connect_attrs_length |
Length used by m_connect_attrs . More... | |
uint | m_session_connect_attrs_cs_number |
Character set in which m_connect_attrs are encoded. More... | |
PFS_memory_safe_stat * | m_instr_class_memory_stats |
Per thread memory aggregated statistics. More... | |
const char * | current_key_name |
PFS_session_all_memory_stat | m_session_all_memory_stat |
telemetry_t * | m_telemetry |
Copy of g_telemetry. More... | |
telemetry_session_t * | m_telemetry_session |
bool | m_debug_session_notified |
Public Attributes inherited from PFS_connection_slice | |
PFS_status_stats | m_status_stats |
Aggregated status variables. More... | |
PFS_opaque_container_page * | m_page |
Container page. More... | |
Additional Inherited Members | |
Protected Attributes inherited from PFS_connection_slice | |
bool | m_has_memory_stats {false} |
Instrumented thread implementation.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
const char* PFS_thread::current_key_name |
PFS_account* PFS_thread::m_account |
LF_PINS* PFS_thread::m_account_hash_pins |
Pins for account_hash.
PFS_thread_class* PFS_thread::m_class |
Thread class.
THD* PFS_thread::m_cnt_thd |
int PFS_thread::m_command |
Current command.
enum_vio_type PFS_thread::m_connection_type |
Connection type.
PFS_schema_name PFS_thread::m_db_name |
Database name.
Protected by m_stmt_lock
.
bool PFS_thread::m_debug_session_notified |
LF_PINS* PFS_thread::m_digest_hash_pins |
Pins for digest_hash.
bool PFS_thread::m_enabled |
Thread instrumentation flag.
ulonglong PFS_thread::m_event_id |
Event ID counter.
uint PFS_thread::m_events_statements_count |
Size of m_events_statements_stack
.
PFS_events_waits* PFS_thread::m_events_waits_current |
Current wait event in the event stack.
PFS_events_waits PFS_thread::m_events_waits_stack[WAIT_STACK_SIZE] |
Stack of events waits.
This member holds the data for the table PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. Note that stack[0] is a dummy record that represents the parent stage/statement/transaction. For example, assuming the following tree:
The whole point of the stack[0] record is to allow this optimization in the code, in the instrumentation for wait events: wait->m_nesting_event_id= (wait-1)->m_event_id; wait->m_nesting_event_type= (wait-1)->m_event_type; This code works for both the top level wait, and nested waits, and works without if conditions, which helps performances.
LF_PINS* PFS_thread::m_filename_hash_pins |
Pins for filename_hash.
bool PFS_thread::m_flag_events_stages_history |
Derived flag flag_events_stages_history, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_STAGES_HISTORY].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
bool PFS_thread::m_flag_events_stages_history_long |
Derived flag flag_events_stages_history_long, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_STAGES_HISTORY_LONG].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
bool PFS_thread::m_flag_events_statements_history |
Derived flag flag_events_statements_history, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_STATEMENTS_HISTORY].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
bool PFS_thread::m_flag_events_statements_history_long |
Derived flag flag_events_statements_history_long, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_STATEMENTS_HISTORY_LONG].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
bool PFS_thread::m_flag_events_transactions_history |
Derived flag flag_events_transactions_history, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_TRANSACTIONS_HISTORY].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
bool PFS_thread::m_flag_events_transactions_history_long |
Derived flag flag_events_transactions_history_long, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_TRANSACTIONS_HISTORY_LONG].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
bool PFS_thread::m_flag_events_waits_history |
Derived flag flag_events_waits_history, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_WAITS_HISTORY].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
bool PFS_thread::m_flag_events_waits_history_long |
Derived flag flag_events_waits_history_long, per thread.
Cached computation of TABLE SETUP_CONSUMERS[EVENTS_WAITS_HISTORY_LONG].ENABLED == 'YES' AND TABLE THREADS[THREAD_ID].HISTORY == 'YES'
char PFS_thread::m_groupname[NAME_LEN] |
Resource group name.
Protected by m_session_lock
.
uint PFS_thread::m_groupname_length |
Length of m_groupname
.
Protected by m_session_lock
.
bool PFS_thread::m_history |
Thread history instrumentation flag.
PFS_host* PFS_thread::m_host |
LF_PINS* PFS_thread::m_host_hash_pins |
Pins for host_hash.
PFS_host_name PFS_thread::m_host_name |
Host name.
Protected by m_session_lock
.
PFS_memory_safe_stat* PFS_thread::m_instr_class_memory_stats |
Per thread memory aggregated statistics.
This member holds the data for the table PERFORMANCE_SCHEMA.MEMORY_SUMMARY_BY_THREAD_BY_EVENT_NAME. Immutable, safe to use without internal lock.
pfs_lock PFS_thread::m_lock |
Internal lock.
This lock is exclusively used to protect against races when creating and destroying PFS_thread. Do not use this lock to protect thread attributes, use one of m_stmt_lock
or m_session_lock
instead.
char PFS_thread::m_os_name[PFS_MAX_OS_NAME_LENGTH] |
Operating system name.
ulonglong PFS_thread::m_parent_thread_internal_id |
Parent internal thread identifier.
uint PFS_thread::m_peer_port |
Remote (peer) port.
ulong PFS_thread::m_processlist_id |
char PFS_thread::m_processlist_info[COL_INFO_SIZE] |
Processlist info.
Protected by m_stmt_lock
.
uint PFS_thread::m_processlist_info_length |
Length of m_processlist_info_length
.
Protected by m_stmt_lock
.
LF_PINS* PFS_thread::m_program_hash_pins |
Pins for routine_hash.
bool PFS_thread::m_secondary |
Executed on secondary engine.
PFS_session_all_memory_stat PFS_thread::m_session_all_memory_stat |
char* PFS_thread::m_session_connect_attrs |
Buffer for the connection attributes.
Protected by m_session_lock
.
uint PFS_thread::m_session_connect_attrs_cs_number |
Character set in which m_connect_attrs
are encoded.
Protected by m_session_lock
.
uint PFS_thread::m_session_connect_attrs_length |
Length used by m_connect_attrs
.
Protected by m_session_lock
.
pfs_lock PFS_thread::m_session_lock |
Internal lock, for session attributes.
Statement attributes are expected to be updated in frequently, typically per session execution.
LF_PINS* PFS_thread::m_setup_actor_hash_pins |
Pins for setup_actor_hash.
LF_PINS* PFS_thread::m_setup_object_hash_pins |
Pins for setup_object_hash.
struct sockaddr_storage PFS_thread::m_sock_addr |
Raw socket address.
socklen_t PFS_thread::m_sock_addr_len |
Length of address.
PFS_stage_key PFS_thread::m_stage |
Processlist state (derived from stage).
PFS_events_stages PFS_thread::m_stage_current |
PSI_stage_progress* PFS_thread::m_stage_progress |
Current stage progress.
PFS_events_stages* PFS_thread::m_stages_history |
Stages history circular buffer.
This member holds the data for the table PERFORMANCE_SCHEMA.EVENTS_STAGES_HISTORY.
bool PFS_thread::m_stages_history_full |
True if the circular buffer m_stages_history
is full.
uint PFS_thread::m_stages_history_index |
Current index in the circular buffer m_stages_history
.
time_t PFS_thread::m_start_time |
Start time.
PFS_events_statements* PFS_thread::m_statement_stack |
PFS_events_statements* PFS_thread::m_statements_history |
Statements history circular buffer.
This member holds the data for the table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_HISTORY.
bool PFS_thread::m_statements_history_full |
True if the circular buffer m_statements_history
is full.
uint PFS_thread::m_statements_history_index |
Current index in the circular buffer m_statements_history
.
pfs_lock PFS_thread::m_stmt_lock |
Internal lock, for statement attributes.
Statement attributes are expected to be updated frequently, typically per statement execution.
bool PFS_thread::m_system_thread |
True if a system thread.
LF_PINS* PFS_thread::m_table_share_hash_pins |
Pins for table_share_hash.
telemetry_t* PFS_thread::m_telemetry |
Copy of g_telemetry.
telemetry_session_t* PFS_thread::m_telemetry_session |
THD* PFS_thread::m_thd |
ulonglong PFS_thread::m_thread_internal_id |
Internal thread identifier, unique.
my_thread_os_id_t PFS_thread::m_thread_os_id |
External (Operating system) thread identifier, if any.
PFS_events_transactions PFS_thread::m_transaction_current |
PFS_events_transactions* PFS_thread::m_transactions_history |
Statements history circular buffer.
This member holds the data for the table PERFORMANCE_SCHEMA.EVENTS_TRANSACTIONS_HISTORY.
bool PFS_thread::m_transactions_history_full |
True if the circular buffer m_transactions_history
is full.
uint PFS_thread::m_transactions_history_index |
Current index in the circular buffer m_transactions_history
.
PFS_user* PFS_thread::m_user |
void* PFS_thread::m_user_data |
User-defined data.
LF_PINS* PFS_thread::m_user_hash_pins |
Pins for user_hash.
PFS_user_name PFS_thread::m_user_name |
User name.
Protected by m_session_lock
.
PFS_events_waits* PFS_thread::m_waits_history |
Waits history circular buffer.
This member holds the data for the table PERFORMANCE_SCHEMA.EVENTS_WAITS_HISTORY.
bool PFS_thread::m_waits_history_full |
True if the circular buffer m_waits_history
is full.
uint PFS_thread::m_waits_history_index |
Current index in the circular buffer m_waits_history
.