MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PFS_thread Struct Reference

#include <pfs_instr.h>

Inheritance diagram for PFS_thread:
Collaboration diagram for PFS_thread:

Public Member Functions

void reset_session_connect_attrs ()
- Public Member Functions inherited from PFS_connection_slice
void reset_stats ()
void reset_waits_stats ()
void reset_stages_stats ()
void reset_statements_stats ()

Static Public Member Functions

static PFS_threadget_current_thread (void)
- Static Public Member Functions inherited from PFS_connection_slice
static PFS_single_statalloc_waits_slice (uint sizing)
static PFS_stage_statalloc_stages_slice (uint sizing)
static PFS_statement_statalloc_statements_slice (uint sizing)

Public Attributes

bool m_enabled
PFS_events_waitsm_events_waits_current
ulonglong m_event_id
pfs_lock m_lock
LF_PINSm_filename_hash_pins
LF_PINSm_table_share_hash_pins
LF_PINSm_setup_actor_hash_pins
LF_PINSm_setup_object_hash_pins
LF_PINSm_host_hash_pins
LF_PINSm_user_hash_pins
LF_PINSm_account_hash_pins
LF_PINSm_digest_hash_pins
ulonglong m_thread_internal_id
ulonglong m_parent_thread_internal_id
ulong m_processlist_id
PFS_thread_classm_class
PFS_events_waits m_events_waits_stack [WAIT_STACK_SIZE]
bool m_waits_history_full
uint m_waits_history_index
PFS_events_waitsm_waits_history
bool m_stages_history_full
uint m_stages_history_index
PFS_events_stagesm_stages_history
bool m_statements_history_full
uint m_statements_history_index
PFS_events_statementsm_statements_history
pfs_lock m_session_lock
char m_username [USERNAME_LENGTH]
uint m_username_length
char m_hostname [HOSTNAME_LENGTH]
uint m_hostname_length
char m_dbname [NAME_LEN]
uint m_dbname_length
int m_command
time_t m_start_time
pfs_lock m_stmt_lock
PFS_stage_key m_stage
char m_processlist_info [COL_INFO_SIZE]
uint m_processlist_info_length
PFS_events_stages m_stage_current
uint m_events_statements_count
PFS_events_statementsm_statement_stack
PFS_hostm_host
PFS_userm_user
PFS_accountm_account
char * m_session_connect_attrs
uint m_session_connect_attrs_length
const CHARSET_INFOm_session_connect_attrs_cs
- Public Attributes inherited from PFS_connection_slice
PFS_single_statm_instr_class_waits_stats
PFS_stage_statm_instr_class_stages_stats
PFS_statement_statm_instr_class_statements_stats

Detailed Description

Instrumented thread implementation.

See Also
PSI_thread.

Definition at line 364 of file pfs_instr.h.

Member Data Documentation

LF_PINS* PFS_thread::m_account_hash_pins

Pins for account_hash.

Definition at line 395 of file pfs_instr.h.

PFS_thread_class* PFS_thread::m_class

Thread class.

Definition at line 405 of file pfs_instr.h.

int PFS_thread::m_command

Current command.

Definition at line 506 of file pfs_instr.h.

char PFS_thread::m_dbname[NAME_LEN]

Database name. Protected by m_stmt_lock.

Definition at line 499 of file pfs_instr.h.

uint PFS_thread::m_dbname_length

Length of m_dbname. Protected by m_stmt_lock.

Definition at line 504 of file pfs_instr.h.

LF_PINS* PFS_thread::m_digest_hash_pins

Pins for digest_hash.

Definition at line 397 of file pfs_instr.h.

bool PFS_thread::m_enabled

Thread instrumentation flag.

Definition at line 369 of file pfs_instr.h.

ulonglong PFS_thread::m_event_id

Event ID counter

Definition at line 373 of file pfs_instr.h.

uint PFS_thread::m_events_statements_count

Size of m_events_statements_stack.

Definition at line 531 of file pfs_instr.h.

PFS_events_waits* PFS_thread::m_events_waits_current

Current wait event in the event stack.

Definition at line 371 of file pfs_instr.h.

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. For example, assuming the following tree:

  • STAGE ID 100
    • WAIT ID 101, parent STAGE 100
      • WAIT ID 102, parent wait 101 the data in the stack will be: stack[0].m_event_id= 100, set by the stage instrumentation stack[0].m_event_type= STAGE, set by the stage instrumentation stack[0].m_nesting_event_id= unused stack[0].m_nesting_event_type= unused stack[1].m_event_id= 101 stack[1].m_event_type= WAIT stack[1].m_nesting_event_id= stack[0].m_event_id= 100 stack[1].m_nesting_event_type= stack[0].m_event_type= STAGE stack[2].m_event_id= 102 stack[2].m_event_type= WAIT stack[2].m_nesting_event_id= stack[1].m_event_id= 101 stack[2].m_nesting_event_type= stack[1].m_event_type= WAIT

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.

