Socket Instrumentation
The MYSQL_SOCKET structure and the mysql_socket_* wrappers for creating, connecting, sending, receiving, and closing sockets with Performance Schema instrumentation.
Classes
An instrumented socket.
Macros
Socket registration.
MYSQL_SOCKET initial value.
Instrumentation helper for socket waits. This instrumentation declares local variables. Do not use a ';' after this macro See also: MYSQL_START_SOCKET_WAIT.
Instrumentation helper for socket waits. This instrumentation marks the start of a wait event. See also: MYSQL_END_SOCKET_WAIT.
Instrumentation helper for socket waits. This instrumentation marks the end of a wait event. See also: MYSQL_START_SOCKET_WAIT.
Set the state (IDLE, ACTIVE) of an instrumented socket. See also: PSI_socket_state
Create a socket. mysql_socket_fd is a replacement for socket.
Create a socket. mysql_socket_socket is a replacement for socket.
Bind a socket to a local port number and IP address mysql_socket_bind is a replacement for bind.
Return port number and IP address of the local host mysql_socket_getsockname is a replacement for getsockname.
Establish a connection to a remote host. mysql_socket_connect is a replacement for connect.
Get port number and IP address of remote host that a socket is connected to. mysql_socket_getpeername is a replacement for getpeername.
Send data from the buffer, B, to a connected socket. mysql_socket_send is a replacement for send.
Receive data from a connected socket. mysql_socket_recv is a replacement for recv.
Send data to a socket at the specified address. mysql_socket_sendto is a replacement for sendto.
Receive data from a socket and return source address information mysql_socket_recvfrom is a replacement for recvfrom.
Get a socket option for the specified socket. mysql_socket_getsockopt is a replacement for getsockopt.
Set a socket option for the specified socket. mysql_socket_setsockopt is a replacement for setsockopt.
Set socket to non-blocking.
Set socket state to listen for an incoming connection. mysql_socket_listen is a replacement for listen.
Accept a connection from any remote host; TCP only. mysql_socket_accept is a replacement for accept.
Close a socket and sever any connections. mysql_socket_close is a replacement for close.
Disable receives and/or sends on a socket. mysql_socket_shutdown is a replacement for shutdown.
mysql_socket_register
Defined in psi/mysql_socket.h:65
Socket registration.
MYSQL_INVALID_SOCKET
Defined in psi/mysql_socket.h:107
MYSQL_SOCKET initial value.
MYSQL_SOCKET_WAIT_VARIABLES
Defined in psi/mysql_socket.h:202
Instrumentation helper for socket waits. This instrumentation declares local variables. Do not use a ';' after this macro See also: MYSQL_START_SOCKET_WAIT.
See also: MYSQL_END_SOCKET_WAIT.
Parameters
LOCKER
locker
STATE
locker state
LOCKER
locker
STATE
locker state
MYSQL_START_SOCKET_WAIT
Defined in psi/mysql_socket.h:221
Instrumentation helper for socket waits. This instrumentation marks the start of a wait event. See also: MYSQL_END_SOCKET_WAIT.
Parameters
LOCKER
locker
STATE
locker state
SOCKET
instrumented socket
OP
The socket operation to be performed
COUNT
bytes to be written/read
LOCKER
locker
STATE
locker state
SOCKET
instrumented socket
OP
The socket operation to be performed
COUNT
bytes to be written/read
MYSQL_END_SOCKET_WAIT
Defined in psi/mysql_socket.h:238
Instrumentation helper for socket waits. This instrumentation marks the end of a wait event. See also: MYSQL_START_SOCKET_WAIT.
Parameters
LOCKER
locker
COUNT
actual bytes written/read, or -1
LOCKER
locker
COUNT
actual bytes written/read, or -1
MYSQL_SOCKET_SET_STATE
Defined in psi/mysql_socket.h:253
Set the state (IDLE, ACTIVE) of an instrumented socket. See also: PSI_socket_state
Parameters
SOCKET
the instrumented socket
STATE
the new state
SOCKET
the instrumented socket
STATE
the new state
mysql_socket_fd
Defined in psi/mysql_socket.h:317
Create a socket. mysql_socket_fd is a replacement for socket.
Parameters
K
PSI_socket_key for this instrumented socket
F
File descriptor
K
PSI_socket_key for this instrumented socket
F
File descriptor
mysql_socket_socket
Defined in psi/mysql_socket.h:335
Create a socket. mysql_socket_socket is a replacement for socket.
Parameters
K
PSI_socket_key for this instrumented socket
D
Socket domain
T
Protocol type
P
Transport protocol
K
PSI_socket_key for this instrumented socket
D
Socket domain
T
Protocol type
P
Transport protocol
mysql_socket_bind
Defined in psi/mysql_socket.h:351
Bind a socket to a local port number and IP address mysql_socket_bind is a replacement for bind.
Parameters
FD
Instrumented socket descriptor returned by socket()
AP
Pointer to local port number and IP address in sockaddr structure
L
Length of sockaddr structure
FD
Instrumented socket descriptor returned by socket()
AP
Pointer to local port number and IP address in sockaddr structure
L
Length of sockaddr structure
mysql_socket_getsockname
Defined in psi/mysql_socket.h:367
Return port number and IP address of the local host mysql_socket_getsockname is a replacement for getsockname.
Parameters
FD
Instrumented socket descriptor returned by socket()
AP
Pointer to returned address of local host in sockaddr structure
LP
Pointer to length of sockaddr structure
FD
Instrumented socket descriptor returned by socket()
AP
Pointer to returned address of local host in sockaddr structure
LP
Pointer to length of sockaddr structure
mysql_socket_connect
Defined in psi/mysql_socket.h:383
Establish a connection to a remote host. mysql_socket_connect is a replacement for connect.
Parameters
FD
Instrumented socket descriptor returned by socket()
AP
Pointer to target address in sockaddr structure
L
Length of sockaddr structure
FD
Instrumented socket descriptor returned by socket()
AP
Pointer to target address in sockaddr structure
L
Length of sockaddr structure
mysql_socket_getpeername
Defined in psi/mysql_socket.h:399
Get port number and IP address of remote host that a socket is connected to. mysql_socket_getpeername is a replacement for getpeername.
Parameters
FD
Instrumented socket descriptor returned by socket() or accept()
AP
Pointer to returned address of remote host in sockaddr structure
LP
Pointer to length of sockaddr structure
FD
Instrumented socket descriptor returned by socket() or accept()
AP
Pointer to returned address of remote host in sockaddr structure
LP
Pointer to length of sockaddr structure
mysql_socket_send
Defined in psi/mysql_socket.h:416
Send data from the buffer, B, to a connected socket. mysql_socket_send is a replacement for send.
Parameters
FD
Instrumented socket descriptor returned by socket() or accept()
B
Buffer to send
N
Number of bytes to send
FL
Control flags
FD
Instrumented socket descriptor returned by socket() or accept()
B
Buffer to send
N
Number of bytes to send
FL
Control flags
mysql_socket_recv
Defined in psi/mysql_socket.h:433
Receive data from a connected socket. mysql_socket_recv is a replacement for recv.
Parameters
FD
Instrumented socket descriptor returned by socket() or accept()
B
Buffer to receive to
N
Maximum bytes to receive
FL
Control flags
FD
Instrumented socket descriptor returned by socket() or accept()
B
Buffer to receive to
N
Maximum bytes to receive
FL
Control flags
mysql_socket_sendto
Defined in psi/mysql_socket.h:452
Send data to a socket at the specified address. mysql_socket_sendto is a replacement for sendto.
Parameters
FD
Instrumented socket descriptor returned by socket()
B
Buffer to send
N
Number of bytes to send
FL
Control flags
AP
Pointer to destination sockaddr structure
L
Size of sockaddr structure
FD
Instrumented socket descriptor returned by socket()
B
Buffer to send
N
Number of bytes to send
FL
Control flags
AP
Pointer to destination sockaddr structure
L
Size of sockaddr structure
mysql_socket_recvfrom
Defined in psi/mysql_socket.h:471
Receive data from a socket and return source address information mysql_socket_recvfrom is a replacement for recvfrom.
Parameters
FD
Instrumented socket descriptor returned by socket()
B
Buffer to receive to
N
Maximum bytes to receive
FL
Control flags
AP
Pointer to source address in sockaddr_storage structure
LP
Size of sockaddr_storage structure
FD
Instrumented socket descriptor returned by socket()
B
Buffer to receive to
N
Maximum bytes to receive
FL
Control flags
AP
Pointer to source address in sockaddr_storage structure
LP
Size of sockaddr_storage structure
mysql_socket_getsockopt
Defined in psi/mysql_socket.h:489
Get a socket option for the specified socket. mysql_socket_getsockopt is a replacement for getsockopt.
Parameters
FD
Instrumented socket descriptor returned by socket()
LV
Protocol level
ON
Option to query
OP
Buffer which will contain the value for the requested option
OL
Pointer to length of OP
FD
Instrumented socket descriptor returned by socket()
LV
Protocol level
ON
Option to query
OP
Buffer which will contain the value for the requested option
OL
Pointer to length of OP
mysql_socket_setsockopt
Defined in psi/mysql_socket.h:507
Set a socket option for the specified socket. mysql_socket_setsockopt is a replacement for setsockopt.
Parameters
FD
Instrumented socket descriptor returned by socket()
LV
Protocol level
ON
Option to modify
OP
Buffer containing the value for the specified option
OL
Pointer to length of OP
FD
Instrumented socket descriptor returned by socket()
LV
Protocol level
ON
Option to modify
OP
Buffer containing the value for the specified option
OL
Pointer to length of OP
mysql_sock_set_nonblocking
Defined in psi/mysql_socket.h:520
Set socket to non-blocking.
Parameters
FD
instrumented socket descriptor
FD
instrumented socket descriptor
mysql_socket_listen
Defined in psi/mysql_socket.h:535
Set socket state to listen for an incoming connection. mysql_socket_listen is a replacement for listen.
Parameters
FD
Instrumented socket descriptor, bound and connected
N
Maximum number of pending connections allowed.
FD
Instrumented socket descriptor, bound and connected
N
Maximum number of pending connections allowed.
mysql_socket_accept
Defined in psi/mysql_socket.h:552
Accept a connection from any remote host; TCP only. mysql_socket_accept is a replacement for accept.
Parameters
K
PSI_socket_key for this instrumented socket
FD
Instrumented socket descriptor, bound and placed in a listen state
AP
Pointer to sockaddr structure with returned IP address and port of connected host
LP
Pointer to length of valid information in AP
K
PSI_socket_key for this instrumented socket
FD
Instrumented socket descriptor, bound and placed in a listen state
AP
Pointer to sockaddr structure with returned IP address and port of connected host
LP
Pointer to length of valid information in AP
mysql_socket_close
Defined in psi/mysql_socket.h:566
Close a socket and sever any connections. mysql_socket_close is a replacement for close.
Parameters
FD
Instrumented socket descriptor returned by socket() or accept()
FD
Instrumented socket descriptor returned by socket() or accept()
mysql_socket_shutdown
Defined in psi/mysql_socket.h:581
Disable receives and/or sends on a socket. mysql_socket_shutdown is a replacement for shutdown.
Parameters
FD
Instrumented socket descriptor returned by socket() or accept()
H
Specifies which operations to shutdown
FD
Instrumented socket descriptor returned by socket() or accept()
H
Specifies which operations to shutdown
Typedefs
struct st_mysql_socket
An instrumented socket. MYSQL_SOCKET is a replacement for my_socket.
MYSQL_SOCKET
Type: struct st_mysql_socket
Defined in psi/mysql_socket.h:99
An instrumented socket. MYSQL_SOCKET is a replacement for my_socket.
Functions
mysql_socket_invalid static inline
MYSQL_SOCKET helper. Initialize instrumented socket. See also: mysql_socket_getfd
my_socket
mysql_socket_getfd static inline
MYSQL_SOCKET helper. Get socket descriptor. See also: mysql_socket_getfd
void
mysql_socket_setfd static inline
MYSQL_SOCKET helper. Set socket descriptor. See also: mysql_socket_setfd
struct PSI_socket_locker *
inline_mysql_start_socket_wait static inline
Instrumentation calls for MYSQL_START_SOCKET_WAIT. See also: MYSQL_START_SOCKET_WAIT.
void
inline_mysql_end_socket_wait static inline
Instrumentation calls for MYSQL_END_SOCKET_WAIT. See also: MYSQL_END_SOCKET_WAIT.
void
inline_mysql_socket_set_state static inline
Set the state (IDLE, ACTIVE) of an instrumented socket. See also: PSI_socket_state
mysql_socket_invalid
static inline
Defined in psi/mysql_socket.h:115
MYSQL_SOCKET helper. Initialize instrumented socket. See also: mysql_socket_getfd
See also: mysql_socket_setfd
mysql_socket_set_address
static inline
Defined in psi/mysql_socket.h:130
Set socket descriptor and address.
Parameters
addr
const struct sockaddr *
unformatted socket address
addr_len
socklen_t
length of socket address
addr
const struct sockaddr *
unformatted socket address
addr_len
socklen_t
length of socket address
mysql_socket_set_thread_owner
static inline
Defined in psi/mysql_socket.h:153
Set socket descriptor and address.
Parameters
mysql_socket_getfd
static inline
Defined in psi/mysql_socket.h:173
MYSQL_SOCKET helper. Get socket descriptor. See also: mysql_socket_getfd
Parameters
mysql_socket_setfd
static inline
Defined in psi/mysql_socket.h:185
MYSQL_SOCKET helper. Set socket descriptor. See also: mysql_socket_setfd
Parameters
fd
my_socket
Socket descriptor
fd
my_socket
Socket descriptor
inline_mysql_start_socket_wait
static inline
Defined in psi/mysql_socket.h:266
Instrumentation calls for MYSQL_START_SOCKET_WAIT. See also: MYSQL_START_SOCKET_WAIT.
inline_mysql_end_socket_wait
static inline
Defined in psi/mysql_socket.h:288
Instrumentation calls for MYSQL_END_SOCKET_WAIT. See also: MYSQL_END_SOCKET_WAIT.
inline_mysql_socket_set_state
static inline
Defined in psi/mysql_socket.h:301
Set the state (IDLE, ACTIVE) of an instrumented socket. See also: PSI_socket_state
Parameters
state
enum PSI_socket_state
the new state
state
enum PSI_socket_state
the new state
inline_mysql_socket_register
static inline
Defined in psi/mysql_socket.h:589
inline_mysql_socket_fd
static inline
Defined in psi/mysql_socket.h:601
mysql_socket_fd
inline_mysql_socket_socket
static inline
Defined in psi/mysql_socket.h:634
mysql_socket_socket
inline_mysql_socket_bind
static inline
Defined in psi/mysql_socket.h:663
mysql_socket_bind
inline_mysql_socket_getsockname
static inline
Defined in psi/mysql_socket.h:703
mysql_socket_getsockname
inline_mysql_socket_connect
static inline
Defined in psi/mysql_socket.h:741
mysql_socket_connect
inline_mysql_socket_getpeername
static inline
Defined in psi/mysql_socket.h:779
mysql_socket_getpeername
inline_mysql_socket_send
static inline
Defined in psi/mysql_socket.h:817
mysql_socket_send
inline_mysql_socket_recv
static inline
Defined in psi/mysql_socket.h:858
mysql_socket_recv
inline_mysql_socket_sendto
static inline
Defined in psi/mysql_socket.h:899
mysql_socket_sendto
inline_mysql_socket_recvfrom
static inline
Defined in psi/mysql_socket.h:940
mysql_socket_recvfrom
inline_mysql_socket_getsockopt
static inline
Defined in psi/mysql_socket.h:982
mysql_socket_getsockopt
inline_mysql_socket_setsockopt
static inline
Defined in psi/mysql_socket.h:1020
mysql_socket_setsockopt
set_socket_nonblock
static inline
Defined in psi/mysql_socket.h:1058
set_socket_nonblock
inline_mysql_sock_set_nonblocking
static inline
Defined in psi/mysql_socket.h:1091
mysql_socket_set_nonblocking
inline_mysql_socket_listen
static inline
Defined in psi/mysql_socket.h:1131
mysql_socket_listen
inline_mysql_socket_accept
static inline
Defined in psi/mysql_socket.h:1169
mysql_socket_accept
inline_mysql_socket_close
static inline
Defined in psi/mysql_socket.h:1250
mysql_socket_close
inline_mysql_socket_shutdown
static inline
Defined in psi/mysql_socket.h:1291
mysql_socket_shutdown
Class Definitions
st_mysql_socket
Defined in psi/mysql_socket.h:73
An instrumented socket.
Public Attributes
struct PSI_socket *
The instrumentation hook. Note that this hook is not conditionally defined, for binary compatibility of the MYSQL_SOCKET interface.
fd
Defined in psi/mysql_socket.h:76
The real socket descriptor.
is_unix_domain_socket
Defined in psi/mysql_socket.h:79
Is this a Unix-domain socket?
is_extra_port
Defined in psi/mysql_socket.h:82
Is this a socket opened for the extra port?
address_family
Defined in psi/mysql_socket.h:85
Address family of the socket. (See sa_family from struct sockaddr).
m_psi
Type: struct PSI_socket *
Defined in psi/mysql_socket.h:92
The instrumentation hook. Note that this hook is not conditionally defined, for binary compatibility of the MYSQL_SOCKET interface.
Last updated
Was this helpful?

