Coverage Report

Created: 2024-06-18 07:03

/src/server/mysys/psi_noop.c
Line
Count
Source (jump to first uncovered line)
1
/* Copyright (c) 2011, 2022, 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
  Without limiting anything contained in the foregoing, this file,
15
  which is part of C Driver for MySQL (Connector/C), is also subject to the
16
  Universal FOSS Exception, version 1.0, a copy of which can be found at
17
  http://oss.oracle.com/licenses/universal-foss-exception.
18
19
  This program is distributed in the hope that it will be useful,
20
  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
  GNU General Public License, version 2.0, for more details.
23
24
  You should have received a copy of the GNU General Public License
25
  along with this program; if not, write to the Free Software Foundation,
26
  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
27
28
/*
29
  Always provide the noop performance interface, for plugins.
30
*/
31
32
#define USE_PSI_V1
33
#define HAVE_PSI_INTERFACE
34
35
#include "my_global.h"
36
#include "my_pthread.h"
37
#include "my_sys.h"
38
#include "mysql/psi/psi.h"
39
40
C_MODE_START
41
42
#define NNN __attribute__((unused))
43
44
static void register_mutex_noop(const char *category NNN,
45
                                PSI_mutex_info *info NNN,
46
                                int count NNN)
47
0
{
48
0
  return;
49
0
}
50
51
static void register_rwlock_noop(const char *category NNN,
52
                                 PSI_rwlock_info *info NNN,
53
                                 int count NNN)
54
0
{
55
0
  return;
56
0
}
57
58
static void register_cond_noop(const char *category NNN,
59
                               PSI_cond_info *info NNN,
60
                               int count NNN)
61
0
{
62
0
  return;
63
0
}
64
65
static void register_thread_noop(const char *category NNN,
66
                                 PSI_thread_info *info NNN,
67
                                 int count NNN)
68
0
{
69
0
  return;
70
0
}
71
72
static void register_file_noop(const char *category NNN,
73
                               PSI_file_info *info NNN,
74
                               int count NNN)
75
0
{
76
0
  return;
77
0
}
78
79
static void register_stage_noop(const char *category NNN,
80
                                PSI_stage_info **info_array NNN,
81
                                int count NNN)
82
0
{
83
0
  return;
84
0
}
85
86
static void register_statement_noop(const char *category NNN,
87
                                    PSI_statement_info *info NNN,
88
                                    int count NNN)
89
0
{
90
0
  return;
91
0
}
92
93
static void register_socket_noop(const char *category NNN,
94
                                 PSI_socket_info *info NNN,
95
                                 int count NNN)
96
0
{
97
0
  return;
98
0
}
99
100
static PSI_mutex*
101
init_mutex_noop(PSI_mutex_key key NNN, void *identity NNN)
102
0
{
103
0
  return NULL;
104
0
}
105
106
static void destroy_mutex_noop(PSI_mutex* mutex NNN)
107
0
{
108
0
  return;
109
0
}
110
111
static PSI_rwlock*
112
init_rwlock_noop(PSI_rwlock_key key NNN, void *identity NNN)
113
0
{
114
0
  return NULL;
115
0
}
116
117
static void destroy_rwlock_noop(PSI_rwlock* rwlock NNN)
118
0
{
119
0
  return;
120
0
}
121
122
static PSI_cond*
123
init_cond_noop(PSI_cond_key key NNN, void *identity NNN)
124
0
{
125
0
  return NULL;
126
0
}
127
128
static void destroy_cond_noop(PSI_cond* cond NNN)
129
0
{
130
0
  return;
131
0
}
132
133
static PSI_socket*
134
init_socket_noop(PSI_socket_key key NNN, const my_socket *fd NNN,
135
                 const struct sockaddr *addr NNN, socklen_t addr_len NNN)
136
0
{
137
0
  return NULL;
138
0
}
139
140
static void destroy_socket_noop(PSI_socket* socket NNN)
141
0
{
142
0
  return;
143
0
}
144
145
static PSI_table_share*
146
get_table_share_noop(my_bool temporary NNN, struct TABLE_SHARE *share NNN)
147
0
{
148
0
  return NULL;
149
0
}
150
151
static void release_table_share_noop(PSI_table_share* share NNN)
152
0
{
153
0
  return;
154
0
}
155
156
static void
157
drop_table_share_noop(my_bool temporary NNN, const char *schema_name NNN,
158
                      int schema_name_length NNN, const char *table_name NNN,
159
                      int table_name_length NNN)
