MySQL 8.4.3
Source Code Documentation
Collaboration diagram for Rwlock Instrumentation (ABI):

Classes

struct  PSI_rwlock
 Interface for an instrumented rwlock. More...
 
struct  PSI_rwlock_info_v1
 Rwlock information. More...
 
struct  PSI_rwlock_locker_state_v1
 State data storage for start_rwlock_rdwait_v1_t, start_rwlock_wrwait_v1_t. More...
 
struct  PSI_rwlock_bootstrap
 Entry point for the performance schema interface. More...
 
struct  PSI_rwlock_service_v2
 Performance Schema Rwlock Interface, version 2. More...
 

Macros

#define PSI_RWLOCK_VERSION_1   1
 Performance Schema Rwlock Interface number for version 1. More...
 
#define PSI_RWLOCK_VERSION_2   2
 Performance Schema Rwlock Interface number for version 2. More...
 
#define PSI_CURRENT_RWLOCK_VERSION   2
 Performance Schema Rwlock Interface number for the most recent version. More...
 

Typedefs

typedef unsigned int PSI_rwlock_key
 Instrumented rwlock key. More...
 
typedef struct PSI_rwlock PSI_rwlock
 
typedef struct PSI_rwlock_locker PSI_rwlock_locker
 
typedef enum PSI_rwlock_operation PSI_rwlock_operation
 
typedef struct PSI_rwlock_info_v1 PSI_rwlock_info_v1
 
typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state_v1
 
typedef void(* register_rwlock_v1_t) (const char *category, struct PSI_rwlock_info_v1 *info, int count)
 Rwlock registration API. More...
 
typedef struct PSI_rwlock *(* init_rwlock_v1_t) (PSI_rwlock_key key, const void *identity)
 Rwlock instrumentation initialization API. More...
 
typedef void(* destroy_rwlock_v1_t) (struct PSI_rwlock *rwlock)
 Rwlock instrumentation destruction API. More...
 
typedef struct PSI_rwlock_locker *(* start_rwlock_rdwait_v1_t) (struct PSI_rwlock_locker_state_v1 *state, struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op, const char *src_file, unsigned int src_line)
 Record a rwlock instrumentation read wait start event. More...
 
typedef void(* end_rwlock_rdwait_v1_t) (struct PSI_rwlock_locker *locker, int rc)
 Record a rwlock instrumentation read wait end event. More...
 
typedef struct PSI_rwlock_locker *(* start_rwlock_wrwait_v1_t) (struct PSI_rwlock_locker_state_v1 *state, struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op, const char *src_file, unsigned int src_line)
 Record a rwlock instrumentation write wait start event. More...
 
typedef void(* end_rwlock_wrwait_v1_t) (struct PSI_rwlock_locker *locker, int rc)
 Record a rwlock instrumentation write wait end event. More...
 
typedef void(* unlock_rwlock_v1_t) (struct PSI_rwlock *rwlock)
 Record a rwlock instrumentation unlock event. More...
 
typedef void(* unlock_rwlock_v2_t) (struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op)
 Record a rwlock instrumentation unlock event. More...
 
typedef struct PSI_rwlock_info_v1 PSI_rwlock_info
 
typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state
 
typedef struct PSI_rwlock_bootstrap PSI_rwlock_bootstrap
 
typedef struct PSI_rwlock_service_v2 PSI_rwlock_service_t
 

Enumerations

enum  PSI_rwlock_operation {
  PSI_RWLOCK_READLOCK = 0 , PSI_RWLOCK_WRITELOCK = 1 , PSI_RWLOCK_TRYREADLOCK = 2 , PSI_RWLOCK_TRYWRITELOCK = 3 ,
  PSI_RWLOCK_UNLOCK = 4 , PSI_RWLOCK_SHAREDLOCK = 5 , PSI_RWLOCK_SHAREDEXCLUSIVELOCK = 6 , PSI_RWLOCK_EXCLUSIVELOCK = 7 ,
  PSI_RWLOCK_TRYSHAREDLOCK = 8 , PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK = 9 , PSI_RWLOCK_TRYEXCLUSIVELOCK = 10 , PSI_RWLOCK_SHAREDUNLOCK = 11 ,
  PSI_RWLOCK_SHAREDEXCLUSIVEUNLOCK = 12 , PSI_RWLOCK_EXCLUSIVEUNLOCK = 13
}
 Operation performed on an instrumented rwlock. More...
 

Variables

MYSQL_PLUGIN_IMPORT PSI_rwlock_service_tpsi_rwlock_service
 

Detailed Description

Macro Definition Documentation

◆ PSI_CURRENT_RWLOCK_VERSION

#define PSI_CURRENT_RWLOCK_VERSION   2

Performance Schema Rwlock Interface number for the most recent version.

The most current version is PSI_RWLOCK_VERSION_2

◆ PSI_RWLOCK_VERSION_1

#define PSI_RWLOCK_VERSION_1   1

Performance Schema Rwlock Interface number for version 1.

This version is obsolete.

◆ PSI_RWLOCK_VERSION_2

#define PSI_RWLOCK_VERSION_2   2

Performance Schema Rwlock Interface number for version 2.

