MySQL  8.0.16
Source Code Documentation
psi_socket.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
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 #include "my_psi_config.h" // IWYU pragma: keep
37 #include "my_sharedlib.h"
39 
40 /**
41  @def PSI_SOCKET_VERSION_1
42  Performance Schema Socket Interface number for version 1.
43  This version is supported.
44 */
45 #define PSI_SOCKET_VERSION_1 1
46 
47 /** Entry point for the performance schema interface. */
49  /**
50  ABI interface finder.
51  Calling this method with an interface version number returns either
52  an instance of the ABI for this version, or NULL.
53  @sa PSI_SOCKET_VERSION_1
54  @sa PSI_SOCKET_VERSION_2
55  @sa PSI_CURRENT_SOCKET_VERSION
56  */
57  void *(*get_interface)(int version);
58 };
60 
61 #ifdef HAVE_PSI_SOCKET_INTERFACE
62 
63 /**
64  Performance Schema Socket Interface, version 1.
65  @since PSI_SOCKET_VERSION_1
66 */
68  /** @sa register_socket_v1_t. */
70  /** @sa init_socket_v1_t. */
72  /** @sa destroy_socket_v1_t. */
74  /** @sa start_socket_wait_v1_t. */
76  /** @sa end_socket_wait_v1_t. */
78  /** @sa set_socket_state_v1_t. */
80  /** @sa set_socket_info_v1_t. */
82  /** @sa set_socket_thread_owner_v1_t. */
84 };
85 
87 
89 
90 #endif /* HAVE_PSI_SOCKET_INTERFACE */
91 
92 /** @} (end of group psi_abi_socket) */
93 
94 #endif /* MYSQL_PSI_SOCKET_H */
Some common macros.
Performance schema instrumentation interface.
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:219
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:234
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
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:261
set_socket_state_v1_t set_socket_state
Definition: psi_socket.h:79
Functions related to handling of plugins and other dynamically loaded libraries.
void(* destroy_socket_v1_t)(struct PSI_socket *socket)
socket instrumentation destruction API.
Definition: psi_socket_bits.h:207
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:198
MYSQL_PLUGIN_IMPORT PSI_socket_service_t * psi_socket_service
Definition: psi_noop.cc:454
register_socket_v1_t register_socket
Definition: psi_socket.h:69
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:252
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:242
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Performance Schema Socket Interface, version 1.
Definition: psi_socket.h:67
end_socket_wait_v1_t end_socket_wait
Definition: psi_socket.h:77
set_socket_info_v1_t set_socket_info
Definition: psi_socket.h:81
const string version("\ersion\)
init_socket_v1_t init_socket
Definition: psi_socket.h:71
set_socket_thread_owner_v1_t set_socket_thread_owner
Definition: psi_socket.h:83
start_socket_wait_v1_t start_socket_wait
Definition: psi_socket.h:75
void(* register_socket_v1_t)(const char *category, struct PSI_socket_info_v1 *info, int count)
Socket registration API.
Definition: psi_socket_bits.h:186
destroy_socket_v1_t destroy_socket
Definition: psi_socket.h:73
Entry point for the performance schema interface.
Definition: psi_socket.h:48