MySQL  8.0.18
Source Code Documentation

Classes

struct  PSI_socket_info_v1
 Socket instrument information. More...
 
struct  PSI_socket_locker_state_v1
 State data storage for start_socket_wait_v1_t. More...
 
struct  PSI_socket_bootstrap
 Entry point for the performance schema interface. More...
 
struct  PSI_socket_service_v1
 Performance Schema Socket Interface, version 1. More...
 

Macros

#define PSI_SOCKET_VERSION_1   1
 Performance Schema Socket Interface number for version 1. More...
 
#define PSI_CURRENT_SOCKET_VERSION   1
 Performance Schema Socket Interface number for the most recent version. More...
 
#define PSI_SOCKET_VERSION_1   1
 Performance Schema Socket Interface number for version 1. More...
 

Typedefs

typedef unsigned int PSI_socket_key
 Instrumented socket key. More...
 
typedef struct PSI_socket PSI_socket
 
typedef struct PSI_socket_locker PSI_socket_locker
 
typedef enum PSI_socket_state PSI_socket_state
 
typedef enum PSI_socket_operation PSI_socket_operation
 
typedef struct PSI_socket_info_v1 PSI_socket_info_v1
 
typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state_v1
 
typedef void(* register_socket_v1_t) (const char *category, struct PSI_socket_info_v1 *info, int count)
 Socket registration API. More...
 
typedef struct PSI_socket *(* init_socket_v1_t) (PSI_socket_key key, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)
 Socket instrumentation initialisation API. More...
 
typedef void(* destroy_socket_v1_t) (struct PSI_socket *socket)
 socket instrumentation destruction API. More...
 
typedef struct PSI_socket_locker *(* start_socket_wait_v1_t) (struct PSI_socket_locker_state_v1 *state, struct PSI_socket *socket, enum PSI_socket_operation op, size_t count, const char *src_file, unsigned int src_line)
 Record a socket instrumentation start event. More...
 
typedef void(* end_socket_wait_v1_t) (struct PSI_socket_locker *locker, size_t count)
 Record a socket instrumentation end event. More...
 
typedef void(* set_socket_state_v1_t) (struct PSI_socket *socket, enum PSI_socket_state state)
 Set the socket state for an instrumented socket. More...
 
typedef void(* set_socket_info_v1_t) (struct PSI_socket *socket, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)
 Set the socket info for an instrumented socket. More...
 
typedef void(* set_socket_thread_owner_v1_t) (struct PSI_socket *socket)
 Bind a socket to the thread that owns it. More...
 
typedef struct PSI_socket_info_v1 PSI_socket_info
 
typedef struct PSI_socket_locker_state_v1 PSI_socket_locker_state
 
typedef struct PSI_socket_bootstrap PSI_socket_bootstrap
 
typedef struct PSI_socket_service_v1 PSI_socket_service_t
 

Enumerations

enum  PSI_socket_state { PSI_SOCKET_STATE_IDLE = 1, PSI_SOCKET_STATE_ACTIVE = 2 }
 State of an instrumented socket. More...
 
enum  PSI_socket_operation {
  PSI_SOCKET_CREATE = 0, PSI_SOCKET_CONNECT = 1, PSI_SOCKET_BIND = 2, PSI_SOCKET_CLOSE = 3,
  PSI_SOCKET_SEND = 4, PSI_SOCKET_RECV = 5, PSI_SOCKET_SENDTO = 6, PSI_SOCKET_RECVFROM = 7,
  PSI_SOCKET_SENDMSG = 8, PSI_SOCKET_RECVMSG = 9, PSI_SOCKET_SEEK = 10, PSI_SOCKET_OPT = 11,
  PSI_SOCKET_STAT = 12, PSI_SOCKET_SHUTDOWN = 13, PSI_SOCKET_SELECT = 14
}
 Operation performed on an instrumented socket. More...
 

Variables

MYSQL_PLUGIN_IMPORT PSI_socket_service_tpsi_socket_service
 

Detailed Description

Macro Definition Documentation

◆ PSI_CURRENT_SOCKET_VERSION

#define PSI_CURRENT_SOCKET_VERSION   1

Performance Schema Socket Interface number for the most recent version.

The most current version is PSI_SOCKET_VERSION_1

◆ PSI_SOCKET_VERSION_1 [1/2]

#define PSI_SOCKET_VERSION_1   1

Performance Schema Socket Interface number for version 1.

This version is supported.

◆ PSI_SOCKET_VERSION_1 [2/2]

#define PSI_SOCKET_VERSION_1   1

Performance Schema Socket Interface number for version 1.