This version is supported.

Typedef Documentation

◆ destroy_rwlock_v1_t

typedef void(* destroy_rwlock_v1_t) (struct PSI_rwlock *rwlock)

Rwlock instrumentation destruction API.

Parameters
rwlockthe rwlock to destroy

◆ end_rwlock_rdwait_v1_t

typedef void(* end_rwlock_rdwait_v1_t) (struct PSI_rwlock_locker *locker, int rc)

Record a rwlock instrumentation read wait end event.

Parameters
lockera thread locker for the running thread
rc0 if the lock was acquired, 1 if it was not

◆ end_rwlock_wrwait_v1_t

typedef void(* end_rwlock_wrwait_v1_t) (struct PSI_rwlock_locker *locker, int rc)

Record a rwlock instrumentation write wait end event.

Parameters
lockera thread locker for the running thread
rc0 if the lock was acquired, 1 if it was not

◆ init_rwlock_v1_t

typedef struct PSI_rwlock *(* init_rwlock_v1_t) (PSI_rwlock_key key, const void *identity)

Rwlock instrumentation initialization API.

Parameters
keythe registered rwlock key
identitythe address of the rwlock itself
Returns
an instrumented rwlock

◆ PSI_rwlock

typedef struct PSI_rwlock PSI_rwlock

◆ PSI_rwlock_bootstrap

◆ PSI_rwlock_info

◆ PSI_rwlock_info_v1

◆ PSI_rwlock_key

typedef unsigned int PSI_rwlock_key

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_rwlock_locker

◆ PSI_rwlock_locker_state

◆ PSI_rwlock_locker_state_v1

◆ PSI_rwlock_operation

◆ PSI_rwlock_service_t

◆ register_rwlock_v1_t

typedef void(* register_rwlock_v1_t) (const char *category, struct PSI_rwlock_info_v1 *info, int count)

Rwlock registration API.

Parameters
categorya category name (typically a plugin name)
infoan array of rwlock info to register
countthe size of the info array

◆ start_rwlock_rdwait_v1_t

typedef struct PSI_rwlock_locker *(* start_rwlock_rdwait_v1_t) (struct PSI_rwlock_locker_state_v1 *state, struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op, const char *src_file, unsigned int src_line)

Record a rwlock instrumentation read wait start event.

Parameters
statedata storage for the locker
rwlockthe instrumented rwlock to lock
opthe operation to perform
src_filethe source file name
src_linethe source line number
Returns
a rwlock locker, or NULL

◆ start_rwlock_wrwait_v1_t

typedef struct PSI_rwlock_locker *(* start_rwlock_wrwait_v1_t) (struct PSI_rwlock_locker_state_v1 *state, struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op, const char *src_file, unsigned int src_line)

Record a rwlock instrumentation write wait start event.

Parameters
statedata storage for the locker
rwlockthe instrumented rwlock to lock
opthe operation to perform
src_filethe source file name
src_linethe source line number
Returns
a rwlock locker, or NULL

◆ unlock_rwlock_v1_t

typedef void(* unlock_rwlock_v1_t) (struct PSI_rwlock *rwlock)

Record a rwlock instrumentation unlock event.

Parameters
rwlockthe rwlock instrumentation

◆ unlock_rwlock_v2_t

typedef void(* unlock_rwlock_v2_t) (struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op)

Record a rwlock instrumentation unlock event.

Parameters
rwlockthe rwlock instrumentation
opthe unlock operation performed

Enumeration Type Documentation

◆ PSI_rwlock_operation

Operation performed on an instrumented rwlock.

For basic READ / WRITE lock, operations are "READ" or "WRITE". For SX-locks, operations are "SHARED", "SHARED-EXCLUSIVE" or "EXCLUSIVE".

Enumerator
PSI_RWLOCK_READLOCK 

Read lock.

PSI_RWLOCK_WRITELOCK 

Write lock.

PSI_RWLOCK_TRYREADLOCK 

Read lock attempt.

PSI_RWLOCK_TRYWRITELOCK 

Write lock attempt.

PSI_RWLOCK_UNLOCK 

Unlock (Read or Write).

PSI_RWLOCK_SHAREDLOCK 

Shared lock.

PSI_RWLOCK_SHAREDEXCLUSIVELOCK 

Shared Exclusive lock.

PSI_RWLOCK_EXCLUSIVELOCK 

Exclusive lock.

PSI_RWLOCK_TRYSHAREDLOCK 

Shared lock attempt.

PSI_RWLOCK_TRYSHAREDEXCLUSIVELOCK 

Shared Exclusive lock attempt.

PSI_RWLOCK_TRYEXCLUSIVELOCK 

Exclusive lock attempt.

PSI_RWLOCK_SHAREDUNLOCK 

Unlock a shared lock.

PSI_RWLOCK_SHAREDEXCLUSIVEUNLOCK 

Unlock a shared exclusive lock.

PSI_RWLOCK_EXCLUSIVEUNLOCK 

Unlock an exclusive lock.

Variable Documentation

◆ psi_rwlock_service

MYSQL_PLUGIN_IMPORT PSI_rwlock_service_t* psi_rwlock_service
extern