160
0
{
161
0
  return;
162
0
}
163
164
static PSI_table*
165
open_table_noop(PSI_table_share *share NNN, const void *identity NNN)
166
0
{
167
0
  return NULL;
168
0
}
169
170
static void unbind_table_noop(PSI_table *table NNN)
171
0
{
172
0
  return;
173
0
}
174
175
static PSI_table*
176
rebind_table_noop(PSI_table_share *share NNN,
177
                  const void *identity NNN,
178
                  PSI_table *table NNN)
179
0
{
180
0
  return NULL;
181
0
}
182
183
static void close_table_noop(struct TABLE_SHARE *share NNN,
184
                             PSI_table *table NNN)
185
0
{
186
0
  return;
187
0
}
188
189
static void create_file_noop(PSI_file_key key NNN,
190
                             const char *name NNN, File file NNN)
191
0
{
192
0
  return;
193
0
}
194
195
static int spawn_thread_noop(PSI_thread_key key NNN,
196
                             pthread_t *thread NNN,
197
                             const pthread_attr_t *attr NNN,
198
                             void *(*start_routine)(void*) NNN, void *arg NNN)
199
0
{
200
0
  return pthread_create(thread, attr, start_routine, arg);
201
0
}
202
203
static PSI_thread*
204
new_thread_noop(PSI_thread_key key NNN,
205
                const void *identity NNN, ulonglong thread_id NNN)
206
0
{
207
0
  return NULL;
208
0
}
209
210
static void set_thread_id_noop(PSI_thread *thread NNN, ulonglong id NNN)
211
0
{
212
0
  return;
213
0
}
214
215
static void set_thread_THD_noop(PSI_thread *thread NNN, THD *thd NNN)
216
0
{
217
0
  return;
218
0
}
219
220
static void set_thread_os_id_noop(PSI_thread *thread NNN)
221
0
{
222
0
  return;
223
0
}
224
225
static PSI_thread*
226
get_thread_noop(void NNN)
227
0
{
228
0
  return NULL;
229
0
}
230
231
static void set_thread_user_noop(const char *user NNN, int user_len NNN)
232
0
{
233
0
  return;
234
0
}
235
236
static void set_thread_user_host_noop(const char *user NNN, int user_len NNN,
237
                                      const char *host NNN, int host_len NNN)
238
0
{
239
0
  return;
240
0
}
241
242
static void set_thread_db_noop(const char* db NNN, int db_len NNN)
243
0
{
244
0
  return;
245
0
}
246
247
static void set_thread_command_noop(int command NNN)
248
0
{
249
0
  return;
250
0
}
251
252
static void set_connection_type_noop(opaque_vio_type conn_type NNN)
253
0
{
254
0
  return;
255
0
}
256
257
static void set_thread_start_time_noop(time_t start_time NNN)
258
0
{
259
0
  return;
260
0
}
261
262
static void set_thread_state_noop(const char* state NNN)
263
0
{
264
0
  return;
265
0
}
266
267
static void set_thread_info_noop(const char* info NNN, uint info_len NNN)
268
0
{
269
0
  return;
270
0
}
271
272
static void set_thread_noop(PSI_thread* thread NNN)
273
0
{
274
0
  return;
275
0
}
276
277
static void set_thread_peer_port_noop(PSI_thread * thread NNN, uint port NNN)
278
0
{
279
0
  return;
280
0
}
281
282
static void delete_current_thread_noop(void)
283
0
{
284
0
  return;
285
0
}
286
287
static void delete_thread_noop(PSI_thread *thread NNN)
288
0
{
289
0
  return;
290
0
}
291
292
static PSI_file_locker*
293
get_thread_file_name_locker_noop(PSI_file_locker_state *state NNN,
294
                                 PSI_file_key key NNN,
295
                                 enum PSI_file_operation op NNN,
296
                                 const char *name NNN, const void *identity NNN)
297
0
{
298
0
  return NULL;
299
0
}
300
301
static PSI_file_locker*
302
get_thread_file_stream_locker_noop(PSI_file_locker_state *state NNN,
303
                                   PSI_file *file NNN,
304
                                   enum PSI_file_operation op NNN)
