MySQL 8.0.29
Source Code Documentation
pfs_server.h File Reference

Private interface for the server (declarations). More...

Go to the source code of this file.

Classes

struct  PFS_sizing_hints
 Sizing hints, from the server configuration. More...
 
struct  PFS_global_param
 Performance schema global sizing parameters. More...
 

Macros

#define PFS_AUTOSCALE_VALUE   (-1)
 
#define PFS_AUTOSIZE_VALUE   (-1)
 
#define PFS_MAX_MUTEX_CLASS   350
 
#define PFS_MAX_RWLOCK_CLASS   60
 
#define PFS_MAX_COND_CLASS   150
 
#define PFS_MAX_THREAD_CLASS   100
 
#define PFS_MAX_FILE_CLASS   80
 
#define PFS_MAX_FILE_HANDLE   32768
 
#define PFS_MAX_SOCKET_CLASS   10
 
#define PFS_MAX_STAGE_CLASS   175
 
#define PFS_STATEMENTS_STACK_SIZE   10
 
#define PFS_MAX_MEMORY_CLASS   450
 
#define PFS_MAX_GLOBAL_SERVER_ERRORS    (1 + pfs_session_error_stat_count + pfs_global_error_stat_count)
 
#define PFS_MAX_SESSION_SERVER_ERRORS   (1 + pfs_session_error_stat_count)
 

Functions

void pre_initialize_performance_schema ()
 Null initialization. More...
 
int initialize_performance_schema (PFS_global_param *param, PSI_thread_bootstrap **thread_bootstrap, PSI_mutex_bootstrap **mutex_bootstrap, PSI_rwlock_bootstrap **rwlock_bootstrap, PSI_cond_bootstrap **cond_bootstrap, PSI_file_bootstrap **file_bootstrap, PSI_socket_bootstrap **socket_bootstrap, PSI_table_bootstrap **table_bootstrap, PSI_mdl_bootstrap **mdl_bootstrap, PSI_idle_bootstrap **idle_bootstrap, PSI_stage_bootstrap **stage_bootstrap, PSI_statement_bootstrap **statement_bootstrap, PSI_transaction_bootstrap **transaction_bootstrap, PSI_memory_bootstrap **memory_bootstrap, PSI_error_bootstrap **error_bootstrap, PSI_data_lock_bootstrap **data_lock_bootstrap, PSI_system_bootstrap **system_bootstrap, PSI_tls_channel_bootstrap **tls_channel_bootstrap)
 Initialize the performance schema. More...
 
void pfs_automated_sizing (PFS_global_param *param)
 
void initialize_performance_schema_acl (bool bootstrap)
 Initialize the performance schema ACL. More...
 
void reset_pfs_status_stats ()
 Reset the aggregated status counter stats. More...
 
void init_pfs_instrument_array ()
 Initialize the dynamic array holding individual instrument settings collected from the server configuration options. More...
 
int add_pfs_instr_to_array (const char *name, const char *value)
 Process one PFS_INSTRUMENT configuration string. More...
 
int register_pfs_notification_service ()
 Register/unregister notification service. More...
 
int unregister_pfs_notification_service ()
 Unregister the Notification service. More...
 
int register_pfs_resource_group_service ()
 Register/unregister resource group service. More...
 
int unregister_pfs_resource_group_service ()
 Unregister the Resource Group service. More...
 
void shutdown_performance_schema ()
 Shutdown the performance schema. More...
 

Variables

PFS_global_param pfs_param
 Performance schema sizing values for the server. More...
 

Detailed Description

Private interface for the server (declarations).

Macro Definition Documentation

◆ PFS_AUTOSCALE_VALUE

#define PFS_AUTOSCALE_VALUE   (-1)

◆ PFS_AUTOSIZE_VALUE

#define PFS_AUTOSIZE_VALUE   (-1)

◆ PFS_MAX_COND_CLASS

#define PFS_MAX_COND_CLASS   150

◆ PFS_MAX_FILE_CLASS

#define PFS_MAX_FILE_CLASS   80

◆ PFS_MAX_FILE_HANDLE

#define PFS_MAX_FILE_HANDLE   32768

◆ PFS_MAX_GLOBAL_SERVER_ERRORS

#define PFS_MAX_GLOBAL_SERVER_ERRORS    (1 + pfs_session_error_stat_count + pfs_global_error_stat_count)

◆ PFS_MAX_MEMORY_CLASS

#define PFS_MAX_MEMORY_CLASS   450

◆ PFS_MAX_MUTEX_CLASS

#define PFS_MAX_MUTEX_CLASS   350

◆ PFS_MAX_RWLOCK_CLASS

#define PFS_MAX_RWLOCK_CLASS   60

◆ PFS_MAX_SESSION_SERVER_ERRORS

#define PFS_MAX_SESSION_SERVER_ERRORS   (1 + pfs_session_error_stat_count)

◆ PFS_MAX_SOCKET_CLASS

#define PFS_MAX_SOCKET_CLASS   10

◆ PFS_MAX_STAGE_CLASS

