For the complete documentation index, see llms.txt. This page is also available as Markdown.

Instrumentation Interface

The Performance Schema instrumentation interface (PSI) that the server and plugins use to report locks, I/O, statements, and other events, with links to each instrumentation group.

Groups

Classes

Name
Description

Interface for an instrumented stage progress. This is a public structure, for efficiency.

State data storage for start_table_io_wait_v1_t, start_table_lock_wait_v1_t. This structure provide temporary storage to a table locker. The content of this structure is considered opaque, the fields are only hints of what an implementation of the psi interface can use. This memory is provided by the instrumented code for performance reasons. See also: start_table_io_wait_v1_t

Entry point for the performance schema interface.

Dummy structure, used to declare PSI_server when no instrumentation is available. The content does not matter, since PSI_server will be NULL.

Stage instrument information. Since: PSI_VERSION_1 This structure is used to register an instrumented stage.

Macros

Name
Description

Global flag. This flag indicate that an instrumentation point is a global variable, or a singleton.

Mutable flag. This flag indicate that an instrumentation point is a general placeholder, that can mutate into a more specific instrumentation point.

Stage progress flag. This flag apply to the stage instruments only. It indicates the instrumentation provides progress data.

Shared Exclusive flag. Indicates that rwlock support the shared exclusive state.

Transferable flag. This flag indicate that an instrumented object can be created by a thread and destroyed by another thread.

Volatility flag. This flag indicate that an instrumented object has a volatility (life cycle) comparable to the volatility of a session.

System thread flag. Indicates that the instrumented object exists on a system thread.


PSI_DYNAMIC_CALL

Defined in psi/psi.h:3028


PSI_INSTRUMENT_ME

Defined in psi/psi_base.h:47


PSI_INSTRUMENT_MEM

Defined in psi/psi_base.h:48


PSI_NOT_INSTRUMENTED

Defined in psi/psi_base.h:50


PSI_FLAG_GLOBAL

Defined in psi/psi_base.h:57

Global flag. This flag indicate that an instrumentation point is a global variable, or a singleton.


PSI_FLAG_MUTABLE

Defined in psi/psi_base.h:64

Mutable flag. This flag indicate that an instrumentation point is a general placeholder, that can mutate into a more specific instrumentation point.


PSI_FLAG_THREAD

Defined in psi/psi_base.h:66


PSI_FLAG_STAGE_PROGRESS

Defined in psi/psi_base.h:73

Stage progress flag. This flag apply to the stage instruments only. It indicates the instrumentation provides progress data.


PSI_RWLOCK_FLAG_SX

Defined in psi/psi_base.h:79

Shared Exclusive flag. Indicates that rwlock support the shared exclusive state.


PSI_FLAG_TRANSFER

Defined in psi/psi_base.h:86

Transferable flag. This flag indicate that an instrumented object can be created by a thread and destroyed by another thread.


PSI_FLAG_VOLATILITY_SESSION

Defined in psi/psi_base.h:94

Volatility flag. This flag indicate that an instrumented object has a volatility (life cycle) comparable to the volatility of a session.


PSI_FLAG_THREAD_SYSTEM

Defined in psi/psi_base.h:100

System thread flag. Indicates that the instrumented object exists on a system thread.

Enumerations

Name
Description

IO operation performed on an instrumented table.


PSI_table_io_operation

Defined in psi/psi.h:241

IO operation performed on an instrumented table.

Value
Description

PSI_TABLE_FETCH_ROW

Row fetch.

PSI_TABLE_WRITE_ROW

Row write.

PSI_TABLE_UPDATE_ROW

Row update.

PSI_TABLE_DELETE_ROW

Row delete.

Typedefs

Return
Name
Description

unsigned int

Instrumented mutex key. To instrument a mutex, a mutex key must be obtained using register_mutex. Using a zero key always disable the instrumentation.

unsigned int

Instrumented rwlock key. To instrument a rwlock, a rwlock key must be obtained using register_rwlock. Using a zero key always disable the instrumentation.

unsigned int

Instrumented cond key. To instrument a condition, a condition key must be obtained using register_cond. Using a zero key always disable the instrumentation.

unsigned int

Instrumented thread key. To instrument a thread, a thread key must be obtained using register_thread. Using a zero key always disable the instrumentation.

unsigned int

Instrumented file key. To instrument a file, a file key must be obtained using register_file. Using a zero key always disable the instrumentation.

unsigned int

Instrumented stage key. To instrument a stage, a stage key must be obtained using register_stage. Using a zero key always disable the instrumentation.

unsigned int

Instrumented statement key. To instrument a statement, a statement key must be obtained using register_statement. Using a zero key always disable the instrumentation.

unsigned int

Instrumented socket key. To instrument a socket, a socket key must be obtained using register_socket. Using a zero key always disable the instrumentation.

struct PSI_v1

The instrumentation interface for the current version. See also: PSI_CURRENT_VERSION

The mutex information structure for the current version.

The rwlock information structure for the current version.

The cond information structure for the current version.

The thread information structure for the current version.

The file information structure for the current version.