305
0
{
306
0
  return NULL;
307
0
}
308
309
310
static PSI_file_locker*
311
get_thread_file_descriptor_locker_noop(PSI_file_locker_state *state NNN,
312
                                       File file NNN,
313
                                       enum PSI_file_operation op NNN)
314
0
{
315
0
  return NULL;
316
0
}
317
318
static void unlock_mutex_noop(PSI_mutex *mutex NNN)
319
0
{
320
0
  return;
321
0
}
322
323
static void unlock_rwlock_noop(PSI_rwlock *rwlock NNN)
324
0
{
325
0
  return;
326
0
}
327
328
static void signal_cond_noop(PSI_cond* cond NNN)
329
0
{
330
0
  return;
331
0
}
332
333
static void broadcast_cond_noop(PSI_cond* cond NNN)
334
0
{
335
0
  return;
336
0
}
337
338
static PSI_idle_locker*
339
start_idle_wait_noop(PSI_idle_locker_state* state NNN,
340
                     const char *src_file NNN, uint src_line NNN)
341
0
{
342
0
  return NULL;
343
0
}
344
345
static void end_idle_wait_noop(PSI_idle_locker* locker NNN)
346
0
{
347
0
  return;
348
0
}
349
350
static PSI_mutex_locker*
351
start_mutex_wait_noop(PSI_mutex_locker_state *state NNN,
352
                      PSI_mutex *mutex NNN,
353
                      PSI_mutex_operation op NNN,
354
                      const char *src_file NNN, uint src_line NNN)
355
0
{
356
0
  return NULL;
357
0
}
358
359
static void end_mutex_wait_noop(PSI_mutex_locker* locker NNN, int rc NNN)
360
0
{
361
0
  return;
362
0
}
363
364
365
static PSI_rwlock_locker*
366
start_rwlock_rdwait_noop(struct PSI_rwlock_locker_state_v1 *state NNN,
367
                         struct PSI_rwlock *rwlock NNN,
368
                         enum PSI_rwlock_operation op NNN,
369
                         const char *src_file NNN, uint src_line NNN)
370
0
{
371
0
  return NULL;
372
0
}
373
374
static void end_rwlock_rdwait_noop(PSI_rwlock_locker* locker NNN, int rc NNN)
375
0
{
376
0
  return;
377
0
}
378
379
static struct PSI_rwlock_locker*
380
start_rwlock_wrwait_noop(struct PSI_rwlock_locker_state_v1 *state NNN,
381
                         struct PSI_rwlock *rwlock NNN,
382
                         enum PSI_rwlock_operation op NNN,
383
                         const char *src_file NNN, uint src_line NNN)
384
0
{
385
0
  return NULL;
386
0
}
387
388
static void end_rwlock_wrwait_noop(PSI_rwlock_locker* locker NNN, int rc NNN)
389
0
{
390
0
  return;
391
0
}
392
393
static struct PSI_cond_locker*
394
start_cond_wait_noop(struct PSI_cond_locker_state_v1 *state NNN,
395
                     struct PSI_cond *cond NNN,
396
                     struct PSI_mutex *mutex NNN,
397
                     enum PSI_cond_operation op NNN,
398
                     const char *src_file NNN, uint src_line NNN)
399
0
{
400
0
  return NULL;
401
0
}
402
403
static void end_cond_wait_noop(PSI_cond_locker* locker NNN, int rc NNN)
404
0
{
405
0
  return;
406
0
}
407
408
static struct PSI_table_locker*
409
start_table_io_wait_noop(struct PSI_table_locker_state *state NNN,
410
                         struct PSI_table *table NNN,
411
                         enum PSI_table_io_operation op NNN,
412
                         uint index NNN,
413
                         const char *src_file NNN, uint src_line NNN)
414
0
{
415
0
  return NULL;
416
0
}
417
418
static void end_table_io_wait_noop(PSI_table_locker* locker NNN,
419
                                   ulonglong numrows NNN)
420
0
{
421
0
  return;
422
0
}
423
424
static struct PSI_table_locker*
425
start_table_lock_wait_noop(struct PSI_table_locker_state *state NNN,
426
                           struct PSI_table *table NNN,
427
                           enum PSI_table_lock_operation op NNN,
428
                           ulong flags NNN,
429
                           const char *src_file NNN, uint src_line NNN)
