| 1 | /* Copyright (c) 2018, 2026, 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 | #include "my_config.h" |
| 25 | |
| 26 | #include "include/pfs_cond_provider.h" |
| 27 | #include "include/pfs_memory_provider.h" |
| 28 | #include "include/pfs_mutex_provider.h" |
| 29 | #include "include/pfs_rwlock_provider.h" |
| 30 | #include "include/pfs_socket_provider.h" |
| 31 | #include "include/pfs_thread_provider.h" |
| 32 | #include "my_inttypes.h" |
| 33 | #include "mysql/components/services/bits/psi_cond_bits.h" |
| 34 | #include "mysql/components/services/bits/psi_memory_bits.h" |
| 35 | #include "mysql/components/services/bits/psi_mutex_bits.h" |
| 36 | #include "mysql/components/services/bits/psi_rwlock_bits.h" |
| 37 | #include "mysql/components/services/bits/psi_socket_bits.h" |
| 38 | #include "mysql/components/services/bits/psi_stage_bits.h" |
| 39 | #include "mysql/components/services/bits/psi_statement_bits.h" |
| 40 | #include "mysql/components/services/bits/psi_thread_bits.h" |
| 41 | |
| 42 | #ifndef WITH_LOCK_ORDER |
| 43 | |
| 44 | #ifdef HAVE_PSI_COND_INTERFACE |
| 45 | void pfs_broadcast_cond_v1(PSI_cond *) {} |
| 46 | void pfs_destroy_cond_v1(PSI_cond *) {} |
| 47 | void pfs_end_cond_wait_v1(PSI_cond_locker *, int) {} |
| 48 | PSI_cond *pfs_init_cond_v1(PSI_cond_key, const void *) { return nullptr; } |
| 49 | void pfs_register_cond_v1(char const *, PSI_cond_info_v1 *, int) {} |
| 50 | void pfs_signal_cond_v1(PSI_cond *) {} |
| 51 | PSI_cond_locker *pfs_start_cond_wait_v1(PSI_cond_locker_state *, PSI_cond *, |
| 52 | PSI_mutex *, PSI_cond_operation, |
| 53 | const char *, uint) { |
| 54 | return nullptr; |
| 55 | } |
| 56 | #endif // HAVE_PSI_COND_INTERFACE |
| 57 | |
| 58 | #ifdef HAVE_PSI_MEMORY_INTERFACE |
| 59 | void pfs_register_memory_vc(const char *, struct PSI_memory_info_v1 *, int) {} |
| 60 | |
| 61 | PSI_memory_key pfs_memory_alloc_vc(PSI_memory_key, size_t, PSI_thread **) { |
| 62 | return 0; |
| 63 | } |
| 64 | |
| 65 | void pfs_memory_free_vc(PSI_memory_key, size_t, PSI_thread *) {} |
| 66 | #endif /* HAVE_PSI_MEMORY_INTERFACE */ |
| 67 | |
| 68 | #ifdef HAVE_PSI_MUTEX_INTERFACE |
| 69 | void pfs_destroy_mutex_v1(PSI_mutex *) {} |
| 70 | void pfs_end_mutex_wait_v1(PSI_mutex_locker *, int) {} |
| 71 | PSI_mutex *pfs_init_mutex_v1(PSI_mutex_key, const void *) { return nullptr; } |
| 72 | void pfs_register_mutex_v1(char const *, PSI_mutex_info_v1 *, int) {} |
| 73 | PSI_mutex_locker *pfs_start_mutex_wait_v1(PSI_mutex_locker_state_v1 *, |
| 74 | PSI_mutex *, PSI_mutex_operation, |
| 75 | char const *, uint) { |
| 76 | return nullptr; |
| 77 | } |
| 78 | void pfs_unlock_mutex_v1(PSI_mutex *) {} |
| 79 | #endif // HAVE_PSI_MUTEX_INTERFACE |
| 80 | |
| 81 | #ifdef HAVE_PSI_RWLOCK_INTERFACE |
| 82 | void pfs_destroy_rwlock_v2(PSI_rwlock *) {} |
| 83 | void pfs_end_rwlock_rdwait_v2(PSI_rwlock_locker *, int) {} |
| 84 | void pfs_end_rwlock_wrwait_v2(PSI_rwlock_locker *, int) {} |
| 85 | PSI_rwlock *pfs_init_rwlock_v2(PSI_rwlock_key, const void *) { return nullptr; } |
| 86 | void pfs_register_rwlock_v2(char const *, PSI_rwlock_info_v1 *, int) {} |
| 87 | PSI_rwlock_locker *pfs_start_rwlock_rdwait_v2(PSI_rwlock_locker_state_v1 *, |
| 88 | PSI_rwlock *, |
| 89 | PSI_rwlock_operation, |
| 90 | char const *, uint) { |
| 91 | return nullptr; |
| 92 | } |
| 93 | PSI_rwlock_locker *pfs_start_rwlock_wrwait_v2(PSI_rwlock_locker_state_v1 *, |
| 94 | PSI_rwlock *, |
| 95 | PSI_rwlock_operation, |
| 96 | char const *, uint) { |
| 97 | return nullptr; |
| 98 | } |
| 99 | void pfs_unlock_rwlock_v2(PSI_rwlock *, PSI_rwlock_operation) {} |
| 100 | #endif // HAVE_PSI_RWLOCK_INTERFACE |
| 101 | |
| 102 | #ifdef HAVE_PSI_SOCKET_INTERFACE |
| 103 | void pfs_destroy_socket_v1(PSI_socket *) {} |
| 104 | void pfs_end_socket_wait_v1(PSI_socket_locker *, size_t) {} |
| 105 | PSI_socket *pfs_init_socket_v1(PSI_socket_key, const my_socket *, |
| 106 | const struct sockaddr *, socklen_t) { |
| 107 | return nullptr; |
| 108 | } |
| 109 | void pfs_register_socket_v1(char const *, PSI_socket_info_v1 *, int) {} |
| 110 | void pfs_set_socket_info_v1(PSI_socket *, const my_socket *, |
| 111 | const struct sockaddr *, socklen_t) {} |
| 112 | void pfs_set_socket_state_v1(PSI_socket *, PSI_socket_state) {} |
| 113 | void pfs_set_socket_thread_owner_v1(PSI_socket *) {} |
| 114 | PSI_socket_locker *pfs_start_socket_wait_v1(PSI_socket_locker_state_v1 *, |
| 115 | PSI_socket *, PSI_socket_operation, |
| 116 | size_t, char const *, uint) { |
| 117 | return nullptr; |
| 118 | } |
| 119 | #endif // HAVE_PSI_SOCKET_INTERFACE |
| 120 | |
| 121 | #ifdef HAVE_PSI_THREAD_INTERFACE |
| 122 | void pfs_delete_current_thread_vc() {} |
| 123 | PSI_thread *pfs_new_thread_vc(PSI_thread_key, PSI_thread_seqnum, const void *, |
| 124 | ulonglong) { |
| 125 | return nullptr; |
| 126 | } |
| 127 | void pfs_register_thread_vc(char const *, PSI_thread_info *, int) {} |
| 128 | void pfs_set_thread_account_vc(char const *, int, char const *, int) {} |
| 129 | void pfs_set_thread_os_id_vc(PSI_thread *) {} |
| 130 | void pfs_set_thread_vc(PSI_thread *) {} |
| 131 | int pfs_spawn_thread_vc(PSI_thread_key, PSI_thread_seqnum, my_thread_handle *, |
| 132 | const my_thread_attr_t *, void *(*)(void *), void *) { |
| 133 | return 0; |
| 134 | } |
| 135 | int pfs_set_thread_connect_attrs_vc(char const *, unsigned int, void const *) { |
| 136 | return 0; |
| 137 | } |
| 138 | #endif // HAVE_PSI_THREAD_INTERFACE |
| 139 | |
| 140 | #endif /* WITH_LOCK_ORDER */ |