MySQL 8.4.0
Source Code Documentation
pfs_instr_class.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2024, 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#ifndef PFS_INSTR_CLASS_H
25#define PFS_INSTR_CLASS_H
26
27#include "my_config.h"
28
29#include <assert.h>
30#include <sys/types.h>
31#include <atomic>
32
33#include "lf.h"
34#include "my_compiler.h"
35
36#include "my_inttypes.h"
38#include "mysql_com.h" /* NAME_LEN */
39#include "mysqld_error.h"
40#include "prealloced_array.h"
47
48struct TABLE_SHARE;
49
50/**
51 @file storage/perfschema/pfs_instr_class.h
52 Performance schema instruments metadata (declarations).
53*/
54
55/**
56 Maximum length of an instrument name.
57 For example, 'wait/sync/mutex/sql/LOCK_open' is an instrument name.
58*/
59#define PFS_MAX_INFO_NAME_LENGTH 128
60
61/**
62 Maximum length of the thread os name.
63 Must include a terminating NUL character.
64 Length is 16 because of linux pthread_setname_np(3)
65 @see my_thread_self_setname()
66*/
67#define PFS_MAX_OS_NAME_LENGTH 16
68
69/**
70 Maximum length of the 'full' prefix of an instrument name.
71 For example, for the instrument name 'wait/sync/mutex/sql/LOCK_open',
72 the full prefix is 'wait/sync/mutex/sql/', which in turn derives from
73 a prefix 'wait/sync/mutex' for mutexes, and a category of 'sql' for mutexes
74 of the sql layer in the server.
75*/
76#define PFS_MAX_FULL_PREFIX_NAME_LENGTH 32
77
78struct PFS_global_param;
79struct PFS_table_share;
80class PFS_opaque_container_page;
81
82/**
83 @addtogroup performance_schema_buffers
84 @{
85*/
86
87extern bool pfs_enabled;
88
89/** Global ref count for plugin and component events. */
90extern std::atomic<uint32> pfs_unload_plugin_ref_count;
91
92/** Key, naming a synch instrument (mutex, rwlock, cond). */
93typedef unsigned int PFS_sync_key;
94/** Key, naming a thread instrument. */
95typedef unsigned int PFS_thread_key;
96/** Key, naming a file instrument. */
97typedef unsigned int PFS_file_key;
98/** Key, naming a stage instrument. */
99typedef unsigned int PFS_stage_key;
100/** Key, naming a statement instrument. */
101typedef unsigned int PFS_statement_key;
102/** Key, naming a transaction instrument. */
103typedef unsigned int PFS_transaction_key;
104/** Key, naming a socket instrument. */
105typedef unsigned int PFS_socket_key;
106/** Key, naming a memory instrument. */
107typedef unsigned int PFS_memory_key;
108/** Key, naming a meter instrument. */
109typedef unsigned int PFS_meter_key;
110/** Key, naming a metric instrument. */
111typedef unsigned int PFS_metric_key;
112
136
137/** User-defined instrument configuration. */
139 /* Instrument name. */
140 char *m_name;
141 /* Name length. */
143 /** Enabled flag. */
145 /** Timed flag. */
147};
148
151
152struct PFS_thread;
153
154extern uint mutex_class_start;
155extern uint rwlock_class_start;
156extern uint cond_class_start;
157extern uint file_class_start;
158extern uint socket_class_start;
159extern uint wait_class_max;
160
161/**
162 Encapsulates the name of an instrumented entity.
163*/
165 public:
166 static constexpr uint max_length = PFS_MAX_INFO_NAME_LENGTH - 1;
167 /*
168 DO NOT ACCESS THE DATA MEMBERS DIRECTLY. USE THE GETTERS AND
169 SETTERS INSTEAD.
170
171 The data members should really have been private, but having both
172 private and public members would make the class a non-POD. We
173 need to call memset on PFS_instr_class (in init_instr_class), and
174 the behavior of memset is undefined on non-POD objects. Therefore
175 we keep the data members public, with an underscore prefix, and
176 this warning text.
177 */
178 public /*private*/:
179 /** Instrument name. */
180 char m_private_name[max_length + 1];
181 /** Length in bytes of @c m_name. */
183 /** Old instrument name, if any. */
185 /** Length in bytes of old instrument name len, if any. */
187 /** The oldest version that uses the new name. */
189
190 public:
191 /** Return the name as a string. */
192 const char *str() const;
193 /** Return the length of the string. */
194 uint length() const;
195 /**
196 Copy the specified name to this name.
197
198 @param class_type The class type of this name, i.e., whether it is
199 the name of a mutex, thread, etc.
200
201 @param name The buffer to read from.
202
203 @param max_length_arg If is given, at most that many chars are
204 copied, plus the terminating '\0'. Otherwise, up to buffer_size-1
205 characters are copied, plus the terminating '\0'.
206 */
207 void set(PFS_class_type class_type, const char *name,
208 uint max_length_arg = max_length);
209};
210
211/** Information for all instrumentation. */
213 /** Class type */
215 /** True if this instrument is enabled. */
217 /** True if this instrument is timed. */
219 /** Instrument flags. */
221 /** Instrument enforced flags. */
223 /** Volatility index. */
225 /**
226 Instrument name index.
227 Self index in:
228 - EVENTS_WAITS_SUMMARY_*_BY_EVENT_NAME for waits
229 - EVENTS_STAGES_SUMMARY_*_BY_EVENT_NAME for stages
230 - EVENTS_STATEMENTS_SUMMARY_*_BY_EVENT_NAME for statements
231 - EVENTS_TRANSACTIONS_SUMMARY_*_BY_EVENT_NAME for transactions
232 */
234 /** Instrument name. */
236 /** Documentation. */
238
239 bool is_singleton() const { return m_flags & PSI_FLAG_SINGLETON; }
240
241 bool is_mutable() const { return m_flags & PSI_FLAG_MUTABLE; }
242
243 bool is_progress() const { return m_flags & PSI_FLAG_STAGE_PROGRESS; }
244
246
247 bool is_priority() const { return m_flags & PSI_FLAG_RWLOCK_PR; }
248
249 bool is_transferable() const { return m_flags & PSI_FLAG_TRANSFER; }
250
251 bool is_user() const { return m_flags & PSI_FLAG_USER; }
252
254
255 bool is_global() const { return m_flags & PSI_FLAG_ONLY_GLOBAL_STAT; }
256
257 bool has_seqnum() const {
259 }
260
262
264
267 }
268
269 bool is_disabled() const { return m_flags & PSI_FLAG_DISABLED; }
270
271 bool is_untimed() const { return m_flags & PSI_FLAG_UNTIMED; }
272
274
275 void enforce_valid_flags(uint allowed_flags) {
276 /* Reserved for future use. */
277 allowed_flags |= PSI_FLAG_THREAD | PSI_FLAG_TRANSFER;
278
279 const uint valid_flags = m_flags & allowed_flags;
280 /*
281 This fails when the instrumented code is providing
282 flags that are not supported for this instrument.
283 To fix it, clean up the instrumented code.
284 */
285 assert(valid_flags == m_flags);
286 m_flags = valid_flags;
287 }
288
290 static void set_timed(PFS_instr_class *pfs, bool timed);
291
292 bool is_deferred() const {
293 switch (m_type) {
294 case PFS_CLASS_SOCKET:
295 return true;
296 break;
297 default:
298 return false;
299 break;
300 };
301 }
302
303 bool can_be_timed() const {
304 switch (m_type) {
305 case PFS_CLASS_MEMORY:
306 case PFS_CLASS_ERROR:
307 case PFS_CLASS_THREAD:
308 return false;
309 default:
310 return true;
311 };
312 }
313
314 bool can_be_enforced() const {
315 switch (m_type) {
316 case PFS_CLASS_MEMORY:
317 return true;
318 default:
319 return false;
320 };
321 }
322};
323
324struct PFS_mutex;
325
326#define PFS_MUTEX_PARTITIONS 2
327
328/** Instrumentation metadata for a mutex. */
330 /** Mutex usage statistics. */
332 /** Singleton instance. */
334};
335
336struct PFS_rwlock;
337
338/** Instrumentation metadata for a read write lock. */
340 /** Rwlock usage statistics. */
342 /** Singleton instance. */
344};
345
346struct PFS_cond;
347
348/** Instrumentation metadata for a condition. */
350 /**
351 Condition usage statistics.
352 This statistic is not exposed in user visible tables yet.
353 */
355 /** Singleton instance. */
357};
358
359/** Instrumentation metadata of a thread. */
361 /** Singleton instance. */
363 /** Thread history instrumentation flag. */
364 bool m_history{false};
365 /** Thread os name. */
366 char m_os_name[PFS_MAX_OS_NAME_LENGTH];
367 /** Thread instance sequence number counter. */
368 std::atomic<unsigned int> m_seqnum;
369};
370
371/** Instrumentation metadata for a metric. */
374
375 /** Metric name with length. */
376 const char *m_metric;
378 /** Metric group with length. */
379 const char *m_group;
381 /** Metric unit with length. */
382 const char *m_unit;
384 /** Metric description with length. */
385 const char *m_description;
392};
393
394/** Instrumentation metadata for a meter. */
397
398 /** Meter name with length. */
399 const char *m_meter;
401 /** Meter export frequency in seconds. */
403 /** Meter description with length. */
404 const char *m_description;
407
408 /** Metrics belonging to this meter. */
411};
412
413/** Key identifying a table share. */
415 /** Object type. */
417
418 /** Table schema. */
420
421 /** Table name. */
423};
424
425/** Table index or 'key' */
427 /** Index name */
429 /** Length in bytes of @c m_name. */
431};
432
433/** Index statistics of a table.*/
436 /** The index name */
438 /** The index stat */
440 /** Owner table share. To be used later. */
442 /** Container page. */
443 PFS_opaque_container_page *m_page;
444};
445
446/** Lock statistics of a table.*/
449 /** Lock stats. */
451 /** Owner table share. To be used later. */
453 /** Container page. */
454 PFS_opaque_container_page *m_page;
455};
456
457/** Instrumentation metadata for a table share. */
459 public:
460 uint32 get_version() { return m_lock.get_version(); }
461
462 enum_object_type get_object_type() const { return m_key.m_type; }
463
464 void aggregate_io();
465 void aggregate_lock();
466
467 void sum_io(PFS_single_stat *result, uint key_count);
468 void sum_lock(PFS_single_stat *result);
469 void sum(PFS_single_stat *result, uint key_count);
470
471 inline void aggregate() {
472 aggregate_io();
473 aggregate_lock();
474 }
475
476 inline void init_refcount() { m_refcount.store(1); }
477
478 inline int get_refcount() { return m_refcount.load(); }
479
480 inline void inc_refcount() { ++m_refcount; }
481
482 inline void dec_refcount() { --m_refcount; }
483
484 void refresh_setup_object_flags(PFS_thread *thread);
485
486 /** Internal lock. */
488 /**
489 True if table instrumentation is enabled.
490 This flag is computed from the content of table setup_objects.
491 */
493 /**
494 True if table instrumentation is timed.
495 This flag is computed from the content of table setup_objects.
496 */
498
499 /** Search key. */
501
502 /** Number of indexes. */
504 /** Container page. */
505 PFS_opaque_container_page *m_page;
506
507 PFS_table_share_lock *find_lock_stat() const;
508 PFS_table_share_lock *find_or_create_lock_stat();
509 void destroy_lock_stat();
510
511 PFS_table_share_index *find_index_stat(uint index) const;
512 PFS_table_share_index *find_or_create_index_stat(
513 const TABLE_SHARE *server_share, uint index);
514 void destroy_index_stats();
515
516 private:
517 /** Number of opened table handles. */
518 std::atomic<int> m_refcount;
519 /** Table locks statistics. */
520 std::atomic<PFS_table_share_lock *> m_race_lock_stat;
521 /** Table indexes stats. */
522 std::atomic<PFS_table_share_index *> m_race_index_stat[MAX_INDEXES + 1];
523};
524
525/** Statistics for the IDLE instrument. */
527/** Statistics for dropped table I/O. */
529/** Statistics for dropped table lock. */
531/** Statistics for the METADATA instrument. */
533/** Statistics for the transaction instrument. */
535/** Statistics for the error instrument. */
537
538inline uint sanitize_index_count(uint count) {
539 if (likely(count <= MAX_INDEXES)) {
540 return count;
541 }
542 return 0;
543}
544
545#define GLOBAL_TABLE_IO_EVENT_INDEX 0
546#define GLOBAL_TABLE_LOCK_EVENT_INDEX 1
547#define GLOBAL_IDLE_EVENT_INDEX 2
548#define GLOBAL_METADATA_EVENT_INDEX 3
549/** Number of global wait events. */
550#define COUNT_GLOBAL_EVENT_INDEX 4
551
552/** Transaction events are not wait events .*/
553#define GLOBAL_TRANSACTION_INDEX 0
554
555#define GLOBAL_ERROR_INDEX 0
556
557/**
558 Instrument controlling all table I/O.
559 This instrument is used with table SETUP_OBJECTS.
560*/
562
563/**
564 Instrument controlling all table lock.
565 This instrument is used with table SETUP_OBJECTS.
566*/
568
569/**
570 Instrument controlling all idle waits.
571*/
573
574/**
575 Instrument controlling all metadata locks.
576*/
578
579/** Instrumentation metadata for an error. */
581/**
582 Instrument controlling all server errors.
583*/
585
586struct PFS_file;
587
588/** Instrumentation metadata for a file. */
590 /** File usage statistics. */
592 /** Singleton instance. */
594};
595
596/** Instrumentation metadata for a stage. */
598 /**
599 Length of the @c "stage/<component>/" prefix.
600 This is to extract @c "foo" from @c "stage/sql/foo".
601 */
603 /** Stage usage statistics. */
605};
606
607/** Instrumentation metadata for a statement. */
609
610/** Instrumentation metadata for a transaction. */
612
614
615struct PFS_socket;
616
617/** Instrumentation metadata for a socket. */
619 /** Socket usage statistics. */
621 /** Singleton instance. */
623};
624
625/** Instrumentation metadata for a memory. */
627
629
631
632int init_sync_class(uint mutex_class_sizing, uint rwlock_class_sizing,
633 uint cond_class_sizing);
634
635void cleanup_sync_class();
636int init_thread_class(uint thread_class_sizing);
638int init_table_share(uint table_share_sizing);
640
641int init_table_share_lock_stat(uint table_stat_sizing);
645
646int init_table_share_index_stat(uint index_stat_sizing);
649 uint index);
651
654int init_file_class(uint file_class_sizing);
655void cleanup_file_class();
656int init_stage_class(uint stage_class_sizing);
658int init_statement_class(uint statement_class_sizing);
660int init_socket_class(uint socket_class_sizing);
662int init_memory_class(uint memory_class_sizing);
664int init_metric_class(uint metric_class_sizing);
666int init_meter_class(uint meter_class_sizing);
668
669PFS_sync_key register_mutex_class(const char *name, uint name_length,
670 PSI_mutex_info *info);
671
672PFS_sync_key register_rwlock_class(const char *name, uint name_length,
673 PSI_rwlock_info *info);
674
675PFS_sync_key register_cond_class(const char *name, uint name_length,
676 PSI_cond_info *info);
677
678PFS_thread_key register_thread_class(const char *name, uint name_length,
679 PSI_thread_info *info);
680
681PFS_file_key register_file_class(const char *name, uint name_length,
682 PSI_file_info *info);
683
684PFS_stage_key register_stage_class(const char *name, uint prefix_length,
685 uint name_length, PSI_stage_info *info);
686
687PFS_statement_key register_statement_class(const char *name, uint name_length,
688 PSI_statement_info *info);
689
690PFS_socket_key register_socket_class(const char *name, uint name_length,
691 PSI_socket_info *info);
692
693PFS_memory_key register_memory_class(const char *name, uint name_length,
694 PSI_memory_info *info);
695
696PFS_meter_key register_meter_class(const char *name, uint name_length,
697 PSI_meter_info_v1 *info);
700PFS_metric_key register_metric_class(const char *name, uint name_length,
701 PSI_metric_info_v1 *info,
702 const char *meter);
705
734 PFS_transaction_class *unsafe);
739
741 const TABLE_SHARE *share);
743void drop_table_share(PFS_thread *thread, bool temporary,
744 const char *schema_name, uint schema_name_length,
745 const char *table_name, uint table_name_length);
746
748
749extern ulong mutex_class_max;
750extern ulong mutex_class_lost;
751extern ulong rwlock_class_max;
752extern ulong rwlock_class_lost;
753extern ulong cond_class_max;
754extern ulong cond_class_lost;
755extern ulong thread_class_max;
756extern ulong thread_class_lost;
757extern ulong file_class_max;
758extern ulong file_class_lost;
759extern ulong stage_class_max;
760extern ulong stage_class_lost;
761extern ulong statement_class_max;
762extern ulong statement_class_lost;
763extern ulong transaction_class_max;
764extern ulong socket_class_max;
765extern ulong socket_class_lost;
766extern ulong memory_class_max;
767extern ulong memory_class_lost;
768extern ulong meter_class_max;
769extern ulong meter_class_lost;
770extern ulong metric_class_max;
771extern ulong metric_class_lost;
772extern ulong error_class_max;
773
774/* Exposing the data directly, for iterators. */
775
782
786
787/** Update derived flags for all table shares. */
789
790/** Update derived flags for all stored procedure shares. */
792
794
795/**
796 Get current time for GTID monitoring.
797
798 @return Time in microseconds when PFS monitoring is enabled.
799 @return 0 when PFS monitoring is disabled.
800*/
802
803/** @} */
804#endif
Encapsulates the name of an instrumented entity.
Definition: pfs_instr_class.h:164
const char * m_private_old_name
Old instrument name, if any.
Definition: pfs_instr_class.h:184
terminology_use_previous::enum_compatibility_version m_private_version
The oldest version that uses the new name.
Definition: pfs_instr_class.h:188
uint m_private_old_name_length
Length in bytes of old instrument name len, if any.
Definition: pfs_instr_class.h:186
static constexpr uint max_length
Definition: pfs_instr_class.h:166
uint m_private_name_length
Length in bytes of m_name.
Definition: pfs_instr_class.h:182
A typesafe replacement for DYNAMIC_ARRAY.
Definition: prealloced_array.h:71
#define PSI_FLAG_SINGLETON
Singleton flag.
Definition: component_common.h:35
void release_table_share(TABLE_SHARE *share)
Mark that we are not using table share anymore.
Definition: sql_base.cc:1055
PFS_instr_class global_metadata_class
Instrument controlling all metadata locks.
Definition: pfs_instr_class.cc:192
LF_HASH table_share_hash
Hash index for instrumented table shares.
Definition: pfs_instr_class.cc:207
PFS_sync_key register_rwlock_class(const char *name, uint name_length, PSI_rwlock_info *info)
Register a rwlock instrumentation metadata.
Definition: pfs_instr_class.cc:1340
PFS_thread_class * sanitize_thread_class(PFS_thread_class *unsafe)
Definition: pfs_instr_class.cc:1578
uint socket_class_start
Definition: pfs_instr_class.cc:241
PFS_socket_class * sanitize_socket_class(PFS_socket_class *unsafe)
Definition: pfs_instr_class.cc:1828
unsigned int PFS_transaction_key
Key, naming a transaction instrument.
Definition: pfs_instr_class.h:103
PFS_rwlock_class * find_rwlock_class(PFS_sync_key key)
Find a rwlock instrumentation class by key.
Definition: pfs_instr_class.cc:1454
PFS_meter_key register_meter_class(const char *name, uint name_length, PSI_meter_info_v1 *info)
Register a meter instrumentation metadata.
Definition: pfs_instr_class.cc:1895
ulong error_class_max
Number of error classes.
Definition: pfs_instr_class.cc:164
PFS_socket_key register_socket_class(const char *name, uint name_length, PSI_socket_info *info)
Register a socket instrumentation metadata.
Definition: pfs_instr_class.cc:1784
ulong stage_class_max
Size of the stage class array.
Definition: pfs_instr_class.cc:128
PFS_stage_key register_stage_class(const char *name, uint prefix_length, uint name_length, PSI_stage_info *info)
Register a stage instrumentation metadata.
Definition: pfs_instr_class.cc:1633
unsigned int PFS_file_key
Key, naming a file instrument.
Definition: pfs_instr_class.h:97
void cleanup_memory_class()
Cleanup the memory class buffers.
Definition: pfs_instr_class.cc:1128
unsigned int PFS_sync_key
Key, naming a synch instrument (mutex, rwlock, cond).
Definition: pfs_instr_class.h:93
PFS_rwlock_class * rwlock_class_array
Definition: pfs_instr_class.cc:167
PFS_metric_class * metric_class_array
Definition: pfs_instr_class.cc:170
PFS_meter_class * sanitize_meter_class(PFS_meter_class *unsafe)
Definition: pfs_instr_class.cc:1485
void drop_table_share(PFS_thread *thread, bool temporary, const char *schema_name, uint schema_name_length, const char *table_name, uint table_name_length)
Drop the instrumented table share associated with a table.
Definition: pfs_instr_class.cc:2413
int init_table_share(uint table_share_sizing)
Initialize the table share buffer.
Definition: pfs_instr_class.cc:494
void cleanup_table_share_index_stat()
Cleanup the table stat buffers.
Definition: pfs_instr_class.cc:930
ulonglong gtid_monitoring_getsystime()
Get current time for GTID monitoring.
Definition: pfs_instr_class.cc:2515
PFS_instr_class global_table_lock_class
Instrument controlling all table lock.
Definition: pfs_instr_class.cc:190
uint mutex_class_start
Definition: pfs_instr_class.cc:236
PFS_instr_class global_idle_class
Instrument controlling all idle waits.
Definition: pfs_instr_class.cc:191
ulong thread_class_max
Size of the thread class array.
Definition: pfs_instr_class.cc:120
PFS_meter_class * find_meter_class(PSI_meter_key key)
Find a meter instrumentation class by key.
Definition: pfs_instr_class.cc:1481
ulong socket_class_lost
Number of socket class lost.
Definition: pfs_instr_class.cc:138
void cleanup_table_share_lock_stat()
Cleanup the table stat buffers.
Definition: pfs_instr_class.cc:872
PFS_table_share * find_or_create_table_share(PFS_thread *thread, bool temporary, const TABLE_SHARE *share)
Find or create a table share instrumentation.
Definition: pfs_instr_class.cc:2223
ulong meter_class_max
Size of the meter class array.
Definition: pfs_instr_class.cc:144
PFS_instr_class * find_metadata_class(uint index)
Definition: pfs_instr_class.cc:2144
uint sanitize_index_count(uint count)
Definition: pfs_instr_class.h:538
unsigned int PFS_meter_key
Key, naming a meter instrument.
Definition: pfs_instr_class.h:109
ulong socket_class_max
Size of the socket class array.
Definition: pfs_instr_class.cc:136
unsigned int PFS_socket_key
Key, naming a socket instrument.
Definition: pfs_instr_class.h:105
ulong rwlock_class_lost
Number of rwlock class lost.
Definition: pfs_instr_class.cc:114
void unregister_meter_class(PSI_meter_info_v1 *info)
Definition: pfs_instr_class.cc:1980
int init_table_share_lock_stat(uint table_stat_sizing)
Initialize the table lock stat buffer.
Definition: pfs_instr_class.cc:836
PFS_stage_class * sanitize_stage_class(PFS_stage_class *unsafe)
Definition: pfs_instr_class.cc:1758
PFS_cond_class * find_cond_class(PFS_sync_key key)
Find a condition instrumentation class by key.
Definition: pfs_instr_class.cc:1468
Prealloced_array< PFS_instr_config *, 10 > Pfs_instr_config_array
Definition: pfs_instr_class.h:149
int init_file_class(uint file_class_sizing)
Initialize the file class buffer.
Definition: pfs_instr_class.cc:939
uint length() const
Return the length of the string.
Definition: pfs_instr_class.cc:251
PFS_file_key register_file_class(const char *name, uint name_length, PSI_file_info *info)
Register a file instrumentation metadata.
Definition: pfs_instr_class.cc:1590
Pfs_instr_config_array * pfs_instr_config_array
PFS_INSTRUMENT option settings array.
Definition: pfs_instr_class.cc:81
uint32 metric_class_count()
Definition: pfs_instr_class.cc:2110
ulong memory_class_lost
Number of memory class lost.
Definition: pfs_instr_class.cc:142
ulong statement_class_lost
Number of statement class lost.
Definition: pfs_instr_class.cc:134
PFS_stage_class * find_stage_class(PFS_stage_key key)
Find a stage instrumentation class by key.
Definition: pfs_instr_class.cc:1754
uint cond_class_start
Definition: pfs_instr_class.cc:238
PFS_statement_class * find_statement_class(PFS_stage_key key)
Find a statement instrumentation class by key.
Definition: pfs_instr_class.cc:1768
ulong cond_class_max
Size of the condition class array.
Definition: pfs_instr_class.cc:116
ulong mutex_class_lost
Number of mutex class lost.
Definition: pfs_instr_class.cc:110
PFS_statement_class * sanitize_statement_class(PFS_statement_class *unsafe)
Definition: pfs_instr_class.cc:1772
unsigned int PFS_memory_key
Key, naming a memory instrument.
Definition: pfs_instr_class.h:107
PFS_table_lock_stat global_table_lock_stat
Statistics for dropped table lock.
Definition: pfs_instr_class.cc:185
void register_global_classes()
Definition: pfs_instr_class.cc:304
ulong memory_class_max
Size of the memory class array.
Definition: pfs_instr_class.cc:140
void cleanup_metric_class()
Cleanup the metric class buffers.
Definition: pfs_instr_class.cc:576
void reset_file_class_io()
Reset the I/O statistics per file class.
Definition: pfs_instr_class.cc:2458
uint wait_class_max
Definition: pfs_instr_class.cc:240
PFS_metric_class * sanitize_metric_class(PFS_metric_class *unsafe)
Definition: pfs_instr_class.cc:1499
PFS_table_share_lock * create_table_share_lock_stat()
Create a table share lock instrumentation.
Definition: pfs_instr_class.cc:848
PFS_transaction_class * find_transaction_class(uint index)
Definition: pfs_instr_class.cc:2172
PFS_statement_key register_statement_class(const char *name, uint name_length, PSI_statement_info *info)
Register a statement instrumentation metadata.
Definition: pfs_instr_class.cc:1684
void update_table_share_derived_flags(PFS_thread *thread)
Update derived flags for all table shares.
Definition: pfs_instr_class.cc:2491
void unregister_metric_class(PSI_metric_info_v1 *info)
Definition: pfs_instr_class.cc:2092
ulong stage_class_lost
Number of stage class lost.
Definition: pfs_instr_class.cc:130
PFS_metric_key register_metric_class(const char *name, uint name_length, PSI_metric_info_v1 *info, const char *meter)
Register a metric instrumentation metadata.
Definition: pfs_instr_class.cc:2008
PFS_thread_key register_thread_class(const char *name, uint name_length, PSI_thread_info *info)
Register a thread instrumentation metadata.
Definition: pfs_instr_class.cc:1511
void cleanup_stage_class()
Cleanup the stage class buffers.
Definition: pfs_instr_class.cc:1002
PFS_cond_class * sanitize_cond_class(PFS_cond_class *unsafe)
Definition: pfs_instr_class.cc:1472
PFS_instr_class * sanitize_idle_class(PFS_instr_class *unsafe)
Definition: pfs_instr_class.cc:2137
void cleanup_meter_class()
Cleanup the meter class buffers.
Definition: pfs_instr_class.cc:529
PFS_error_stat global_error_stat
Statistics for the error instrument.
Definition: pfs_instr_class.cc:188
PFS_thread_class * find_thread_class(PFS_sync_key key)
Find a thread instrumentation class by key.
Definition: pfs_instr_class.cc:1574
PFS_table_io_stat global_table_io_stat
Statistics for dropped table I/O.
Definition: pfs_instr_class.cc:184
PFS_sync_key register_cond_class(const char *name, uint name_length, PSI_cond_info *info)
Register a condition instrumentation metadata.
Definition: pfs_instr_class.cc:1388
PFS_instr_class * sanitize_metadata_class(PFS_instr_class *unsafe)
Definition: pfs_instr_class.cc:2151
PFS_mutex_class * sanitize_mutex_class(PFS_mutex_class *unsafe)
Definition: pfs_instr_class.cc:1444
PFS_error_class global_error_class
Instrument controlling all server errors.
Definition: pfs_instr_class.cc:193
uint file_class_start
Definition: pfs_instr_class.cc:239
PFS_transaction_stat global_transaction_stat
Statistics for the transaction instrument.
Definition: pfs_instr_class.cc:187
PFS_cond_class * cond_class_array
Definition: pfs_instr_class.cc:168
PFS_rwlock_class * sanitize_rwlock_class(PFS_rwlock_class *unsafe)
Definition: pfs_instr_class.cc:1458
ulong file_class_lost
Number of file class lost.
Definition: pfs_instr_class.cc:126
PFS_error_class * sanitize_error_class(PFS_instr_class *unsafe)
ulong metric_class_lost
Number of metric class lost.
Definition: pfs_instr_class.cc:150
int init_stage_class(uint stage_class_sizing)
Initialize the stage class buffer.
Definition: pfs_instr_class.cc:981
PFS_instr_class * find_idle_class(uint index)
Definition: pfs_instr_class.cc:2130
int init_thread_class(uint thread_class_sizing)
Initialize the thread class buffer.
Definition: pfs_instr_class.cc:451
PFS_metric_class * find_metric_class(PSI_metric_key key)
Find a metric instrumentation class by key.
Definition: pfs_instr_class.cc:1495
void init_event_name_sizing(const PFS_global_param *param)
Definition: pfs_instr_class.cc:294
int init_socket_class(uint socket_class_sizing)
Initialize the socket class buffer.
Definition: pfs_instr_class.cc:1065
PFS_socket_class * find_socket_class(PFS_socket_key key)
Find a socket instrumentation class by key.
Definition: pfs_instr_class.cc:1824
void update_program_share_derived_flags(PFS_thread *thread)
Update derived flags for all stored procedure shares.
Definition: pfs_instr_class.cc:2510
uint32 meter_class_count()
Definition: pfs_instr_class.cc:1998
PFS_error_class * find_error_class(uint index)
Definition: pfs_instr_class.cc:2158
PFS_file_class * sanitize_file_class(PFS_file_class *unsafe)
Definition: pfs_instr_class.cc:1745
unsigned int PFS_stage_key
Key, naming a stage instrument.
Definition: pfs_instr_class.h:99
std::atomic< uint32 > pfs_unload_plugin_ref_count
Global ref count for plugin and component events.
void cleanup_thread_class()
Cleanup the thread class buffers.
Definition: pfs_instr_class.cc:473
int init_statement_class(uint statement_class_sizing)
Initialize the statement class buffer.
Definition: pfs_instr_class.cc:1023
ulong file_class_max
Size of the file class array.
Definition: pfs_instr_class.cc:124
ulong thread_class_lost
Number of thread class lost.
Definition: pfs_instr_class.cc:122
ulong metric_class_max
Size of the metric class array.
Definition: pfs_instr_class.cc:148
void reset_events_waits_by_class()
Reset the wait statistics per instrument class.
Definition: pfs_instr_class.cc:2448
PFS_table_share * sanitize_table_share(PFS_table_share *unsafe)
Sanitize an unsafe table_share pointer.
Definition: pfs_instr_class.cc:2443
PFS_memory_key register_memory_class(const char *name, uint name_length, PSI_memory_info *info)
Register a memory instrumentation metadata.
Definition: pfs_instr_class.cc:1840
PFS_transaction_class global_transaction_class
Definition: pfs_instr_class.cc:194
unsigned int PFS_statement_key
Key, naming a statement instrument.
Definition: pfs_instr_class.h:101
unsigned int PFS_metric_key
Key, naming a metric instrument.
Definition: pfs_instr_class.h:111
PFS_single_stat global_idle_stat
Statistics for the IDLE instrument.
Definition: pfs_instr_class.cc:183
unsigned int PFS_thread_key
Key, naming a thread instrument.
Definition: pfs_instr_class.h:95
int init_table_share_index_stat(uint index_stat_sizing)
Initialize table index stat buffer.
Definition: pfs_instr_class.cc:881
PFS_sync_key register_mutex_class(const char *name, uint name_length, PSI_mutex_info *info)
Register a mutex instrumentation metadata.
Definition: pfs_instr_class.cc:1243
PFS_memory_class * sanitize_memory_class(PFS_memory_class *unsafe)
Definition: pfs_instr_class.cc:1883
void cleanup_file_class()
Cleanup the file class buffers.
Definition: pfs_instr_class.cc:960
bool pfs_enabled
Global performance schema flag.
Definition: pfs_instr_class.cc:69
uint rwlock_class_start
Definition: pfs_instr_class.cc:237
PFS_class_type
Definition: pfs_instr_class.h:113
ulong mutex_class_max
Size of the mutex class array.
Definition: pfs_instr_class.cc:108
int init_meter_class(uint meter_class_sizing)
Initialize the meter class buffer.
Definition: pfs_instr_class.cc:507
PFS_single_stat global_metadata_stat
Statistics for the METADATA instrument.
Definition: pfs_instr_class.cc:186
ulong statement_class_max
Size of the statement class array.
Definition: pfs_instr_class.cc:132
void cleanup_table_share_hash()
Cleanup the table share hash table.
Definition: pfs_instr_class.cc:674
ulong meter_class_lost
Number of meter class lost.
Definition: pfs_instr_class.cc:146
const char * str() const
Return the name as a string.
Definition: pfs_instr_class.cc:243
PFS_instr_class global_table_io_class
Instrument controlling all table I/O.
Definition: pfs_instr_class.cc:189
void reset_socket_class_io()
Reset the I/O statistics per socket class.
Definition: pfs_instr_class.cc:2468
PFS_instr_class * sanitize_table_class(PFS_instr_class *unsafe)
Definition: pfs_instr_class.cc:2122
int init_table_share_hash(const PFS_global_param *param)
Initialize the table share hash table.
Definition: pfs_instr_class.cc:663
void cleanup_table_share()
Cleanup the table share buffers.
Definition: pfs_instr_class.cc:593
ulong rwlock_class_max
Size of the rwlock class array.
Definition: pfs_instr_class.cc:112
int init_metric_class(uint metric_class_sizing)
Initialize the metric class buffer.
Definition: pfs_instr_class.cc:554
void cleanup_socket_class()
Cleanup the socket class buffers.
Definition: pfs_instr_class.cc:1086
void set(PFS_class_type class_type, const char *name, uint max_length_arg=max_length)
Copy the specified name to this name.
Definition: pfs_instr_class.cc:276
ulong cond_class_lost
Number of condition class lost.
Definition: pfs_instr_class.cc:118
PFS_memory_class * find_memory_class(PFS_memory_key key)
Find a memory instrumentation class by key.
Definition: pfs_instr_class.cc:1879
PFS_transaction_class * sanitize_transaction_class(PFS_transaction_class *unsafe)
Definition: pfs_instr_class.cc:2179
ulong transaction_class_max
Number of transaction classes.
Definition: pfs_instr_class.cc:157
void cleanup_sync_class()
Cleanup the instrument synch class buffers.
Definition: pfs_instr_class.cc:408
int init_memory_class(uint memory_class_sizing)
Initialize the memory class buffer.
Definition: pfs_instr_class.cc:1107
void release_table_share_lock_stat(PFS_table_share_lock *pfs)
Release a table share lock instrumentation.
Definition: pfs_instr_class.cc:866
PFS_meter_class * meter_class_array
Definition: pfs_instr_class.cc:169
void cleanup_statement_class()
Cleanup the statement class buffers.
Definition: pfs_instr_class.cc:1044
void release_table_share_index_stat(PFS_table_share_index *pfs)
Release a table share index instrumentation.
Definition: pfs_instr_class.cc:924
PFS_mutex_class * mutex_class_array
Definition: pfs_instr_class.cc:166
PFS_instr_class * find_table_class(uint index)
Definition: pfs_instr_class.cc:2112
PFS_table_share_index * create_table_share_index_stat(const TABLE_SHARE *server_share, uint server_index)
Create a table share index instrumentation.
Definition: pfs_instr_class.cc:893
int init_sync_class(uint mutex_class_sizing, uint rwlock_class_sizing, uint cond_class_sizing)
Initialize the instrument synch class buffers.
Definition: pfs_instr_class.cc:360
PFS_mutex_class * find_mutex_class(PFS_sync_key key)
Find a mutex instrumentation class by key.
Definition: pfs_instr_class.cc:1440
PFS_file_class * file_class_array
Definition: pfs_instr_class.cc:214
PFS_file_class * find_file_class(PFS_file_key key)
Find a file instrumentation class by key.
Definition: pfs_instr_class.cc:1741
@ PFS_CLASS_MAX
Definition: pfs_instr_class.h:134
@ PFS_CLASS_IDLE
Definition: pfs_instr_class.h:126
@ PFS_CLASS_LAST
Definition: pfs_instr_class.h:133
@ PFS_CLASS_MUTEX
Definition: pfs_instr_class.h:115
@ PFS_CLASS_STAGE
Definition: pfs_instr_class.h:120
@ PFS_CLASS_METER
Definition: pfs_instr_class.h:132
@ PFS_CLASS_NONE
Definition: pfs_instr_class.h:114
@ PFS_CLASS_TABLE
Definition: pfs_instr_class.h:119
@ PFS_CLASS_TABLE_LOCK
Definition: pfs_instr_class.h:125
@ PFS_CLASS_FILE
Definition: pfs_instr_class.h:118
@ PFS_CLASS_TABLE_IO
Definition: pfs_instr_class.h:124
@ PFS_CLASS_METADATA
Definition: pfs_instr_class.h:128
@ PFS_CLASS_RWLOCK
Definition: pfs_instr_class.h:116
@ PFS_CLASS_COND
Definition: pfs_instr_class.h:117
@ PFS_CLASS_MEMORY
Definition: pfs_instr_class.h:127
@ PFS_CLASS_THREAD
Definition: pfs_instr_class.h:130
@ PFS_CLASS_ERROR
Definition: pfs_instr_class.h:129
@ PFS_CLASS_STATEMENT
Definition: pfs_instr_class.h:121
@ PFS_CLASS_SOCKET
Definition: pfs_instr_class.h:123
@ PFS_CLASS_TRANSACTION
Definition: pfs_instr_class.h:122
@ PFS_CLASS_METRIC
Definition: pfs_instr_class.h:131
unsigned int PSI_cond_key
Instrumented cond key.
Definition: psi_cond_bits.h:44
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:48
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:49
unsigned int PSI_mutex_key
Instrumented mutex key.
Definition: psi_mutex_bits.h:52
unsigned int PSI_rwlock_key
Instrumented rwlock key.
Definition: psi_rwlock_bits.h:44
unsigned int PSI_socket_key
Instrumented socket key.
Definition: psi_socket_bits.h:49
unsigned int PSI_stage_key
Instrumented stage key.
Definition: psi_stage_bits.h:43
unsigned int PSI_statement_key
Instrumented statement key.
Definition: psi_statement_bits.h:49
unsigned int PSI_thread_key
Instrumented thread key.
Definition: psi_thread_bits.h:50
#define PSI_FLAG_USER
User flag.
Definition: psi_bits.h:103
#define PSI_FLAG_TRANSFER
Transferable flag.
Definition: psi_bits.h:95
#define PSI_FLAG_DISABLED
Instrument is disabled by default.
Definition: psi_bits.h:146
#define PSI_FLAG_MUTABLE
Mutable flag.
Definition: psi_bits.h:68
#define PSI_FLAG_STAGE_PROGRESS
Stage progress flag.
Definition: psi_bits.h:82
#define PSI_FLAG_RWLOCK_SX
Shared Exclusive flag.
Definition: psi_bits.h:88
#define PSI_FLAG_UNTIMED
Instrument is not timed by default.
Definition: psi_bits.h:151
#define PSI_FLAG_NO_SEQNUM
No sequence number flag.
Definition: psi_bits.h:136
#define PSI_FLAG_THREAD
Per Thread flag.
Definition: psi_bits.h:75
#define PSI_FLAG_AUTO_SEQNUM
Automatic sequence number flag.
Definition: psi_bits.h:130
#define PSI_FLAG_MEM_COLLECT
Enable collecting the memory consumed by threads.
Definition: psi_bits.h:141
#define PSI_FLAG_THREAD_SYSTEM
System thread flag.
Definition: psi_bits.h:124
#define PSI_FLAG_RWLOCK_PR
Priority lock flag.
Definition: psi_bits.h:118
#define PSI_FLAG_ONLY_GLOBAL_STAT
Global stat only flag.
Definition: psi_bits.h:112
static int flags[50]
Definition: hp_test1.cc:40
#define MAX_INDEXES
Definition: config.h:210
Header for compiler-dependent features.
constexpr bool likely(bool expr)
Definition: my_compiler.h:57
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint32_t uint32
Definition: my_inttypes.h:67
static int count
Definition: myisam_ftdump.cc:45
Common definition between mysql server & client.
#define NAME_LEN
Definition: mysql_com.h:67
const char * table_name
Definition: rules_table_service.cc:56
enum_compatibility_version
Enumeration holding the possible values for @terminology_use_previous.
Definition: terminology_use_previous_enum.h:48
Data types for columns used in the performance schema tables (declarations)
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:222
Miscellaneous global dependencies (declarations).
#define PFS_ALIGNED
Definition: pfs_global.h:57
#define PFS_MAX_OS_NAME_LENGTH
Maximum length of the thread os name.
Definition: pfs_instr_class.h:67
#define PFS_MAX_INFO_NAME_LENGTH
Maximum length of an instrument name.
Definition: pfs_instr_class.h:59
Performance schema internal locks (declarations).
Object names (declarations).
Statistics (declarations).
MetricOTELType
Definition: psi_metric_bits.h:32
unsigned int PSI_meter_key
Definition: psi_metric_bits.h:101
MetricNumType
Definition: psi_metric_bits.h:38
unsigned int PSI_metric_key
Definition: psi_metric_bits.h:102
void(* measurement_callback_t)(void *measurement_context, measurement_delivery_callback_t delivery, void *delivery_context)
Single metric measurement callback can return multiple measurement values.
Definition: psi_metric_bits.h:97
required string key
Definition: replication_asynchronous_connection_failover.proto:60
required bool enabled
Definition: replication_group_member_actions.proto:33
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
case opt name
Definition: sslopt-case.h:29
Definition: lf.h:187
Instrumentation metadata for a condition.
Definition: pfs_instr_class.h:349
PFS_cond_stat m_cond_stat
Condition usage statistics.
Definition: pfs_instr_class.h:354
PFS_cond * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:356
Statistics for conditions usage.
Definition: pfs_stat.h:238
Instrumented condition implementation.
Definition: pfs_instr.h:162
Instrumentation metadata for an error.
Definition: pfs_instr_class.h:580
Statistics for all server errors.
Definition: pfs_stat.h:557
Instrumentation metadata for a file.
Definition: pfs_instr_class.h:589
PFS_file * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:593
PFS_file_stat m_file_stat
File usage statistics.
Definition: pfs_instr_class.h:591
Statistics for FILE usage.
Definition: pfs_stat.h:308
Instrumented File and FILE implementation.
Definition: pfs_instr.h:179
Performance schema global sizing parameters.
Definition: pfs_server.h:119
Information for all instrumentation.
Definition: pfs_instr_class.h:212
bool is_deferred() const
Definition: pfs_instr_class.h:292
bool m_enabled
True if this instrument is enabled.
Definition: pfs_instr_class.h:216
static void set_enabled(PFS_instr_class *pfs, bool enabled)
uint m_flags
Instrument flags.
Definition: pfs_instr_class.h:220
bool is_untimed() const
Definition: pfs_instr_class.h:271
bool is_singleton() const
Definition: pfs_instr_class.h:239
PFS_class_type m_type
Class type.
Definition: pfs_instr_class.h:214
bool is_priority() const
Definition: pfs_instr_class.h:247
static void set_timed(PFS_instr_class *pfs, bool timed)
void set_enforced_flags(uint flags)
Definition: pfs_instr_class.h:273
bool is_progress() const
Definition: pfs_instr_class.h:243
bool can_be_timed() const
Definition: pfs_instr_class.h:303
bool is_transferable() const
Definition: pfs_instr_class.h:249
bool has_enforced_memory_cnt() const
Definition: pfs_instr_class.h:265
PFS_instr_name m_name
Instrument name.
Definition: pfs_instr_class.h:235
bool has_default_memory_cnt() const
Definition: pfs_instr_class.h:263
uint m_event_name_index
Instrument name index.
Definition: pfs_instr_class.h:233
bool has_auto_seqnum() const
Definition: pfs_instr_class.h:261
bool is_disabled() const
Definition: pfs_instr_class.h:269
bool m_timed
True if this instrument is timed.
Definition: pfs_instr_class.h:218
bool can_be_enforced() const
Definition: pfs_instr_class.h:314
bool is_global() const
Definition: pfs_instr_class.h:255
char * m_documentation
Documentation.
Definition: pfs_instr_class.h:237
bool is_user() const
Definition: pfs_instr_class.h:251
uint m_enforced_flags
Instrument enforced flags.
Definition: pfs_instr_class.h:222
bool is_mutable() const
Definition: pfs_instr_class.h:241
bool is_shared_exclusive() const
Definition: pfs_instr_class.h:245
int m_volatility
Volatility index.
Definition: pfs_instr_class.h:224
void enforce_valid_flags(uint allowed_flags)
Definition: pfs_instr_class.h:275
bool is_system_thread() const
Definition: pfs_instr_class.h:253
bool has_seqnum() const
Definition: pfs_instr_class.h:257
User-defined instrument configuration.
Definition: pfs_instr_class.h:138
uint m_name_length
Definition: pfs_instr_class.h:142
bool m_enabled
Enabled flag.
Definition: pfs_instr_class.h:144
bool m_timed
Timed flag.
Definition: pfs_instr_class.h:146
char * m_name
Definition: pfs_instr_class.h:140
Instrumentation metadata for a memory.
Definition: pfs_instr_class.h:626
Instrumentation metadata for a meter.
Definition: pfs_instr_class.h:395
uint m_description_length
Definition: pfs_instr_class.h:405
uint m_metrics_size
Definition: pfs_instr_class.h:410
uint m_meter_length
Definition: pfs_instr_class.h:400
const char * m_description
Meter description with length.
Definition: pfs_instr_class.h:404
PSI_metric_key * m_metrics
Metrics belonging to this meter.
Definition: pfs_instr_class.h:409
PSI_meter_key m_key
Definition: pfs_instr_class.h:406
pfs_lock m_lock
Definition: pfs_instr_class.h:396
const char * m_meter
Meter name with length.
Definition: pfs_instr_class.h:399
uint m_frequency
Meter export frequency in seconds.
Definition: pfs_instr_class.h:402
Instrumentation metadata for a metric.
Definition: pfs_instr_class.h:372
const char * m_group
Metric group with length.
Definition: pfs_instr_class.h:379
uint m_description_length
Definition: pfs_instr_class.h:386
uint m_group_length
Definition: pfs_instr_class.h:380
MetricNumType m_num_type
Definition: pfs_instr_class.h:387
PSI_metric_key m_key
Definition: pfs_instr_class.h:389
const char * m_description
Metric description with length.
Definition: pfs_instr_class.h:385
uint m_metric_length
Definition: pfs_instr_class.h:377
measurement_callback_t m_measurement_callback
Definition: pfs_instr_class.h:390
MetricOTELType m_metric_type
Definition: pfs_instr_class.h:388
uint m_unit_length
Definition: pfs_instr_class.h:383
pfs_lock m_lock
Definition: pfs_instr_class.h:373
const char * m_unit
Metric unit with length.
Definition: pfs_instr_class.h:382
void * m_measurement_context
Definition: pfs_instr_class.h:391
const char * m_metric
Metric name with length.
Definition: pfs_instr_class.h:376
Instrumentation metadata for a mutex.
Definition: pfs_instr_class.h:329
PFS_mutex_stat m_mutex_stat
Mutex usage statistics.
Definition: pfs_instr_class.h:331
PFS_mutex * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:333
Statistics for mutex usage.
Definition: pfs_stat.h:177
Instrumented mutex implementation.
Definition: pfs_instr.h:103
Instrumentation metadata for a read write lock.
Definition: pfs_instr_class.h:339
PFS_rwlock * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:343
PFS_rwlock_stat m_rwlock_stat
Rwlock usage statistics.
Definition: pfs_instr_class.h:341
Statistics for rwlock usage.
Definition: pfs_stat.h:204
Instrumented rwlock implementation.
Definition: pfs_instr.h:129
Definition: pfs_name.h:188
Single statistic.
Definition: pfs_stat.h:52
Instrumentation metadata for a socket.
Definition: pfs_instr_class.h:618
PFS_socket_stat m_socket_stat
Socket usage statistics.
Definition: pfs_instr_class.h:620
PFS_socket * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:622
Statistics for SOCKET usage.
Definition: pfs_stat.h:875
Instrumented socket implementation.
Definition: pfs_instr.h:289
Instrumentation metadata for a stage.
Definition: pfs_instr_class.h:597
uint m_prefix_length
Length of the "stage/<component>/" prefix.
Definition: pfs_instr_class.h:602
PFS_stage_stat m_stage_stat
Stage usage statistics.
Definition: pfs_instr_class.h:604
Statistics for stage usage.
Definition: pfs_stat.h:323
Instrumentation metadata for a statement.
Definition: pfs_instr_class.h:608
Single table I/O statistic.
Definition: pfs_stat.h:648
Table index or 'key'.
Definition: pfs_instr_class.h:426
uint m_name_length
Length in bytes of m_name.
Definition: pfs_instr_class.h:430
char m_name[NAME_LEN]
Index name.
Definition: pfs_instr_class.h:428
Statistics for table locks.
Definition: pfs_stat.h:710
Definition: pfs_name.h:236
Index statistics of a table.
Definition: pfs_instr_class.h:434
PFS_table_key m_key
The index name.
Definition: pfs_instr_class.h:437
PFS_table_io_stat m_stat
The index stat.
Definition: pfs_instr_class.h:439
pfs_lock m_lock
Definition: pfs_instr_class.h:435
PFS_table_share * m_owner
Owner table share.
Definition: pfs_instr_class.h:441
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr_class.h:443
Key identifying a table share.
Definition: pfs_instr_class.h:414
PFS_schema_name m_schema_name
Table schema.
Definition: pfs_instr_class.h:419
PFS_table_name m_table_name
Table name.
Definition: pfs_instr_class.h:422
enum_object_type m_type
Object type.
Definition: pfs_instr_class.h:416
Lock statistics of a table.
Definition: pfs_instr_class.h:447
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr_class.h:454
pfs_lock m_lock
Definition: pfs_instr_class.h:448
PFS_table_share * m_owner
Owner table share.
Definition: pfs_instr_class.h:452
PFS_table_lock_stat m_stat
Lock stats.
Definition: pfs_instr_class.h:450
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:458
PFS_table_share_key m_key
Search key.
Definition: pfs_instr_class.h:500
std::atomic< PFS_table_share_lock * > m_race_lock_stat
Table locks statistics.
Definition: pfs_instr_class.h:520
uint32 get_version()
Definition: pfs_instr_class.h:460
enum_object_type get_object_type() const
Definition: pfs_instr_class.h:462
bool m_timed
True if table instrumentation is timed.
Definition: pfs_instr_class.h:497
bool m_enabled
True if table instrumentation is enabled.
Definition: pfs_instr_class.h:492
void inc_refcount()
Definition: pfs_instr_class.h:480
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr_class.h:505
void aggregate()
Definition: pfs_instr_class.h:471
int get_refcount()
Definition: pfs_instr_class.h:478
void init_refcount()
Definition: pfs_instr_class.h:476
std::atomic< int > m_refcount
Number of opened table handles.
Definition: pfs_instr_class.h:518
uint m_key_count
Number of indexes.
Definition: pfs_instr_class.h:503
void dec_refcount()
Definition: pfs_instr_class.h:482
pfs_lock m_lock
Internal lock.
Definition: pfs_instr_class.h:487
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:360
PFS_thread * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:362
std::atomic< unsigned int > m_seqnum
Thread instance sequence number counter.
Definition: pfs_instr_class.h:368
Instrumented thread implementation.
Definition: pfs_instr.h:375
Instrumentation metadata for a transaction.
Definition: pfs_instr_class.h:611
Statistics for transaction usage.
Definition: pfs_stat.h:459
Condition information.
Definition: psi_cond_bits.h:88
File instrument information.
Definition: psi_file_bits.h:114
Memory instrument information.
Definition: psi_memory_bits.h:58
Define a meter source, storing char pointers requires the original strings to be valid for entire lif...
Definition: psi_metric_bits.h:143
Define a metric source, storing char pointers requires the original strings to be valid for entire li...
Definition: psi_metric_bits.h:124
Mutex information.
Definition: psi_mutex_bits.h:73
Rwlock information.
Definition: psi_rwlock_bits.h:162
Socket instrument information.
Definition: psi_socket_bits.h:128
Stage instrument information.
Definition: psi_stage_bits.h:74
Statement instrument information.
Definition: psi_statement_bits.h:133
Thread instrument information.
Definition: psi_thread_bits.h:117
This structure is shared between different table objects.
Definition: table.h:700
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:154
Definition: result.h:30