MySQL 8.4.2
Source Code Documentation
psi_socket.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MYSQL_PSI_SOCKET_H
25#define MYSQL_PSI_SOCKET_H
26
27/**
28 @file include/mysql/psi/psi_socket.h
29 Performance schema instrumentation interface.
30
31 @defgroup psi_abi_socket Socket Instrumentation (ABI)
32 @ingroup psi_abi
33 @{
34*/
35
36#include "my_macros.h"
37
38/* HAVE_PSI_*_INTERFACE */
39#include "my_psi_config.h" // IWYU pragma: keep
40
41#include "my_sharedlib.h"
43
44/**
45 @def PSI_SOCKET_VERSION_1
46 Performance Schema Socket Interface number for version 1.
47 This version is supported.
48*/
49#define PSI_SOCKET_VERSION_1 1
50
51/** Entry point for the performance schema interface. */
53 /**
54 ABI interface finder.
55 Calling this method with an interface version number returns either
56 an instance of the ABI for this version, or NULL.
57 @sa PSI_SOCKET_VERSION_1
58 @sa PSI_SOCKET_VERSION_2
59 @sa PSI_CURRENT_SOCKET_VERSION
60 */
61 void *(*get_interface)(int version);
62};
64
65#ifdef HAVE_PSI_SOCKET_INTERFACE
66
67/**
68 Performance Schema Socket Interface, version 1.
69 @since PSI_SOCKET_VERSION_1
70*/
72 /** @sa register_socket_v1_t. */
74 /** @sa init_socket_v1_t. */
76 /** @sa destroy_socket_v1_t. */
78 /** @sa start_socket_wait_v1_t. */
80 /** @sa end_socket_wait_v1_t. */
82 /** @sa set_socket_state_v1_t. */
84 /** @sa set_socket_info_v1_t. */
86 /** @sa set_socket_thread_owner_v1_t. */
88};
89
91
93
94#endif /* HAVE_PSI_SOCKET_INTERFACE */
95
96/** @} (end of group psi_abi_socket) */
97
98#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:188
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:221
MYSQL_PLUGIN_IMPORT PSI_socket_service_t * psi_socket_service
Definition: psi_noop.cc:488
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:244
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:200
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:254
void(* destroy_socket_v1_t)(struct PSI_socket *socket)
socket instrumentation destruction API.
Definition: psi_socket_bits.h:209
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:263
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:236
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:71
Performance schema instrumentation interface.
required uint64 version
Definition: replication_group_member_actions.proto:41
Entry point for the performance schema interface.
Definition: psi_socket.h:52
Performance Schema Socket Interface, version 1.
Definition: psi_socket.h:71
init_socket_v1_t init_socket
Definition: psi_socket.h:75
set_socket_state_v1_t set_socket_state
Definition: psi_socket.h:83
start_socket_wait_v1_t start_socket_wait
Definition: psi_socket.h:79
destroy_socket_v1_t destroy_socket
Definition: psi_socket.h:77
set_socket_thread_owner_v1_t set_socket_thread_owner
Definition: psi_socket.h:87
end_socket_wait_v1_t end_socket_wait
Definition: psi_socket.h:81
register_socket_v1_t register_socket
Definition: psi_socket.h:73
set_socket_info_v1_t set_socket_info
Definition: psi_socket.h:85