The stage instrumentation has to co exist with the legacy THD::set_proc_info instrumentation. To avoid duplication of the instrumentation in the server, the common PSI_stage_info structure is used, so we export it here, even when not building with HAVE_PSI_INTERFACE.

struct PSI_transaction_info_v1


PSI_mutex

Type: struct PSI_mutex

Defined in psi/psi.h:115


PSI_rwlock

Type: struct PSI_rwlock

Defined in psi/psi.h:122


PSI_cond

Type: struct PSI_cond

Defined in psi/psi.h:129


PSI_table_share

Type: struct PSI_table_share

Defined in psi/psi.h:136


PSI_table

Type: struct PSI_table

Defined in psi/psi.h:143


PSI_thread

Type: struct PSI_thread

Defined in psi/psi.h:150


PSI_file

Type: struct PSI_file

Defined in psi/psi.h:157


PSI_socket

Type: struct PSI_socket

Defined in psi/psi.h:164


PSI_prepared_stmt

Type: struct PSI_prepared_stmt

Defined in psi/psi.h:171


PSI_table_locker

Type: struct PSI_table_locker

Defined in psi/psi.h:178


PSI_statement_locker

Type: struct PSI_statement_locker

Defined in psi/psi.h:185


PSI_transaction_locker

Type: struct PSI_transaction_locker

Defined in psi/psi.h:192


PSI_idle_locker

Type: struct PSI_idle_locker

Defined in psi/psi.h:199


PSI_digest_locker

Type: struct PSI_digest_locker

Defined in psi/psi.h:206


PSI_sp_share

Type: struct PSI_sp_share

Defined in psi/psi.h:213


PSI_sp_locker

Type: struct PSI_sp_locker

Defined in psi/psi.h:220


PSI_metadata_lock

Type: struct PSI_metadata_lock

Defined in psi/psi.h:227


PSI_stage_progress

Type: struct PSI_stage_progress

Defined in psi/psi.h:238


PSI_table_io_operation

Type: enum PSI_table_io_operation

Defined in psi/psi.h:252


PSI_table_locker_state

Type: struct PSI_table_locker_state

Defined in psi/psi.h:290


PSI_bootstrap

Type: struct PSI_bootstrap

Defined in psi/psi.h:310


PSI_mutex_key

Defined in psi/psi.h:792

Instrumented mutex key. To instrument a mutex, a mutex key must be obtained using register_mutex. Using a zero key always disable the instrumentation.


PSI_rwlock_key

Defined in psi/psi.h:800

Instrumented rwlock key. To instrument a rwlock, a rwlock key must be obtained using register_rwlock. Using a zero key always disable the instrumentation.


PSI_cond_key

Defined in psi/psi.h:808

Instrumented cond key. To instrument a condition, a condition key must be obtained using register_cond. Using a zero key always disable the instrumentation.


PSI_thread_key

Defined in psi/psi.h:816

Instrumented thread key. To instrument a thread, a thread key must be obtained using register_thread. Using a zero key always disable the instrumentation.


PSI_file_key

Defined in psi/psi.h:823

Instrumented file key. To instrument a file, a file key must be obtained using register_file. Using a zero key always disable the instrumentation.


PSI_stage_key

Defined in psi/psi.h:830

Instrumented stage key. To instrument a stage, a stage key must be obtained using register_stage. Using a zero key always disable the instrumentation.


PSI_statement_key

Defined in psi/psi.h:837

Instrumented statement key. To instrument a statement, a statement key must be obtained using register_statement. Using a zero key always disable the instrumentation.


PSI_socket_key

Defined in psi/psi.h:844

Instrumented socket key. To instrument a socket, a socket key must be obtained using register_socket. Using a zero key always disable the instrumentation.


PSI

Type: struct PSI_v1

Defined in psi/psi.h:2930

The instrumentation interface for the current version. See also: PSI_CURRENT_VERSION


PSI_mutex_info

Type: struct PSI_mutex_info_v1

Defined in psi/psi.h:2931

The mutex information structure for the current version.


PSI_rwlock_info

Type: struct PSI_rwlock_info_v1

Defined in psi/psi.h:2932

The rwlock information structure for the current version.


PSI_cond_info

Type: struct PSI_cond_info_v1

Defined in psi/psi.h:2933

The cond information structure for the current version.


PSI_thread_info

Type: struct PSI_thread_info_v1

Defined in psi/psi.h:2934

The thread information structure for the current version.


PSI_file_info

Type: struct PSI_file_info_v1

Defined in psi/psi.h:2935

The file information structure for the current version.


PSI_stage_info

Type: struct PSI_stage_info_v1

Defined in psi/psi.h:2936

The stage instrumentation has to co exist with the legacy THD::set_proc_info instrumentation. To avoid duplication of the instrumentation in the server, the common PSI_stage_info structure is used, so we export it here, even when not building with HAVE_PSI_INTERFACE.


PSI_statement_info

Type: struct PSI_statement_info_v1

Defined in psi/psi.h:2937


PSI_transaction_info

Defined in psi/psi.h:2938