430
0
{
431
0
  return NULL;
432
0
}
433
434
static void end_table_lock_wait_noop(PSI_table_locker* locker NNN)
435
0
{
436
0
  return;
437
0
}
438
439
static void start_file_open_wait_noop(PSI_file_locker *locker NNN,
440
                                      const char *src_file NNN,
441
                                      uint src_line NNN)
442
0
{
443
0
  return;
444
0
}
445
446
static PSI_file* end_file_open_wait_noop(PSI_file_locker *locker NNN,
447
                                         void *result NNN)
448
0
{
449
0
  return NULL;
450
0
}
451
452
static void end_file_open_wait_and_bind_to_descriptor_noop
453
  (PSI_file_locker *locker NNN, File file NNN)
454
0
{
455
0
  return;
456
0
}
457
458
static void end_temp_file_open_wait_and_bind_to_descriptor_noop
459
  (PSI_file_locker *locker NNN, File file NNN, const char *filaneme NNN)
460
0
{
461
0
  return;
462
0
}
463
464
static void start_file_wait_noop(PSI_file_locker *locker NNN,
465
                                 size_t count NNN,
466
                                 const char *src_file NNN,
467
                                 uint src_line NNN)
468
0
{
469
0
  return;
470
0
}
471
472
static void end_file_wait_noop(PSI_file_locker *locker NNN,
473
                               size_t count NNN)
474
0
{
475
0
  return;
476
0
}
477
478
static void start_file_close_wait_noop(PSI_file_locker *locker NNN,
479
                                       const char *src_file NNN,
480
                                       uint src_line NNN)
481
0
{
482
0
  return;
483
0
}
484
485
static void end_file_close_wait_noop(PSI_file_locker *locker NNN,
486
                                     int result NNN)
487
0
{
488
0
  return;
489
0
}
490
491
static void end_file_rename_wait_noop(PSI_file_locker *locker NNN,
492
                                      const char *old_name NNN,
493
                                      const char *new_name NNN,
494
                                      int result NNN)
495
0
{
496
0
  return;
497
0
}
498
499
static PSI_stage_progress*
500
start_stage_noop(PSI_stage_key key NNN,
501
                 const char *src_file NNN, int src_line NNN)
502
0
{
503
0
  return NULL;
504
0
}
505
506
static PSI_stage_progress*
507
get_current_stage_progress_noop(void)
508
0
{
509
0
  return NULL;
510
0
}
511
512
static void end_stage_noop(void)
513
0
{
514
0
  return;
515
0
}
516
517
static PSI_statement_locker*
518
get_thread_statement_locker_noop(PSI_statement_locker_state *state NNN,
519
                                 PSI_statement_key key NNN,
520
                                 const void *charset NNN,
521
                                 PSI_sp_share *sp_share NNN)
522
0
{
523
0
  return NULL;
524
0
}
525
526
static PSI_statement_locker*
527
refine_statement_noop(PSI_statement_locker *locker NNN,
528
                      PSI_statement_key key NNN)
529
0
{
530
0
  return NULL;
531
0
}
532
533
static void start_statement_noop(PSI_statement_locker *locker NNN,
534
                                 const char *db NNN, uint db_len NNN,
535
                                 const char *src_file NNN, uint src_line NNN)
536
0
{
537
0
  return;
538
0
}
539
540
static void set_statement_text_noop(PSI_statement_locker *locker NNN,
541
                                    const char *text NNN, uint text_len NNN)
542
0
{
543
0
  return;
544
0
}
545
546
static void set_statement_lock_time_noop(PSI_statement_locker *locker NNN,
547
                                         ulonglong count NNN)
548
0
{
549
0
  return;
550
0
}
551
552
static void set_statement_rows_sent_noop(PSI_statement_locker *locker NNN,
553
                                         ulonglong count NNN)
554
0
{
555
0
  return;
556
0
}
557
558
static void set_statement_rows_examined_noop(PSI_statement_locker *locker NNN,
559
                                             ulonglong count NNN)
560
0
{
561
0
  return;
562
0
}
563
564
static void inc_statement_created_tmp_disk_tables_noop(PSI_statement_locker *locker NNN,
565
                                                       ulong count NNN)
566
0
{
567
0
  return;
568
0
}
569
570
static void inc_statement_created_tmp_tables_noop(PSI_statement_locker *locker NNN,
571
                                                  ulong count NNN)
