MySQL 8.0.39
Source Code Documentation
service_pfs_notification.cc File Reference

The performance schema implementation of the notification service. More...

Classes

struct  PFS_notification_node
 PFS_notification_node Element of the notification registry containing callback functions. More...
 
struct  PFS_notification_registry
 PFS_notification_registry A singly linked list of callback registrations. More...
 

Macros

#define EVENT_THREAD_CREATE   0x0001
 Bitmap identifiers for PSI_notification callbacks. More...
 
#define EVENT_THREAD_DESTROY   0x0002
 
#define EVENT_SESSION_CONNECT   0x0004
 
#define EVENT_SESSION_DISCONNECT   0x0008
 
#define EVENT_SESSION_CHANGE_USER   0x0010
 

Functions

int pfs_get_thread_system_attrs_by_id_vc (PSI_thread *thread, ulonglong thread_id, PSI_thread_attrs *thread_attrs)
 Implementation of the thread instrumentation interface. More...
 
int pfs_register_notification (const PSI_notification *callbacks, bool with_ref_count)
 Register callbacks for the Notification service. More...
 
int pfs_unregister_notification (int handle)
 Unregister callbacks for the Notification service. More...
 
void pfs_notify_thread_create (PSI_thread *thread)
 Invoke callbacks registered for create thread events. More...
 
void pfs_notify_thread_destroy (PSI_thread *thread)
 Invoke callbacks registered for destroy thread events. More...
 
void pfs_notify_session_connect (PSI_thread *thread)
 Invoke callbacks registered for session connect events. More...
 
void pfs_notify_session_disconnect (PSI_thread *thread)
 Invoke callbacks registered for session disconnect events. More...
 
void pfs_notify_session_change_user (PSI_thread *thread)
 Invoke callbacks registered for session change user events. More...
 
int impl_register_notification (const PSI_notification *callbacks, bool with_ref_count)
 Notification Service implementation. More...
 
int impl_unregister_notification (int handle)
 
int register_pfs_notification_service ()
 Register the Notification service with the MySQL server registry. More...
 
int unregister_pfs_notification_service ()
 Unregister the Notification service. More...
 

Variables

static PFS_notification_registry pfs_notification_registry
 Notification service registry. More...
 
const mysql_service_pfs_notification_v3_t SERVICE_IMPLEMENTATION (mysql_server, pfs_notification_v3)
 

Detailed Description

The performance schema implementation of the notification service.

Macro Definition Documentation

◆ EVENT_SESSION_CHANGE_USER

#define EVENT_SESSION_CHANGE_USER   0x0010

◆ EVENT_SESSION_CONNECT

#define EVENT_SESSION_CONNECT   0x0004

◆ EVENT_SESSION_DISCONNECT

#define EVENT_SESSION_DISCONNECT   0x0008

◆ EVENT_THREAD_CREATE

#define EVENT_THREAD_CREATE   0x0001

Bitmap identifiers for PSI_notification callbacks.

See also
PSI_notification

◆ EVENT_THREAD_DESTROY

#define EVENT_THREAD_DESTROY   0x0002

Function Documentation

◆ impl_register_notification()

int impl_register_notification ( const PSI_notification callbacks,
bool  with_ref_count 
)

Notification Service implementation.

◆ impl_unregister_notification()

int impl_unregister_notification ( int  handle)

◆ pfs_get_thread_system_attrs_by_id_vc()

int pfs_get_thread_system_attrs_by_id_vc ( PSI_thread thread,
ulonglong  thread_id,
PSI_thread_attrs thread_attrs 
)

Implementation of the thread instrumentation interface.

See also
PSI_v2::get_thread_system_attrs_by_id.

◆ pfs_notify_session_change_user()

void pfs_notify_session_change_user ( PSI_thread thread)

Invoke callbacks registered for session change user events.

Parameters
threadinstrumented thread
See also
PSI_v1::notify_session_change_user

◆ pfs_notify_session_connect()

void pfs_notify_session_connect ( PSI_thread thread)

Invoke callbacks registered for session connect events.

Parameters
threadinstrumented thread
See also
PSI_v1::notify_session_connect

◆ pfs_notify_session_disconnect()

void pfs_notify_session_disconnect ( PSI_thread thread)

Invoke callbacks registered for session disconnect events.

Parameters
threadinstrumented thread
See also
PSI_v1::notify_session_disconnect

◆ pfs_notify_thread_create()

void pfs_notify_thread_create ( PSI_thread thread)

Invoke callbacks registered for create thread events.

This is an internal function, not part of Notification API.

Parameters
threadinstrumented thread
See also
pfs_notify_thread_create

◆ pfs_notify_thread_destroy()

void pfs_notify_thread_destroy ( PSI_thread thread)

Invoke callbacks registered for destroy thread events.

This is an internal function, not part of Notification API.

Parameters
threadinstrumented thread
See also
pfs_notify_thread_destroy

◆ pfs_register_notification()

int pfs_register_notification ( const PSI_notification callbacks,
bool  with_ref_count 
)

Register callbacks for the Notification service.

Parameters
callbacksblock of callback function pointers
with_ref_counttrue if callbacks can be unregistered
Returns
handle unique handle needed to unregister, 0 on failure
See also
PSI_v1::register_notification

◆ pfs_unregister_notification()

int pfs_unregister_notification ( int  handle)

Unregister callbacks for the Notification service.

Parameters
handleunique handle returned by register_notification()
Returns
0 if successful, non-zero otherwise
See also
PSI_v1::unregister_notification

◆ register_pfs_notification_service()

int register_pfs_notification_service ( )

Register the Notification service with the MySQL server registry.

Register/unregister notification service.

Returns
0 if successful, 1 otherwise

◆ unregister_pfs_notification_service()

int unregister_pfs_notification_service ( )

Unregister the Notification service.

Returns
0 if successful, 1 otherwise

Variable Documentation

◆ pfs_notification_registry

PFS_notification_registry pfs_notification_registry
static

Notification service registry.

◆ SERVICE_IMPLEMENTATION

const mysql_service_pfs_notification_v3_t SERVICE_IMPLEMENTATION(mysql_server, pfs_notification_v3) ( mysql_server  ,
pfs_notification_v3   
)
Initial value:
= {
int impl_register_notification(const PSI_notification *callbacks, bool with_ref_count)
Notification Service implementation.
Definition: service_pfs_notification.cc:467
int impl_unregister_notification(int handle)
Definition: service_pfs_notification.cc:472