PSI_socket_info

Type: struct PSI_socket_info_v1

Defined in psi/psi.h:2939


PSI_idle_locker_state

Type: struct PSI_idle_locker_state_v1

Defined in psi/psi.h:2940


PSI_mutex_locker_state

Type: struct PSI_mutex_locker_state_v1

Defined in psi/psi.h:2941


PSI_rwlock_locker_state

Type: struct PSI_rwlock_locker_state_v1

Defined in psi/psi.h:2942


PSI_cond_locker_state

Type: struct PSI_cond_locker_state_v1

Defined in psi/psi.h:2943


PSI_file_locker_state

Type: struct PSI_file_locker_state_v1

Defined in psi/psi.h:2944


PSI_statement_locker_state

Type: struct PSI_statement_locker_state_v1

Defined in psi/psi.h:2945


PSI_transaction_locker_state

Type: struct PSI_transaction_locker_state_v1

Defined in psi/psi.h:2946


PSI_socket_locker_state

Type: struct PSI_socket_locker_state_v1

Defined in psi/psi.h:2947


PSI_sp_locker_state

Type: struct PSI_sp_locker_state_v1

Defined in psi/psi.h:2948


PSI_metadata_locker_state

Type: struct PSI_metadata_locker_state_v1

Defined in psi/psi.h:2949


PSI_metadata_locker

Type: struct PSI_stage_info_none

Defined in psi/psi.h:3015


PSI_memory_info

Type: struct PSI_memory_info_v1

Defined in psi/psi_memory.h:148

Variables

Return
Name
Description

MYSQL_PLUGIN_IMPORT PSI *


PSI_server

Type: MYSQL_PLUGIN_IMPORT PSI *

Defined in psi/psi.h:3019

Class Definitions

PSI_stage_progress

Defined in psi/psi.h:233

Interface for an instrumented stage progress. This is a public structure, for efficiency.

Public Attributes

Return
Name
Description

m_work_completed

Defined in psi/psi.h:235


m_work_estimated

Defined in psi/psi.h:236

PSI_table_locker_state

Defined in psi/psi.h:265

State data storage for start_table_io_wait_v1_t, start_table_lock_wait_v1_t. This structure provide temporary storage to a table locker. The content of this structure is considered opaque, the fields are only hints of what an implementation of the psi interface can use. This memory is provided by the instrumented code for performance reasons. See also: start_table_io_wait_v1_t

See also: start_table_lock_wait_v1_t

Public Attributes

Return
Name
Description

uint

Internal state.

Current io operation.

struct PSI_table *

Current table handle.

Current table share.

struct PSI_thread *

Current thread.

ulonglong

Timer start.

ulonglong(*

Timer function.

void *

Internal data.

uint

Implementation specific. For table io, the table io index. For table lock, the lock type.


m_flags

Defined in psi/psi.h:268

Internal state.


m_io_operation

Type: enum PSI_table_io_operation

Defined in psi/psi.h:270

Current io operation.


m_table

Type: struct PSI_table *

Defined in psi/psi.h:272

Current table handle.


m_table_share

Type: struct PSI_table_share *

Defined in psi/psi.h:274

Current table share.


m_thread

Type: struct PSI_thread *

Defined in psi/psi.h:276

Current thread.


m_timer_start

Defined in psi/psi.h:278

Timer start.


m_timer

Defined in psi/psi.h:280

Timer function.


m_wait

Defined in psi/psi.h:282

Internal data.


m_index

Defined in psi/psi.h:288

Implementation specific. For table io, the table io index. For table lock, the lock type.

PSI_bootstrap

Defined in psi/psi.h:293

Entry point for the performance schema interface.

Public Attributes

Return
Name
Description

void *(*

ABI interface finder. Calling this method with an interface version number returns either an instance of the ABI for this version, or NULL.


get_interface

Defined in psi/psi.h:308

ABI interface finder. Calling this method with an interface version number returns either an instance of the ABI for this version, or NULL.

Returns

a versioned interface (PSI_v1, PSI_v2 or PSI)

See also: PSI_VERSION_1

See also: PSI_v1

See also: PSI_VERSION_2

See also: PSI_v2

See also: PSI_CURRENT_VERSION

See also: PSI

Parameters

Parameter
Type
Description

version

the interface version number to find

PSI_none

Defined in psi/psi.h:2982

Dummy structure, used to declare PSI_server when no instrumentation is available. The content does not matter, since PSI_server will be NULL.

Public Attributes

Return
Name
Description

opaque

Defined in psi/psi.h:2984

PSI_stage_info_none

Defined in psi/psi.h:2993

Stage instrument information. Since: PSI_VERSION_1 This structure is used to register an instrumented stage.

Public Attributes

Return
Name
Description

unsigned int

Unused stage key.

const char *

The name of the stage instrument.

int

Unused stage flags.


m_key

Defined in psi/psi.h:2996

Unused stage key.


m_name

Defined in psi/psi.h:2998

The name of the stage instrument.


m_flags

Defined in psi/psi.h:3000

Unused stage flags.

Last updated

Was this helpful?