572
0
{
573
0
  return;
574
0
}
575
576
static void inc_statement_select_full_join_noop(PSI_statement_locker *locker NNN,
577
                                                ulong count NNN)
578
0
{
579
0
  return;
580
0
}
581
582
static void inc_statement_select_full_range_join_noop(PSI_statement_locker *locker NNN,
583
                                                      ulong count NNN)
584
0
{
585
0
  return;
586
0
}
587
588
static void inc_statement_select_range_noop(PSI_statement_locker *locker NNN,
589
                                            ulong count NNN)
590
0
{
591
0
  return;
592
0
}
593
594
static void inc_statement_select_range_check_noop(PSI_statement_locker *locker NNN,
595
                                                  ulong count NNN)
596
0
{
597
0
  return;
598
0
}
599
600
static void inc_statement_select_scan_noop(PSI_statement_locker *locker NNN,
601
                                           ulong count NNN)
602
0
{
603
0
  return;
604
0
}
605
606
static void inc_statement_sort_merge_passes_noop(PSI_statement_locker *locker NNN,
607
                                                 ulong count NNN)
608
0
{
609
0
  return;
610
0
}
611
612
static void inc_statement_sort_range_noop(PSI_statement_locker *locker NNN,
613
                                          ulong count NNN)
614
0
{
615
0
  return;
616
0
}
617
618
static void inc_statement_sort_rows_noop(PSI_statement_locker *locker NNN,
619
                                         ulong count NNN)
620
0
{
621
0
  return;
622
0
}
623
624
static void inc_statement_sort_scan_noop(PSI_statement_locker *locker NNN,
625
                                         ulong count NNN)
626
0
{
627
0
  return;
628
0
}
629
630
static void set_statement_no_index_used_noop(PSI_statement_locker *locker NNN)
631
0
{
632
0
  return;
633
0
}
634
635
static void set_statement_no_good_index_used_noop(PSI_statement_locker *locker NNN)
636
0
{
637
0
  return;
638
0
}
639
640
static void end_statement_noop(PSI_statement_locker *locker NNN,
641
                               void *stmt_da NNN)
642
0
{
643
0
  return;
644
0
}
645
646
static PSI_transaction_locker*
647
get_thread_transaction_locker_noop(PSI_transaction_locker_state *state NNN,
648
                                   const void *xid NNN,
649
                                   ulonglong trxid NNN,
650
                                   int isolation_level NNN,
651
                                   my_bool read_only NNN,
652
                                   my_bool autocommit NNN)
653
0
{
654
0
  return NULL;
655
0
}
656
657
static void start_transaction_noop(PSI_transaction_locker *locker NNN,
658
                                   const char *src_file NNN, uint src_line NNN)
659
0
{
660
0
  return;
661
0
}
662
663
static void set_transaction_xid_noop(PSI_transaction_locker *locker NNN,
664
                                     const void *xid NNN,
665
                                     int xa_state NNN)
666
0
{
667
0
  return;
668
0
}
669
670
static void set_transaction_xa_state_noop(PSI_transaction_locker *locker NNN,
671
                                          int xa_state NNN)
672
0
{
673
0
  return;
674
0
}
675
676
static void set_transaction_gtid_noop(PSI_transaction_locker *locker NNN,
677
                                      const void *sid NNN,
678
                                      const void *gtid_spec NNN)
679
0
{
680
0
  return;
681
0
}
682
683
static void set_transaction_trxid_noop(PSI_transaction_locker *locker NNN,
684
                                       const ulonglong *trxid NNN)
685
0
{
686
0
  return;
687
0
}
688
689
static void inc_transaction_savepoints_noop(PSI_transaction_locker *locker NNN,
690
                                            ulong count NNN)
691
0
{
692
0
  return;
693
0
}
694
695
static void inc_transaction_rollback_to_savepoint_noop(PSI_transaction_locker *locker NNN,
696
                                                       ulong count NNN)
697
0
{
698
0
  return;
699
0
}
700
701
static void inc_transaction_release_savepoint_noop(PSI_transaction_locker *locker NNN,
702
                                                   ulong count NNN)
703
0
{
704
0
  return;
705
0
}
706
707
static void end_transaction_noop(PSI_transaction_locker *locker NNN,
708
                                 my_bool commit NNN)