This version is supported.

Typedef Documentation

◆ destroy_socket_v1_t

typedef void(* destroy_socket_v1_t) (struct PSI_socket *socket)

socket instrumentation destruction API.

Parameters
socketthe socket to destroy

◆ end_socket_wait_v1_t

typedef void(* end_socket_wait_v1_t) (struct PSI_socket_locker *locker, size_t count)

Record a socket instrumentation end event.

Note that for socket close operations, the instrumented socket handle associated with the socket (which was provided to obtain a locker) is invalid after this call.

Parameters
lockera socket locker for the running thread
countthe number of bytes actually used in the operation, or 0 if not applicable, or -1 if the operation failed
See also
get_thread_socket_locker

◆ init_socket_v1_t

typedef struct PSI_socket*(* init_socket_v1_t) (PSI_socket_key key, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)

Socket instrumentation initialisation API.

Parameters
keythe registered socket key
fdsocket file descriptor
addrthe socket ip address
addr_lenlength of socket ip address
Returns
an instrumented socket

◆ PSI_socket

typedef struct PSI_socket PSI_socket

◆ PSI_socket_bootstrap

◆ PSI_socket_info

◆ PSI_socket_info_v1

◆ PSI_socket_key

typedef unsigned int PSI_socket_key

Instrumented socket key.

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

◆ PSI_socket_locker

◆ PSI_socket_locker_state

◆ PSI_socket_locker_state_v1

◆ PSI_socket_operation

◆ PSI_socket_service_t

◆ PSI_socket_state

◆ register_socket_v1_t

typedef void(* register_socket_v1_t) (const char *category, struct PSI_socket_info_v1 *info, int count)

Socket registration API.

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

◆ set_socket_info_v1_t

typedef void(* set_socket_info_v1_t) (struct PSI_socket *socket, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)

Set the socket info for an instrumented socket.

Parameters
socketthe instrumented socket
fdthe socket descriptor
addrthe socket ip address
addr_lenlength of socket ip address

◆ set_socket_state_v1_t

typedef void(* set_socket_state_v1_t) (struct PSI_socket *socket, enum PSI_socket_state state)

Set the socket state for an instrumented socket.

Parameters
socketthe instrumented socket
statesocket state

◆ set_socket_thread_owner_v1_t

typedef void(* set_socket_thread_owner_v1_t) (struct PSI_socket *socket)

Bind a socket to the thread that owns it.

Parameters
socketinstrumented socket

◆ start_socket_wait_v1_t

typedef struct PSI_socket_locker*(* start_socket_wait_v1_t) (struct PSI_socket_locker_state_v1 *state, struct PSI_socket *socket, enum PSI_socket_operation op, size_t count, const char *src_file, unsigned int src_line)

Record a socket instrumentation start event.

Parameters
statedata storage for the locker
socketthe instrumented socket
opsocket operation to be performed
countthe number of bytes requested, or 0 if not applicable
src_filethe source file name
src_linethe source line number
Returns
a socket locker, or NULL

Enumeration Type Documentation

◆ PSI_socket_operation

Operation performed on an instrumented socket.

Enumerator
PSI_SOCKET_CREATE 

Socket creation, as in socket() or socketpair().

PSI_SOCKET_CONNECT 

Socket connection, as in connect(), listen() and accept().

PSI_SOCKET_BIND 

Socket bind, as in bind(), getsockname() and getpeername().

PSI_SOCKET_CLOSE 

Socket close, as in shutdown().

PSI_SOCKET_SEND 

Socket send, send().

PSI_SOCKET_RECV 

Socket receive, recv().

PSI_SOCKET_SENDTO 

Socket send, sendto().

PSI_SOCKET_RECVFROM 

Socket receive, recvfrom).

PSI_SOCKET_SENDMSG 

Socket send, sendmsg().

PSI_SOCKET_RECVMSG 

Socket receive, recvmsg().

PSI_SOCKET_SEEK 

Socket seek, such as fseek() or seek().

PSI_SOCKET_OPT 

Socket options, as in getsockopt() and setsockopt().

PSI_SOCKET_STAT 

Socket status, as in sockatmark() and isfdtype().

PSI_SOCKET_SHUTDOWN 

Socket shutdown, as in shutdown().

PSI_SOCKET_SELECT 

Socket select, as in select() and poll().

◆ PSI_socket_state

State of an instrumented socket.

Enumerator
PSI_SOCKET_STATE_IDLE 

Idle, waiting for the next command.

PSI_SOCKET_STATE_ACTIVE 

Active, executing a command.

Variable Documentation

◆ psi_socket_service