MySQL  8.0.27
Source Code Documentation
psi_socket.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2021, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef MYSQL_PSI_SOCKET_H
24 #define MYSQL_PSI_SOCKET_H
25 
26 /**
27  @file include/mysql/psi/psi_socket.h
28  Performance schema instrumentation interface.
29 
30  @defgroup psi_abi_socket Socket Instrumentation (ABI)
31  @ingroup psi_abi
32  @{
33 */
34 
35 #include "my_macros.h"
36 
37 /* HAVE_PSI_*_INTERFACE */
38 #include "my_psi_config.h" // IWYU pragma: keep
39 
40 #include "my_sharedlib.h"
42 
43 /**
44  @def PSI_SOCKET_VERSION_1
45  Performance Schema Socket Interface number for version 1.
46  This version is supported.
47 */
48 #define PSI_SOCKET_VERSION_1 1
49 
50 /** Entry point for the performance schema interface. */
52  /**
53  ABI interface finder.
54  Calling this method with an interface version number returns either
55  an instance of the ABI for this version, or NULL.
56  @sa PSI_SOCKET_VERSION_1
57  @sa PSI_SOCKET_VERSION_2
58  @sa PSI_CURRENT_SOCKET_VERSION
59  */
60  void *(*get_interface)(int version);
61 };
63 
64 #ifdef HAVE_PSI_SOCKET_INTERFACE
65 
66 /**
67  Performance Schema Socket Interface, version 1.
68  @since PSI_SOCKET_VERSION_1
69 */
71  /** @sa register_socket_v1_t. */
73  /** @sa init_socket_v1_t. */
75  /** @sa destroy_socket_v1_t. */
77  /** @sa start_socket_wait_v1_t. */
79  /** @sa end_socket_wait_v1_t. */
81  /** @sa set_socket_state_v1_t. */
83  /** @sa set_socket_info_v1_t. */
85  /** @sa set_socket_thread_owner_v1_t. */
87 };
88 
90 
92 
93 #endif /* HAVE_PSI_SOCKET_INTERFACE */
94 
95 /** @} (end of group psi_abi_socket) */
96 
97 #endif /* MYSQL_PSI_SOCKET_H */
void(* register_socket_v1_t)(const char *category, struct PSI_socket_info_v1 *info, int count)
Socket registration API.
Definition: psi_socket_bits.h:187
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.
Definition: psi_socket_bits.h:199
MYSQL_PLUGIN_IMPORT PSI_socket_service_t * psi_socket_service
Definition: psi_noop.cc:470
void(* set_socket_state_v1_t)(struct PSI_socket *socket, enum PSI_socket_state state)
Set the socket state for an instrumented socket.
Definition: psi_socket_bits.h:243
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.
Definition: psi_socket_bits.h:253
void(* destroy_socket_v1_t)(struct PSI_socket *socket)
socket instrumentation destruction API.
Definition: psi_socket_bits.h:208
void(* set_socket_thread_owner_v1_t)(struct PSI_socket *socket)
Bind a socket to the thread that owns it.
Definition: psi_socket_bits.h:262
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.
Definition: psi_socket_bits.h:220
void(* end_socket_wait_v1_t)(struct PSI_socket_locker *locker, size_t count)
Record a socket instrumentation end event.
Definition: psi_socket_bits.h:235
Some common macros.
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
Performance schema instrumentation interface.
required uint64 version
Definition: replication_group_member_actions.proto:40
Entry point for the performance schema interface.
Definition: psi_socket.h:51
Performance Schema Socket Interface, version 1.
Definition: psi_socket.h:70
init_socket_v1_t init_socket
Definition: psi_socket.h:74
set_socket_state_v1_t set_socket_state
Definition: psi_socket.h:82
start_socket_wait_v1_t start_socket_wait
Definition: psi_socket.h:78
destroy_socket_v1_t destroy_socket
Definition: psi_socket.h:76
set_socket_thread_owner_v1_t set_socket_thread_owner
Definition: psi_socket.h:86
end_socket_wait_v1_t end_socket_wait
Definition: psi_socket.h:80
register_socket_v1_t register_socket
Definition: psi_socket.h:72
set_socket_info_v1_t set_socket_info
Definition: psi_socket.h:84