709
0
{
710
0
  return;
711
0
}
712
713
static PSI_socket_locker*
714
start_socket_wait_noop(PSI_socket_locker_state *state NNN,
715
                       PSI_socket *socket NNN,
716
                       PSI_socket_operation op NNN,
717
                       size_t count NNN,
718
                       const char *src_file NNN,
719
                       uint src_line NNN)
720
0
{
721
0
  return NULL;
722
0
}
723
724
static void end_socket_wait_noop(PSI_socket_locker *locker NNN,
725
                                 size_t count NNN)
726
0
{
727
0
  return;
728
0
}
729
730
static void set_socket_state_noop(PSI_socket *socket NNN,
731
                                  enum PSI_socket_state state NNN)
732
0
{
733
0
  return;
734
0
}
735
736
static void set_socket_info_noop(PSI_socket *socket NNN,
737
                                 const my_socket *fd NNN,
738
                                 const struct sockaddr *addr NNN,
739
                                 socklen_t addr_len NNN)
740
0
{
741
0
  return;
742
0
}
743
744
static void set_socket_thread_owner_noop(PSI_socket *socket NNN)
745
0
{
746
0
  return;
747
0
}
748
749
static PSI_prepared_stmt*
750
create_prepare_stmt_noop(void *identity NNN, uint stmt_id NNN,
751
                         PSI_statement_locker *locker NNN, 
752
                         const char *stmt_name NNN, size_t stmt_name_length NNN)
753
0
{
754
0
  return NULL;
755
0
}
756
757
static void
758
execute_prepare_stmt_noop(PSI_statement_locker *locker NNN,
759
                        PSI_prepared_stmt *prepared_stmt NNN)
760
0
{
761
0
  return;
762
0
}
763
764
static void set_prepared_stmt_text_noop(PSI_prepared_stmt *prepared_stmt NNN,
765
                                        const char *text NNN, uint text_len NNN)
766
0
{
767
0
  return;
768
0
}
769
770
void
771
destroy_prepared_stmt_noop(PSI_prepared_stmt *prepared_stmt NNN)
772
0
{
773
0
  return;
774
0
}
775
776
void
777
reprepare_prepared_stmt_noop(PSI_prepared_stmt *prepared_stmt NNN)
778
0
{
779
0
  return;
780
0
}
781
782
static struct PSI_digest_locker*
783
digest_start_noop(PSI_statement_locker *locker NNN)
784
0
{
785
0
  return NULL;
786
0
}
787
788
static void
789
digest_end_noop(PSI_digest_locker *locker NNN,
790
                const struct sql_digest_storage *digest NNN)
791
0
{
792
0
  return;
793
0
}
794
795
static int
796
set_thread_connect_attrs_noop(const char *buffer __attribute__ ((unused)),
797
                             uint length __attribute__ ((unused)),
798
                             const void *from_cs __attribute__ ((unused)))
799
0
{
800
0
  return 0;
801
0
}
802
803
static PSI_sp_locker*
804
pfs_start_sp_noop(PSI_sp_locker_state *state NNN, PSI_sp_share *sp_share NNN)
805
0
{
806
0
  return NULL;
807
0
}
808
809
static void pfs_end_sp_noop(PSI_sp_locker *locker NNN)
810
0
{
811
0
  return;
812
0
}
813
814
static void
815
pfs_drop_sp_noop(uint object_type NNN,
816
                 const char *schema_name NNN, uint schema_name_length NNN,
817
                 const char *object_name NNN, uint object_name_length NNN)
818
0
{
819
0
  return;
820
0
}
821
822
static PSI_sp_share*
823
pfs_get_sp_share_noop(uint object_type NNN,
824
                      const char *schema_name NNN, uint schema_name_length NNN,
825
                      const char *object_name NNN, uint object_name_length NNN)
826
0
{
827
0
  return NULL;
828
0
}
829
830
static void
831
pfs_release_sp_share_noop(PSI_sp_share *sp_share NNN)
832
0
{
833
0
  return;
834
0
}
835
836
static void register_memory_noop(const char *category NNN,
837
                                 PSI_memory_info *info NNN,
838
                                 int count NNN)