#define PFS_MAX_STAGE_CLASS   175

◆ PFS_MAX_THREAD_CLASS

#define PFS_MAX_THREAD_CLASS   100

◆ PFS_STATEMENTS_STACK_SIZE

#define PFS_STATEMENTS_STACK_SIZE   10

Function Documentation

◆ add_pfs_instr_to_array()

int add_pfs_instr_to_array ( const char *  name,
const char *  value 
)

Process one PFS_INSTRUMENT configuration string.

Process one PFS_INSTRUMENT configuration string.

Isolate the instrument name, evaluate the option value, and store them in a dynamic array. Return 'false' for success, 'true' for error.

Parameters
nameInstrument name
valueConfiguration option: 'on', 'off', etc.
Returns
0 for success, non zero for errors

◆ init_pfs_instrument_array()

void init_pfs_instrument_array ( )

Initialize the dynamic array holding individual instrument settings collected from the server configuration options.

Initialize the dynamic array holding individual instrument settings collected from the server configuration options.

◆ initialize_performance_schema()

int initialize_performance_schema ( PFS_global_param param,
PSI_thread_bootstrap **  thread_bootstrap,
PSI_mutex_bootstrap **  mutex_bootstrap,
PSI_rwlock_bootstrap **  rwlock_bootstrap,
PSI_cond_bootstrap **  cond_bootstrap,
PSI_file_bootstrap **  file_bootstrap,
PSI_socket_bootstrap **  socket_bootstrap,
PSI_table_bootstrap **  table_bootstrap,
PSI_mdl_bootstrap **  mdl_bootstrap,
PSI_idle_bootstrap **  idle_bootstrap,
PSI_stage_bootstrap **  stage_bootstrap,
PSI_statement_bootstrap **  statement_bootstrap,
PSI_transaction_bootstrap **  transaction_bootstrap,
PSI_memory_bootstrap **  memory_bootstrap,
PSI_error_bootstrap **  error_bootstrap,
PSI_data_lock_bootstrap **  data_lock_bootstrap,
PSI_system_bootstrap **  system_bootstrap,
PSI_tls_channel_bootstrap **  tls_channel_bootstrap 
)

Initialize the performance schema.

The performance schema implement several instrumentation services. Each instrumentation service is versioned, and accessible through a bootstrap structure, returned as output parameter.

Parameters
paramSize parameters to use.
[out]thread_bootstrapThread instrumentation service bootstrap
[out]mutex_bootstrapMutex instrumentation service bootstrap
[out]rwlock_bootstrapRwlock instrumentation service bootstrap
[out]cond_bootstrapCondition instrumentation service bootstrap
[out]file_bootstrapFile instrumentation service bootstrap
[out]socket_bootstrapSocket instrumentation service bootstrap
[out]table_bootstrapTable instrumentation service bootstrap
[out]mdl_bootstrapMetadata Lock instrumentation service bootstrap
[out]idle_bootstrapIdle instrumentation service bootstrap
[out]stage_bootstrapStage instrumentation service bootstrap
[out]statement_bootstrapStatement instrumentation service bootstrap
[out]transaction_bootstrapTransaction instrumentation service bootstrap
[out]memory_bootstrapMemory instrumentation service bootstrap
[out]error_bootstrapError instrumentation service bootstrap
[out]data_lock_bootstrapData Lock instrumentation service bootstrap
[out]system_bootstrapSystem instrumentation service bootstrap
[out]tls_channel_bootstrapTLS channel instrumentation service bootstrap
Return values
0success

Default values for SETUP_CONSUMERS

◆ pfs_automated_sizing()

void pfs_automated_sizing ( PFS_global_param param)

◆ pre_initialize_performance_schema()

void pre_initialize_performance_schema ( )

Null initialization.

Disable all instrumentation, size all internal buffers to 0. This pre initialization step is needed to ensure that events can be collected and discarded, until such time initialize_performance_schema() is called.

◆ register_pfs_notification_service()

int register_pfs_notification_service ( )

Register/unregister notification service.

Register/unregister notification service.

Returns
0 if successful, 1 otherwise

◆ register_pfs_resource_group_service()

int register_pfs_resource_group_service ( )

Register/unregister resource group service.

Register/unregister resource group service.

Returns
0 if successful, 1 otherwise

◆ reset_pfs_status_stats()

void reset_pfs_status_stats ( )

Reset the aggregated status counter stats.

Reset the aggregated status counter stats.

NOTE: Assumes LOCK_status is held.

◆ shutdown_performance_schema()

void shutdown_performance_schema ( )

Shutdown the performance schema.

◆ unregister_pfs_notification_service()

int unregister_pfs_notification_service ( )

Unregister the Notification service.

Returns
0 if successful, 1 otherwise

◆ unregister_pfs_resource_group_service()

int unregister_pfs_resource_group_service ( )

Unregister the Resource Group service.

Returns
0 if successful, 1 otherwise

Variable Documentation

◆ pfs_param

PFS_global_param pfs_param
extern

Performance schema sizing values for the server.

This global variable is set when parsing server startup options.