MySQL 9.0.0
Source Code Documentation
Collaboration diagram for Memory Instrumentation (ABI):

Classes

struct  PSI_memory_info_v1
 Memory instrument information. More...
 
struct  PSI_memory_bootstrap
 Entry point for the performance schema interface. More...
 
struct  PSI_memory_service_v2
 Performance Schema Memory Interface, version 2. More...
 

Macros

#define PSI_MEMORY_VERSION_1   1
 Performance Schema Memory Interface number for version 1. More...
 
#define PSI_MEMORY_VERSION_2   2
 Performance Schema Memory Interface number for version 2. More...
 
#define PSI_CURRENT_MEMORY_VERSION   2
 Performance Schema Memory Interface number for the most recent version. More...
 

Typedefs

typedef unsigned int PSI_memory_key
 Instrumented memory key. More...
 
typedef struct PSI_memory_info_v1 PSI_memory_info_v1
 
typedef void(* register_memory_v1_t) (const char *category, struct PSI_memory_info_v1 *info, int count)
 Memory registration API. More...
 
typedef PSI_memory_key(* memory_alloc_v1_t) (PSI_memory_key key, size_t size, struct PSI_thread **owner)
 Instrument memory allocation. More...
 
typedef PSI_memory_key(* memory_realloc_v1_t) (PSI_memory_key key, size_t old_size, size_t new_size, struct PSI_thread **owner)
 Instrument memory re allocation. More...
 
typedef PSI_memory_key(* memory_claim_v1_t) (PSI_memory_key key, size_t size, struct PSI_thread **owner)
 Instrument memory claim. More...
 
typedef PSI_memory_key(* memory_claim_v2_t) (PSI_memory_key key, size_t size, struct PSI_thread **owner, bool claim)
 Instrument memory claim. More...
 
typedef void(* memory_free_v1_t) (PSI_memory_key key, size_t size, struct PSI_thread *owner)
 Instrument memory free. More...
 
typedef struct PSI_memory_info_v1 PSI_memory_info
 
typedef unsigned int PSI_memory_key
 Instrumented memory key. More...
 
typedef struct PSI_memory_bootstrap PSI_memory_bootstrap
 
typedef struct PSI_memory_service_v2 PSI_memory_service_t
 

Variables

MYSQL_PLUGIN_IMPORT PSI_memory_service_tpsi_memory_service
 

Detailed Description

Macro Definition Documentation

◆ PSI_CURRENT_MEMORY_VERSION

#define PSI_CURRENT_MEMORY_VERSION   2

Performance Schema Memory Interface number for the most recent version.

The most current version is PSI_MEMORY_VERSION_2

◆ PSI_MEMORY_VERSION_1

#define PSI_MEMORY_VERSION_1   1

Performance Schema Memory Interface number for version 1.

This version is abandoned.

◆ PSI_MEMORY_VERSION_2

#define PSI_MEMORY_VERSION_2   2

Performance Schema Memory Interface number for version 2.

This version is supported.

Typedef Documentation

◆ memory_alloc_v1_t

typedef PSI_memory_key(* memory_alloc_v1_t) (PSI_memory_key key, size_t size, struct PSI_thread **owner)

Instrument memory allocation.

Parameters
keythe memory instrument key
sizethe size of memory allocated
[out]ownerthe memory owner
Returns
the effective memory instrument key

◆ memory_claim_v1_t

typedef PSI_memory_key(* memory_claim_v1_t) (PSI_memory_key key, size_t size, struct PSI_thread **owner)

Instrument memory claim.

Parameters
keythe memory instrument key
sizethe size of memory allocated
[in,out]ownerthe memory owner
Returns
the effective memory instrument key

◆ memory_claim_v2_t

typedef PSI_memory_key(* memory_claim_v2_t) (PSI_memory_key key, size_t size, struct PSI_thread **owner, bool claim)

Instrument memory claim.

Parameters
keythe memory instrument key
sizethe size of memory allocated
[in,out]ownerthe memory owner
claimTrue to claim, false to unclaim
Returns
the effective memory instrument key

◆ memory_free_v1_t

typedef void(* memory_free_v1_t) (PSI_memory_key key, size_t size, struct PSI_thread *owner)

Instrument memory free.

Parameters
keythe memory instrument key
sizethe size of memory allocated
ownerthe memory owner

◆ memory_realloc_v1_t

typedef PSI_memory_key(* memory_realloc_v1_t) (PSI_memory_key key, size_t old_size, size_t new_size, struct PSI_thread **owner)

Instrument memory re allocation.

Parameters
keythe memory instrument key
old_sizethe size of memory previously allocated
new_sizethe size of memory re allocated
[in,out]ownerthe memory owner
Returns
the effective memory instrument key

◆ PSI_memory_bootstrap

◆ PSI_memory_info

◆ PSI_memory_info_v1

◆ PSI_memory_key [1/2]

typedef unsigned int PSI_memory_key

Instrumented memory key.

To instrument memory, a memory key must be obtained using register_memory. Using a zero key always disable the instrumentation.

◆ PSI_memory_key [2/2]

typedef unsigned int PSI_memory_key

Instrumented memory key.

To instrument memory, a memory key must be obtained using register_memory. Using a zero key always disable the instrumentation.

◆ PSI_memory_service_t

◆ register_memory_v1_t

typedef void(* register_memory_v1_t) (const char *category, struct PSI_memory_info_v1 *info, int count)

Memory registration API.

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

Variable Documentation

◆ psi_memory_service

MYSQL_PLUGIN_IMPORT PSI_memory_service_t* psi_memory_service
extern