839
0
{
840
0
  return;
841
0
}
842
843
static PSI_memory_key memory_alloc_noop(PSI_memory_key key NNN, size_t size NNN, struct PSI_thread ** owner NNN)
844
0
{
845
0
  *owner= NULL;
846
0
  return PSI_NOT_INSTRUMENTED;
847
0
}
848
849
static PSI_memory_key memory_realloc_noop(PSI_memory_key key NNN, size_t old_size NNN, size_t new_size NNN, struct PSI_thread ** owner NNN)
850
0
{
851
0
  *owner= NULL;
852
0
  return PSI_NOT_INSTRUMENTED;
853
0
}
854
855
static PSI_memory_key memory_claim_noop(PSI_memory_key key NNN, size_t size NNN, struct PSI_thread ** owner)
856
0
{
857
0
  *owner= NULL;
858
0
  return PSI_NOT_INSTRUMENTED;
859
0
}
860
861
static void memory_free_noop(PSI_memory_key key NNN, size_t size NNN, struct PSI_thread * owner NNN)
862
0
{
863
0
  return;
864
0
}
865
866
static void unlock_table_noop(PSI_table *table NNN)
867
0
{
868
0
  return;
869
0
}
870
871
static PSI_metadata_lock *
872
create_metadata_lock_noop(void *identity NNN,
873
                          const MDL_key *mdl_key NNN,
874
                          opaque_mdl_type mdl_type NNN,
875
                          opaque_mdl_duration mdl_duration NNN,
876
                          opaque_mdl_status mdl_status NNN,
877
                          const char *src_file NNN,
878
                          uint src_line NNN)
879
0
{
880
0
  return NULL;
881
0
}
882
883
static void
884
set_metadata_lock_status_noop(PSI_metadata_lock* lock NNN,
885
                              opaque_mdl_status mdl_status NNN)
886
0
{
887
0
}
888
889
static void
890
destroy_metadata_lock_noop(PSI_metadata_lock* lock NNN)
891
0
{
892
0
}
893
894
static PSI_metadata_locker *
895
start_metadata_wait_noop(PSI_metadata_locker_state *state NNN,
896
                         PSI_metadata_lock *mdl NNN,
897
                         const char *src_file NNN,
898
                         uint src_line NNN)
899
0
{
900
0
  return NULL;
901
0
}
902
903
static void
904
end_metadata_wait_noop(PSI_metadata_locker *locker NNN,
905
                       int rc NNN)
