MySQL 8.4.0
Source Code Documentation
Collaboration diagram for Mutex Instrumentation (ABI):

Classes

struct  PSI_mutex_info_v1
 Mutex information. More...
 
struct  PSI_mutex
 Interface for an instrumented mutex. More...
 
struct  PSI_mutex_locker_state_v1
 State data storage for start_mutex_wait_v1_t. More...
 
struct  s_mysql_mysql_mutex_v1
 
struct  PSI_mutex_bootstrap
 Entry point for the performance schema interface. More...
 
struct  PSI_mutex_service_v1
 Performance Schema Mutex Interface, version 1. More...
 

Macros

#define PSI_MUTEX_VERSION_1   1
 Performance Schema Mutex Interface number for version 1. More...
 
#define PSI_CURRENT_MUTEX_VERSION   1
 Performance Schema Mutex Interface number for the most recent version. More...
 
#define REQUIRES_MYSQL_MUTEX_SERVICE   REQUIRES_SERVICE(mysql_mutex_v1)
 

Typedefs

typedef unsigned int PSI_mutex_key
 Instrumented mutex key. More...
 
typedef struct PSI_mutex PSI_mutex
 
typedef struct PSI_mutex_locker PSI_mutex_locker
 
typedef enum PSI_mutex_operation PSI_mutex_operation
 
typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state_v1
 
typedef void(* register_mutex_v1_t) (const char *category, struct PSI_mutex_info_v1 *info, int count)
 Mutex registration API. More...
 
typedef struct PSI_mutex *(* init_mutex_v1_t) (PSI_mutex_key key, const void *identity)
 Mutex instrumentation initialization API. More...
 
typedef void(* destroy_mutex_v1_t) (struct PSI_mutex *mutex)
 Mutex instrumentation destruction API. More...
 
typedef void(* unlock_mutex_v1_t) (struct PSI_mutex *mutex)
 Record a mutex instrumentation unlock event. More...
 
typedef struct PSI_mutex_locker *(* start_mutex_wait_v1_t) (struct PSI_mutex_locker_state_v1 *state, struct PSI_mutex *mutex, enum PSI_mutex_operation op, const char *src_file, unsigned int src_line)
 Record a mutex instrumentation wait start event. More...
 
typedef void(* end_mutex_wait_v1_t) (struct PSI_mutex_locker *locker, int rc)
 Record a mutex instrumentation wait end event. More...
 
typedef struct PSI_mutex_info_v1 PSI_mutex_info_v1
 
typedef PSI_mutex_info_v1 PSI_mutex_info
 
typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state
 
typedef void(* mysql_mutex_register_t) (const char *category, PSI_mutex_info *info, int count)
 
typedef int(* mysql_mutex_init_t) (PSI_mutex_key key, mysql_mutex_t *that, const native_mutexattr_t *attr, const char *src_file, unsigned int src_line)
 
typedef int(* mysql_mutex_destroy_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)
 
typedef int(* mysql_mutex_lock_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)
 
typedef int(* mysql_mutex_trylock_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)
 
typedef int(* mysql_mutex_unlock_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)
 
typedef struct s_mysql_mysql_mutex_v1 mysql_service_mysql_mutex_v1_t
 
typedef const mysql_service_mysql_mutex_v1_t mysql_mutex_service_t
 Mutex service. More...
 
typedef struct PSI_mutex_service_v1 PSI_mutex_service_t
 

Enumerations

enum  PSI_mutex_operation { PSI_MUTEX_LOCK = 0 , PSI_MUTEX_TRYLOCK = 1 }
 Operation performed on an instrumented mutex. More...
 

Variables

MYSQL_PLUGIN_IMPORT PSI_mutex_service_tpsi_mutex_service
 

Detailed Description

Macro Definition Documentation

◆ PSI_CURRENT_MUTEX_VERSION

#define PSI_CURRENT_MUTEX_VERSION   1

Performance Schema Mutex Interface number for the most recent version.

The most current version is PSI_MUTEX_VERSION_1

◆ PSI_MUTEX_VERSION_1

#define PSI_MUTEX_VERSION_1   1

Performance Schema Mutex Interface number for version 1.

This version is supported.

◆ REQUIRES_MYSQL_MUTEX_SERVICE

#define REQUIRES_MYSQL_MUTEX_SERVICE   REQUIRES_SERVICE(mysql_mutex_v1)

Typedef Documentation

◆ destroy_mutex_v1_t

typedef void(* destroy_mutex_v1_t) (struct PSI_mutex *mutex)

Mutex instrumentation destruction API.

Parameters
mutexthe mutex to destroy

◆ end_mutex_wait_v1_t

typedef void(* end_mutex_wait_v1_t) (struct PSI_mutex_locker *locker, int rc)

Record a mutex instrumentation wait end event.

Parameters
lockera thread locker for the running thread
rcthe wait operation return code

◆ init_mutex_v1_t

typedef struct PSI_mutex *(* init_mutex_v1_t) (PSI_mutex_key key, const void *identity)

Mutex instrumentation initialization API.

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

◆ mysql_mutex_destroy_t

typedef int(* mysql_mutex_destroy_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)

◆ mysql_mutex_init_t

typedef int(* mysql_mutex_init_t) (PSI_mutex_key key, mysql_mutex_t *that, const native_mutexattr_t *attr, const char *src_file, unsigned int src_line)

◆ mysql_mutex_lock_t

typedef int(* mysql_mutex_lock_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)

◆ mysql_mutex_register_t

typedef void(* mysql_mutex_register_t) (const char *category, PSI_mutex_info *info, int count)

◆ mysql_mutex_service_t

◆ mysql_mutex_trylock_t

typedef int(* mysql_mutex_trylock_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)

◆ mysql_mutex_unlock_t

typedef int(* mysql_mutex_unlock_t) (mysql_mutex_t *that, const char *src_file, unsigned int src_line)

◆ mysql_service_mysql_mutex_v1_t

◆ PSI_mutex

typedef struct PSI_mutex PSI_mutex

◆ PSI_mutex_info

◆ PSI_mutex_info_v1

◆ PSI_mutex_key

typedef unsigned int PSI_mutex_key

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_mutex_locker

◆ PSI_mutex_locker_state

◆ PSI_mutex_locker_state_v1

◆ PSI_mutex_operation

◆ PSI_mutex_service_t

◆ register_mutex_v1_t

typedef void(* register_mutex_v1_t) (const char *category, struct PSI_mutex_info_v1 *info, int count)

Mutex registration API.

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

◆ start_mutex_wait_v1_t

typedef struct PSI_mutex_locker *(* start_mutex_wait_v1_t) (struct PSI_mutex_locker_state_v1 *state, struct PSI_mutex *mutex, enum PSI_mutex_operation op, const char *src_file, unsigned int src_line)

Record a mutex instrumentation wait start event.

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

◆ unlock_mutex_v1_t

typedef void(* unlock_mutex_v1_t) (struct PSI_mutex *mutex)

Record a mutex instrumentation unlock event.

Parameters
mutexthe mutex instrumentation

Enumeration Type Documentation

◆ PSI_mutex_operation

Operation performed on an instrumented mutex.

Enumerator
PSI_MUTEX_LOCK 

Lock.

PSI_MUTEX_TRYLOCK 

Lock attempt.

Variable Documentation

◆ psi_mutex_service

MYSQL_PLUGIN_IMPORT PSI_mutex_service_t* psi_mutex_service
extern