Definition at line 435 of file pfs_instr.h.

LF_PINS* PFS_thread::m_filename_hash_pins

Pins for filename_hash.

Definition at line 383 of file pfs_instr.h.

LF_PINS* PFS_thread::m_host_hash_pins

Pins for host_hash.

Definition at line 391 of file pfs_instr.h.

char PFS_thread::m_hostname[HOSTNAME_LENGTH]

Host name. Protected by m_session_lock.

Definition at line 489 of file pfs_instr.h.

uint PFS_thread::m_hostname_length

Length of m_hostname. Protected by m_session_lock.

Definition at line 494 of file pfs_instr.h.

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.

Definition at line 381 of file pfs_instr.h.

ulonglong PFS_thread::m_parent_thread_internal_id

Parent internal thread identifier.

Definition at line 401 of file pfs_instr.h.

ulong PFS_thread::m_processlist_id

External (SHOW PROCESSLIST) thread identifier, not unique.

Definition at line 403 of file pfs_instr.h.

char PFS_thread::m_processlist_info[COL_INFO_SIZE]

Processlist info. Protected by m_stmt_lock.

Definition at line 521 of file pfs_instr.h.

uint PFS_thread::m_processlist_info_length

Length of m_processlist_info_length. Protected by m_stmt_lock.

Definition at line 526 of file pfs_instr.h.

char* PFS_thread::m_session_connect_attrs

Buffer for the connection attributes. Protected by m_session_lock.

Definition at line 545 of file pfs_instr.h.

const CHARSET_INFO* PFS_thread::m_session_connect_attrs_cs

Character set in which m_connect_attrs are encoded. Protected by m_session_lock.

Definition at line 555 of file pfs_instr.h.

uint PFS_thread::m_session_connect_attrs_length

Length used by m_connect_attrs. Protected by m_session_lock.

Definition at line 550 of file pfs_instr.h.

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.

Definition at line 474 of file pfs_instr.h.

LF_PINS* PFS_thread::m_setup_actor_hash_pins

Pins for setup_actor_hash.

Definition at line 387 of file pfs_instr.h.

LF_PINS* PFS_thread::m_setup_object_hash_pins

Pins for setup_object_hash.

Definition at line 389 of file pfs_instr.h.

PFS_stage_key PFS_thread::m_stage

Processlist state (derived from stage).

Definition at line 516 of file pfs_instr.h.

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.

Definition at line 456 of file pfs_instr.h.

bool PFS_thread::m_stages_history_full

True if the circular buffer m_stages_history is full.

Definition at line 448 of file pfs_instr.h.

uint PFS_thread::m_stages_history_index

Current index in the circular buffer m_stages_history.

Definition at line 450 of file pfs_instr.h.

time_t PFS_thread::m_start_time

Start time.

Definition at line 508 of file pfs_instr.h.

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.

Definition at line 467 of file pfs_instr.h.

bool PFS_thread::m_statements_history_full

True if the circular buffer m_statements_history is full.

Definition at line 459 of file pfs_instr.h.

uint PFS_thread::m_statements_history_index

Current index in the circular buffer m_statements_history.

Definition at line 461 of file pfs_instr.h.

pfs_lock PFS_thread::m_stmt_lock

Internal lock, for statement attributes. Statement attributes are expected to be updated frequently, typically per statement execution.

Definition at line 514 of file pfs_instr.h.

LF_PINS* PFS_thread::m_table_share_hash_pins

Pins for table_share_hash.

Definition at line 385 of file pfs_instr.h.

ulonglong PFS_thread::m_thread_internal_id

Internal thread identifier, unique.

Definition at line 399 of file pfs_instr.h.

LF_PINS* PFS_thread::m_user_hash_pins

Pins for user_hash.

Definition at line 393 of file pfs_instr.h.

char PFS_thread::m_username[USERNAME_LENGTH]

User name. Protected by m_session_lock.

Definition at line 479 of file pfs_instr.h.

uint PFS_thread::m_username_length

Length of m_username. Protected by m_session_lock.

Definition at line 484 of file pfs_instr.h.

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.

Definition at line 445 of file pfs_instr.h.

bool PFS_thread::m_waits_history_full

True if the circular buffer m_waits_history is full.

Definition at line 437 of file pfs_instr.h.

uint PFS_thread::m_waits_history_index

Current index in the circular buffer m_waits_history.

Definition at line 439 of file pfs_instr.h.


The documentation for this struct was generated from the following files: