21 #define HAVE_PSI_INTERFACE
23 #include "my_global.h"
24 #include "my_pthread.h"
30 #define NNN __attribute__((unused))
32 static void register_mutex_noop(
const char *category NNN,
33 PSI_mutex_info *info NNN,
39 static void register_rwlock_noop(
const char *category NNN,
40 PSI_rwlock_info *info NNN,
46 static void register_cond_noop(
const char *category NNN,
47 PSI_cond_info *info NNN,
53 static void register_thread_noop(
const char *category NNN,
54 PSI_thread_info *info NNN,
60 static void register_file_noop(
const char *category NNN,
61 PSI_file_info *info NNN,
67 static void register_stage_noop(
const char *category NNN,
74 static void register_statement_noop(
const char *category NNN,
75 PSI_statement_info *info NNN,
81 static void register_socket_noop(
const char *category NNN,
82 PSI_socket_info *info NNN,
89 init_mutex_noop(PSI_mutex_key key NNN,
const void *identity NNN)
94 static void destroy_mutex_noop(PSI_mutex* mutex NNN)
100 init_rwlock_noop(PSI_rwlock_key key NNN,
const void *identity NNN)
105 static void destroy_rwlock_noop(PSI_rwlock* rwlock NNN)
111 init_cond_noop(PSI_cond_key key NNN,
const void *identity NNN)
116 static void destroy_cond_noop(PSI_cond* cond NNN)
122 init_socket_noop(PSI_socket_key key NNN,
const my_socket *fd NNN,
123 const struct sockaddr *addr NNN, socklen_t addr_len NNN)
128 static void destroy_socket_noop(PSI_socket* socket NNN)
133 static PSI_table_share*
134 get_table_share_noop(my_bool temporary NNN,
struct TABLE_SHARE *share NNN)
139 static void release_table_share_noop(PSI_table_share* share NNN)
145 drop_table_share_noop(my_bool temporary NNN,
const char *schema_name NNN,
146 int schema_name_length NNN,
const char *
table_name NNN,
147 int table_name_length NNN)
153 open_table_noop(PSI_table_share *share NNN,
const void *identity NNN)
158 static void unbind_table_noop(PSI_table *
table NNN)
164 rebind_table_noop(PSI_table_share *share NNN,
165 const void *identity NNN,
166 PSI_table *
table NNN)
171 static void close_table_noop(PSI_table *
table NNN)
176 static void create_file_noop(PSI_file_key key NNN,
177 const char *
name NNN, File
file NNN)
182 static int spawn_thread_noop(PSI_thread_key key NNN,
183 pthread_t *thread NNN,
184 const pthread_attr_t *attr NNN,
185 void *(*start_routine)(
void*) NNN,
void *arg NNN)
187 return pthread_create(thread, attr, start_routine, arg);
191 new_thread_noop(PSI_thread_key key NNN,
192 const void *identity NNN, ulonglong thread_id NNN)
197 static void set_thread_id_noop(PSI_thread *thread NNN, ulonglong
id NNN)
203 get_thread_noop(
void NNN)
208 static void set_thread_user_noop(
const char *user NNN,
int user_len NNN)
213 static void set_thread_user_host_noop(
const char *user NNN,
int user_len NNN,
214 const char *host NNN,
int host_len NNN)
219 static void set_thread_db_noop(
const char* db NNN,
int db_len NNN)
224 static void set_thread_command_noop(
int command NNN)
229 static void set_thread_start_time_noop(time_t start_time NNN)
234 static void set_thread_state_noop(
const char* state NNN)
239 static void set_thread_info_noop(
const char* info NNN, uint info_len NNN)
244 static void set_thread_noop(PSI_thread* thread NNN)
249 static void delete_current_thread_noop(
void)
254 static void delete_thread_noop(PSI_thread *thread NNN)
259 static PSI_file_locker*
260 get_thread_file_name_locker_noop(PSI_file_locker_state *state NNN,
261 PSI_file_key key NNN,
262 enum PSI_file_operation op NNN,
263 const char *
name NNN,
const void *identity NNN)
268 static PSI_file_locker*
269 get_thread_file_stream_locker_noop(PSI_file_locker_state *state NNN,
271 enum PSI_file_operation op NNN)
277 static PSI_file_locker*
278 get_thread_file_descriptor_locker_noop(PSI_file_locker_state *state NNN,
280 enum PSI_file_operation op NNN)
285 static void unlock_mutex_noop(PSI_mutex *mutex NNN)
290 static void unlock_rwlock_noop(PSI_rwlock *rwlock NNN)
295 static void signal_cond_noop(PSI_cond* cond NNN)
300 static void broadcast_cond_noop(PSI_cond* cond NNN)
305 static PSI_idle_locker*
306 start_idle_wait_noop(PSI_idle_locker_state* state NNN,
307 const char *src_file NNN, uint src_line NNN)
312 static void end_idle_wait_noop(PSI_idle_locker* locker NNN)
317 static PSI_mutex_locker*
318 start_mutex_wait_noop(PSI_mutex_locker_state *state NNN,
319 PSI_mutex *mutex NNN,
320 PSI_mutex_operation op NNN,
321 const char *src_file NNN, uint src_line NNN)
326 static void end_mutex_wait_noop(PSI_mutex_locker* locker NNN,
int rc NNN)
332 static PSI_rwlock_locker*
333 start_rwlock_rdwait_noop(
struct PSI_rwlock_locker_state_v1 *state NNN,
334 struct PSI_rwlock *rwlock NNN,
335 enum PSI_rwlock_operation op NNN,
336 const char *src_file NNN, uint src_line NNN)
341 static void end_rwlock_rdwait_noop(PSI_rwlock_locker* locker NNN,
int rc NNN)
346 static struct PSI_rwlock_locker*
347 start_rwlock_wrwait_noop(
struct PSI_rwlock_locker_state_v1 *state NNN,
348 struct PSI_rwlock *rwlock NNN,
349 enum PSI_rwlock_operation op NNN,
350 const char *src_file NNN, uint src_line NNN)
355 static void end_rwlock_wrwait_noop(PSI_rwlock_locker* locker NNN,
int rc NNN)
360 static struct PSI_cond_locker*
361 start_cond_wait_noop(
struct PSI_cond_locker_state_v1 *state NNN,
362 struct PSI_cond *cond NNN,
363 struct PSI_mutex *mutex NNN,
364 enum PSI_cond_operation op NNN,
365 const char *src_file NNN, uint src_line NNN)
370 static void end_cond_wait_noop(PSI_cond_locker* locker NNN,
int rc NNN)
375 static struct PSI_table_locker*
376 start_table_io_wait_noop(
struct PSI_table_locker_state_v1 *state NNN,
377 struct PSI_table *
table NNN,
378 enum PSI_table_io_operation op NNN,
380 const char *src_file NNN, uint src_line NNN)
385 static void end_table_io_wait_noop(PSI_table_locker* locker NNN)
390 static struct PSI_table_locker*
391 start_table_lock_wait_noop(
struct PSI_table_locker_state_v1 *state NNN,
392 struct PSI_table *
table NNN,
393 enum PSI_table_lock_operation op NNN,
395 const char *src_file NNN, uint src_line NNN)
400 static void end_table_lock_wait_noop(PSI_table_locker* locker NNN)
405 static void start_file_open_wait_noop(PSI_file_locker *locker NNN,
406 const char *src_file NNN,
412 static PSI_file* end_file_open_wait_noop(PSI_file_locker *locker NNN,
418 static void end_file_open_wait_and_bind_to_descriptor_noop
419 (PSI_file_locker *locker NNN, File
file NNN)
424 static void start_file_wait_noop(PSI_file_locker *locker NNN,
426 const char *src_file NNN,
432 static void end_file_wait_noop(PSI_file_locker *locker NNN,
438 static void start_file_close_wait_noop(PSI_file_locker *locker NNN,
439 const char *src_file NNN,
445 static void end_file_close_wait_noop(PSI_file_locker *locker NNN,
451 static void start_stage_noop(PSI_stage_key key NNN,
452 const char *src_file NNN,
int src_line NNN)
457 static void end_stage_noop(
void)
462 static PSI_statement_locker*
463 get_thread_statement_locker_noop(PSI_statement_locker_state *state NNN,
464 PSI_statement_key key NNN,
465 const void *charset NNN)
470 static PSI_statement_locker*
471 refine_statement_noop(PSI_statement_locker *locker NNN,
472 PSI_statement_key key NNN)
477 static void start_statement_noop(PSI_statement_locker *locker NNN,
478 const char *db NNN, uint db_len NNN,
479 const char *src_file NNN, uint src_line NNN)
484 static void set_statement_text_noop(PSI_statement_locker *locker NNN,
485 const char *text NNN, uint text_len NNN)
490 static void set_statement_lock_time_noop(PSI_statement_locker *locker NNN,
496 static void set_statement_rows_sent_noop(PSI_statement_locker *locker NNN,
502 static void set_statement_rows_examined_noop(PSI_statement_locker *locker NNN,
508 static void inc_statement_created_tmp_disk_tables_noop(PSI_statement_locker *locker NNN,
514 static void inc_statement_created_tmp_tables_noop(PSI_statement_locker *locker NNN,
520 static void inc_statement_select_full_join_noop(PSI_statement_locker *locker NNN,
526 static void inc_statement_select_full_range_join_noop(PSI_statement_locker *locker NNN,
532 static void inc_statement_select_range_noop(PSI_statement_locker *locker NNN,
538 static void inc_statement_select_range_check_noop(PSI_statement_locker *locker NNN,
544 static void inc_statement_select_scan_noop(PSI_statement_locker *locker NNN,
550 static void inc_statement_sort_merge_passes_noop(PSI_statement_locker *locker NNN,
556 static void inc_statement_sort_range_noop(PSI_statement_locker *locker NNN,
562 static void inc_statement_sort_rows_noop(PSI_statement_locker *locker NNN,
568 static void inc_statement_sort_scan_noop(PSI_statement_locker *locker NNN,
574 static void set_statement_no_index_used_noop(PSI_statement_locker *locker NNN)
579 static void set_statement_no_good_index_used_noop(PSI_statement_locker *locker NNN)
584 static void end_statement_noop(PSI_statement_locker *locker NNN,
590 static PSI_socket_locker*
591 start_socket_wait_noop(PSI_socket_locker_state *state NNN,
592 PSI_socket *socket NNN,
593 PSI_socket_operation op NNN,
595 const char *src_file NNN,
601 static void end_socket_wait_noop(PSI_socket_locker *locker NNN,
607 static void set_socket_state_noop(PSI_socket *socket NNN,
608 enum PSI_socket_state state NNN)
613 static void set_socket_info_noop(PSI_socket *socket NNN,
614 const my_socket *fd NNN,
615 const struct sockaddr *addr NNN,
616 socklen_t addr_len NNN)
621 static void set_socket_thread_owner_noop(PSI_socket *socket NNN)
626 static struct PSI_digest_locker*
627 digest_start_noop(PSI_statement_locker *locker NNN)
632 static PSI_digest_locker*
633 digest_add_token_noop(PSI_digest_locker *locker NNN,
635 struct OPAQUE_LEX_YYSTYPE *yylval NNN)
641 set_thread_connect_attrs_noop(
const char *buffer __attribute__((unused)),
642 uint length __attribute__((unused)),
643 const void *from_cs __attribute__((unused)))
651 register_rwlock_noop,
653 register_thread_noop,
656 register_statement_noop,
657 register_socket_noop,
666 get_table_share_noop,
667 release_table_share_noop,
668 drop_table_share_noop,
678 set_thread_user_noop,
679 set_thread_user_host_noop,
681 set_thread_command_noop,
682 set_thread_start_time_noop,
683 set_thread_state_noop,
684 set_thread_info_noop,
686 delete_current_thread_noop,
688 get_thread_file_name_locker_noop,
689 get_thread_file_stream_locker_noop,
690 get_thread_file_descriptor_locker_noop,
695 start_idle_wait_noop,
697 start_mutex_wait_noop,
699 start_rwlock_rdwait_noop,
700 end_rwlock_rdwait_noop,
701 start_rwlock_wrwait_noop,
702 end_rwlock_wrwait_noop,
703 start_cond_wait_noop,
705 start_table_io_wait_noop,
706 end_table_io_wait_noop,
707 start_table_lock_wait_noop,
708 end_table_lock_wait_noop,
709 start_file_open_wait_noop,
710 end_file_open_wait_noop,
711 end_file_open_wait_and_bind_to_descriptor_noop,
712 start_file_wait_noop,
714 start_file_close_wait_noop,
715 end_file_close_wait_noop,
718 get_thread_statement_locker_noop,
719 refine_statement_noop,
720 start_statement_noop,
721 set_statement_text_noop,
722 set_statement_lock_time_noop,
723 set_statement_rows_sent_noop,
724 set_statement_rows_examined_noop,
725 inc_statement_created_tmp_disk_tables_noop,
726 inc_statement_created_tmp_tables_noop,
727 inc_statement_select_full_join_noop,
728 inc_statement_select_full_range_join_noop,
729 inc_statement_select_range_noop,
730 inc_statement_select_range_check_noop,
731 inc_statement_select_scan_noop,
732 inc_statement_sort_merge_passes_noop,
733 inc_statement_sort_range_noop,
734 inc_statement_sort_rows_noop,
735 inc_statement_sort_scan_noop,
736 set_statement_no_index_used_noop,
737 set_statement_no_good_index_used_noop,
739 start_socket_wait_noop,
740 end_socket_wait_noop,
741 set_socket_state_noop,
742 set_socket_info_noop,
743 set_socket_thread_owner_noop,
745 digest_add_token_noop,
746 set_thread_connect_attrs_noop
767 void set_psi_server(
PSI *psi)