906
0
{
907
0
}
908
909
static PSI PSI_noop=
910
{
911
  register_mutex_noop,
912
  register_rwlock_noop,
913
  register_cond_noop,
914
  register_thread_noop,
915
  register_file_noop,
916
  register_stage_noop,
917
  register_statement_noop,
918
  register_socket_noop,
919
  init_mutex_noop,
920
  destroy_mutex_noop,
921
  init_rwlock_noop,
922
  destroy_rwlock_noop,
923
  init_cond_noop,
924
  destroy_cond_noop,
925
  init_socket_noop,
926
  destroy_socket_noop,
927
  get_table_share_noop,
928
  release_table_share_noop,
929
  drop_table_share_noop,
930
  open_table_noop,
931
  unbind_table_noop,
932
  rebind_table_noop,
933
  close_table_noop,
934
  create_file_noop,
935
  spawn_thread_noop,
936
  new_thread_noop,
937
  set_thread_id_noop,
938
  set_thread_THD_noop,
939
  set_thread_os_id_noop,
940
  get_thread_noop,
941
  set_thread_user_noop,
942
  set_thread_user_host_noop,
943
  set_thread_db_noop,
944
  set_thread_command_noop,
945
  set_connection_type_noop,
946
  set_thread_start_time_noop,
947
  set_thread_state_noop,
948
  set_thread_info_noop,
949
  set_thread_noop,
950
  delete_current_thread_noop,
951
  delete_thread_noop,
952
  get_thread_file_name_locker_noop,
953
  get_thread_file_stream_locker_noop,
954
  get_thread_file_descriptor_locker_noop,
955
  unlock_mutex_noop,
956
  unlock_rwlock_noop,
957
  signal_cond_noop,
958
  broadcast_cond_noop,
959
  start_idle_wait_noop,
960
  end_idle_wait_noop,
961
  start_mutex_wait_noop,
962
  end_mutex_wait_noop,
963
  start_rwlock_rdwait_noop,
964
  end_rwlock_rdwait_noop,
965
  start_rwlock_wrwait_noop,
966
  end_rwlock_wrwait_noop,
967
  start_cond_wait_noop,
968
  end_cond_wait_noop,
969
  start_table_io_wait_noop,
970
  end_table_io_wait_noop,
971
  start_table_lock_wait_noop,
972
  end_table_lock_wait_noop,
973
  start_file_open_wait_noop,
974
  end_file_open_wait_noop,
975
  end_file_open_wait_and_bind_to_descriptor_noop,
976
  end_temp_file_open_wait_and_bind_to_descriptor_noop,
977
  start_file_wait_noop,
978
  end_file_wait_noop,
979
  start_file_close_wait_noop,
980
  end_file_close_wait_noop,
981
  end_file_rename_wait_noop,
982
  start_stage_noop,
983
  get_current_stage_progress_noop,
984
  end_stage_noop,
985
  get_thread_statement_locker_noop,
986
  refine_statement_noop,
987
  start_statement_noop,
988
  set_statement_text_noop,
989
  set_statement_lock_time_noop,
990
  set_statement_rows_sent_noop,
991
  set_statement_rows_examined_noop,
992
  inc_statement_created_tmp_disk_tables_noop,
993
  inc_statement_created_tmp_tables_noop,
994
  inc_statement_select_full_join_noop,
995
  inc_statement_select_full_range_join_noop,
996
  inc_statement_select_range_noop,
997
  inc_statement_select_range_check_noop,
998
  inc_statement_select_scan_noop,
999
  inc_statement_sort_merge_passes_noop,
1000
  inc_statement_sort_range_noop,
1001
  inc_statement_sort_rows_noop,
1002
  inc_statement_sort_scan_noop,
1003
  set_statement_no_index_used_noop,
1004
  set_statement_no_good_index_used_noop,
1005
  end_statement_noop,
1006
  get_thread_transaction_locker_noop,
1007
  start_transaction_noop,
1008
  set_transaction_xid_noop,
1009
  set_transaction_xa_state_noop,
1010
  set_transaction_gtid_noop,
1011
  set_transaction_trxid_noop,
1012
  inc_transaction_savepoints_noop,
1013
  inc_transaction_rollback_to_savepoint_noop,
1014
  inc_transaction_release_savepoint_noop,
1015
  end_transaction_noop,
1016
  start_socket_wait_noop,
1017
  end_socket_wait_noop,
1018
  set_socket_state_noop,
1019
  set_socket_info_noop,
1020
  set_socket_thread_owner_noop,
1021
  create_prepare_stmt_noop,
1022
  destroy_prepared_stmt_noop,
1023
  reprepare_prepared_stmt_noop,
1024
  execute_prepare_stmt_noop,
1025
  set_prepared_stmt_text_noop,
1026
  digest_start_noop,
1027
  digest_end_noop,
1028
  set_thread_connect_attrs_noop,
1029
  pfs_start_sp_noop,
1030
  pfs_end_sp_noop,
1031
  pfs_drop_sp_noop,
1032
  pfs_get_sp_share_noop,
1033
  pfs_release_sp_share_noop,
1034
  register_memory_noop,
1035
  memory_alloc_noop,
1036
  memory_realloc_noop,
1037
  memory_claim_noop,
1038
  memory_free_noop,
1039
1040
  unlock_table_noop,
1041
  create_metadata_lock_noop,
1042
  set_metadata_lock_status_noop,
1043
  destroy_metadata_lock_noop,
1044
  start_metadata_wait_noop,
1045
  end_metadata_wait_noop,
1046
1047
  set_thread_peer_port_noop
1048
};
1049
1050
/**
1051
  Hook for the instrumentation interface.
1052
  Code implementing the instrumentation interface should register here.
1053
*/
1054
struct PSI_bootstrap *PSI_hook= NULL;
1055
1056
/**
1057
  Instance of the instrumentation interface for the MySQL server.
1058
  @todo This is currently a global variable, which is handy when
1059
  compiling instrumented code that is bundled with the server.
1060
  When dynamic plugin are truly supported, this variable will need
1061
  to be replaced by a macro, so that each XYZ plugin can have it's own
1062
  xyz_psi_server variable, obtained from PSI_bootstrap::get_interface()
1063
  with the version used at compile time for plugin XYZ.
1064
*/
1065
1066
PSI *PSI_server= & PSI_noop;
1067
1068
void set_psi_server(PSI *psi)
1069
0
{
1070
0
  PSI_server= psi;
1071
0
}
1072
1073
C_MODE_END
1074