MySQL 9.1.0
Source Code Documentation
psi_mutex_bits.h File Reference

Instrumentation helpers for mutexes. More...

Go to the source code of this file.

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...
 

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...
 

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
 

Enumerations

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

Detailed Description

Instrumentation helpers for mutexes.

This header file provides the necessary declarations to use the mutex API with the performance schema instrumentation. In some compilers (SunStudio), 'static inline' functions, when declared but not used, are not optimized away (because they are unused) by default, so that including a static inline function from a header file does create unwanted dependencies, causing unresolved symbols at link time. Other compilers, like gcc, optimize these dependencies by default.