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 Foundation, 21 51 Franklin Street, Suite 500, Boston, MA 02110-1335 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 #ifdef HAVE_PSI_SOCKET_INTERFACE 32 #ifdef MYSQL_SERVER 33 #ifndef EMBEDDED_LIBRARY 34 #ifndef MYSQL_DYNAMIC_PLUGIN 35 36 #include "mysql/psi/psi.h" 37 38 #define PSI_SOCKET_CALL(M) pfs_ ## M ## _v1 39 40 C_MODE_START 41 42 void pfs_register_socket_v1(const char *category, 43 PSI_socket_info_v1 *info, 44 int count); 45 46 PSI_socket* 47 pfs_init_socket_v1(PSI_socket_key key, const my_socket *fd, 48 const struct sockaddr *addr, socklen_t addr_len); 49 50 void pfs_destroy_socket_v1(PSI_socket *socket); 51 52 PSI_socket_locker* 53 pfs_start_socket_wait_v1(PSI_socket_locker_state *state, 54 PSI_socket *socket, 55 PSI_socket_operation op, 56 size_t count, 57 const char *src_file, uint src_line); 58 59 void pfs_end_socket_wait_v1(PSI_socket_locker *locker, size_t byte_count); 60 61 void pfs_set_socket_state_v1(PSI_socket *socket, PSI_socket_state state); 62 63 void pfs_set_socket_info_v1(PSI_socket *socket, 64 const my_socket *fd, 65 const struct sockaddr *addr, 66 socklen_t addr_len); 67 68 void pfs_set_socket_thread_owner_v1(PSI_socket *socket); 69 70 C_MODE_END 71 72 #endif /* EMBEDDED_LIBRARY */ 73 #endif /* MYSQL_DYNAMIC_PLUGIN */ 74 #endif /* MYSQL_SERVER */ 75 #endif /* HAVE_PSI_SOCKET_INTERFACE */ 76 77 #endif 78 79