MySQL 9.0.0
Source Code Documentation
pfs_socket_provider.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 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 PFS_SOCKET_PROVIDER_H
25#define PFS_SOCKET_PROVIDER_H
26
27/**
28 @file include/pfs_socket_provider.h
29 Performance schema instrumentation (declarations).
30*/
31
32#include "my_config.h"
33
34/* HAVE_PSI_*_INTERFACE */
35#include "my_psi_config.h" // IWYU pragma: keep
36
37#ifdef HAVE_PSI_SOCKET_INTERFACE
38#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
39#ifndef MYSQL_DYNAMIC_PLUGIN
40#ifndef WITH_LOCK_ORDER
41
42#include <stddef.h>
43#ifdef HAVE_SYS_SOCKET_H
44#include <sys/socket.h>
45#endif
46#include <sys/types.h>
47
48#include "my_io.h"
49#include "my_macros.h"
51
52#define PSI_SOCKET_CALL(M) pfs_##M##_v1
53
55 int count);
56
58 const struct sockaddr *addr, socklen_t addr_len);
59
61
65 size_t count, const char *src_file,
66 uint src_line);
67
68void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count);
69
71
73 const struct sockaddr *addr, socklen_t addr_len);
74
76
77#endif /* WITH_LOCK_ORDER */
78#endif /* MYSQL_DYNAMIC_PLUGIN */
79#endif /* MYSQL_SERVER || PFS_DIRECT_CALL */
80#endif /* HAVE_PSI_SOCKET_INTERFACE */
81
82#endif
PSI_socket_operation
Operation performed on an instrumented socket.
Definition: psi_socket_bits.h:89
struct PSI_socket_locker PSI_socket_locker
Definition: psi_socket_bits.h:77
PSI_socket_state
State of an instrumented socket.
Definition: psi_socket_bits.h:80
unsigned int PSI_socket_key
Instrumented socket key.
Definition: psi_socket_bits.h:49
Common #defines and includes for file and socket I/O.
Some common macros.
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
static int count
Definition: myisam_ftdump.cc:45
int my_socket
Definition: mysql.h:65
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:63
static const char * category
Definition: sha2_password.cc:170
void pfs_set_socket_info_v1(PSI_socket *socket, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)
Set socket descriptor and address info.
Definition: pfs.cc:8041
PSI_socket * pfs_init_socket_v1(PSI_socket_key key, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)
Definition: pfs.cc:2929
void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count)
Implementation of the socket instrumentation interface.
Definition: pfs.cc:7950
void pfs_register_socket_v1(const char *category, PSI_socket_info_v1 *info, int count)
Definition: pfs.cc:2644
void pfs_set_socket_thread_owner_v1(PSI_socket *socket)
Implementation of the socket instrumentation interface.
Definition: pfs.cc:8064
PSI_socket_locker * pfs_start_socket_wait_v1(PSI_socket_locker_state *state, PSI_socket *socket, PSI_socket_operation op, size_t count, const char *src_file, uint src_line)
Socket locker.
Definition: pfs.cc:4688
void pfs_set_socket_state_v1(PSI_socket *socket, PSI_socket_state state)
Definition: pfs.cc:8028
void pfs_destroy_socket_v1(PSI_socket *socket)
Definition: pfs.cc:2947
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
struct sockaddr sockaddr
Definition: sock_probe_win32.h:63
Socket instrument information.
Definition: psi_socket_bits.h:128
State data storage for start_socket_wait_v1_t.
Definition: psi_socket_bits.h:158
Interface for an instrumented socket descriptor.
Definition: psi_socket_bits.h:69