MySQL 8.0.29
Source Code Documentation
pfs_socket_provider.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 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 PFS_SOCKET_PROVIDER_H
24#define PFS_SOCKET_PROVIDER_H
25
26/**
27 @file include/pfs_socket_provider.h
28 Performance schema instrumentation (declarations).
29*/
30
31#include "my_config.h"
32
33/* HAVE_PSI_*_INTERFACE */
34#include "my_psi_config.h" // IWYU pragma: keep
35
36#ifdef HAVE_PSI_SOCKET_INTERFACE
37#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
38#ifndef MYSQL_DYNAMIC_PLUGIN
39#ifndef WITH_LOCK_ORDER
40
41#include <stddef.h>
42#ifdef HAVE_SYS_SOCKET_H
43#include <sys/socket.h>
44#endif
45#include <sys/types.h>
46
47#include "my_io.h"
48#include "my_macros.h"
50
51#define PSI_SOCKET_CALL(M) pfs_##M##_v1
52
54 int count);
55
57 const struct sockaddr *addr, socklen_t addr_len);
58
60
64 size_t count, const char *src_file,
65 uint src_line);
66
67void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count);
68
70
72 const struct sockaddr *addr, socklen_t addr_len);
73
75
76#endif /* WITH_LOCK_ORDER */
77#endif /* MYSQL_DYNAMIC_PLUGIN */
78#endif /* MYSQL_SERVER || PFS_DIRECT_CALL */
79#endif /* HAVE_PSI_SOCKET_INTERFACE */
80
81#endif
PSI_socket_operation
Operation performed on an instrumented socket.
Definition: psi_socket_bits.h:88
struct PSI_socket_locker PSI_socket_locker
Definition: psi_socket_bits.h:76
PSI_socket_state
State of an instrumented socket.
Definition: psi_socket_bits.h:79
unsigned int PSI_socket_key
Instrumented socket key.
Definition: psi_socket_bits.h:48
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:42
int my_socket
Definition: mysql.h:64
Log info(cout, "NOTE")
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:56
static const char * category
Definition: sha2_password.cc:168
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:7317
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:2813
void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count)
Implementation of the socket instrumentation interface.
Definition: pfs.cc:7223
void pfs_register_socket_v1(const char *category, PSI_socket_info_v1 *info, int count)
Definition: pfs.cc:2528
void pfs_set_socket_thread_owner_v1(PSI_socket *socket)
Implementation of the socket instrumentation interface.
Definition: pfs.cc:7339
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:4488
void pfs_set_socket_state_v1(PSI_socket *socket, PSI_socket_state state)
Definition: pfs.cc:7304
void pfs_destroy_socket_v1(PSI_socket *socket)
Definition: pfs.cc:2831
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
struct sockaddr sockaddr
Definition: sock_probe_win32.h:62
Socket instrument information.
Definition: psi_socket_bits.h:127
State data storage for start_socket_wait_v1_t.
Definition: psi_socket_bits.h:157
Interface for an instrumented socket descriptor.
Definition: psi_socket_bits.h:68
unsigned int uint
Definition: uca-dump.cc:29