24#ifndef PFS_INSTR_CLASS_H
25#define PFS_INSTR_CLASS_H
38#include "mysqld_error.h"
58#define PFS_MAX_INFO_NAME_LENGTH 128
66#define PFS_MAX_OS_NAME_LENGTH 16
75#define PFS_MAX_FULL_PREFIX_NAME_LENGTH 32
79class PFS_opaque_container_page;
185 const char *
str()
const;
278 assert(valid_flags ==
m_flags);
319#define PFS_MUTEX_PARTITIONS 2
357 bool m_history{
false};
416 void aggregate_lock();
435 void refresh_setup_object_flags(
PFS_thread *thread);
460 void destroy_lock_stat();
465 void destroy_index_stats();
473 std::atomic<PFS_table_share_index *> m_race_index_stat[
MAX_INDEXES + 1];
496#define GLOBAL_TABLE_IO_EVENT_INDEX 0
497#define GLOBAL_TABLE_LOCK_EVENT_INDEX 1
498#define GLOBAL_IDLE_EVENT_INDEX 2
499#define GLOBAL_METADATA_EVENT_INDEX 3
501#define COUNT_GLOBAL_EVENT_INDEX 4
504#define GLOBAL_TRANSACTION_INDEX 0
506#define GLOBAL_ERROR_INDEX 0
584 uint cond_class_sizing);
677 const char *schema_name,
uint schema_name_length,
Encapsulates the name of an instrumented entity.
Definition: pfs_instr_class.h:157
const char * m_private_old_name
Old instrument name, if any.
Definition: pfs_instr_class.h:177
terminology_use_previous::enum_compatibility_version m_private_version
The oldest version that uses the new name.
Definition: pfs_instr_class.h:181
uint m_private_old_name_length
Length in bytes of old instrument name len, if any.
Definition: pfs_instr_class.h:179
static constexpr uint max_length
Definition: pfs_instr_class.h:159
uint m_private_name_length
Length in bytes of m_name.
Definition: pfs_instr_class.h:175
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:982
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:55
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:43
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:66
#define PFS_MAX_INFO_NAME_LENGTH
Maximum length of an instrument name.
Definition: pfs_instr_class.h:58
Performance schema internal locks (declarations).
Object names (declarations).
Statistics (declarations).
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:33
Instrumentation metadata for a condition.
Definition: pfs_instr_class.h:342
PFS_cond_stat m_cond_stat
Condition usage statistics.
Definition: pfs_instr_class.h:347
PFS_cond * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:349
Statistics for conditions usage.
Definition: pfs_stat.h:238
Instrumented condition implementation.
Definition: pfs_instr.h:160
Instrumentation metadata for an error.
Definition: pfs_instr_class.h:531
Statistics for all server errors.
Definition: pfs_stat.h:557
Instrumentation metadata for a file.
Definition: pfs_instr_class.h:540
PFS_file * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:544
PFS_file_stat m_file_stat
File usage statistics.
Definition: pfs_instr_class.h:542
Statistics for FILE usage.
Definition: pfs_stat.h:308
Instrumented File and FILE implementation.
Definition: pfs_instr.h:177
Performance schema global sizing parameters.
Definition: pfs_server.h:113
Information for all instrumentation.
Definition: pfs_instr_class.h:205
bool is_deferred() const
Definition: pfs_instr_class.h:285
bool m_enabled
True if this instrument is enabled.
Definition: pfs_instr_class.h:209
static void set_enabled(PFS_instr_class *pfs, bool enabled)
uint m_flags
Instrument flags.
Definition: pfs_instr_class.h:213
bool is_untimed() const
Definition: pfs_instr_class.h:264
bool is_singleton() const
Definition: pfs_instr_class.h:232
PFS_class_type m_type
Class type.
Definition: pfs_instr_class.h:207
bool is_priority() const
Definition: pfs_instr_class.h:240
static void set_timed(PFS_instr_class *pfs, bool timed)
void set_enforced_flags(uint flags)
Definition: pfs_instr_class.h:266
bool is_progress() const
Definition: pfs_instr_class.h:236
bool can_be_timed() const
Definition: pfs_instr_class.h:296
bool is_transferable() const
Definition: pfs_instr_class.h:242
bool has_enforced_memory_cnt() const
Definition: pfs_instr_class.h:258
PFS_instr_name m_name
Instrument name.
Definition: pfs_instr_class.h:228
bool has_default_memory_cnt() const
Definition: pfs_instr_class.h:256
uint m_event_name_index
Instrument name index.
Definition: pfs_instr_class.h:226
bool has_auto_seqnum() const
Definition: pfs_instr_class.h:254
bool is_disabled() const
Definition: pfs_instr_class.h:262
bool m_timed
True if this instrument is timed.
Definition: pfs_instr_class.h:211
bool can_be_enforced() const
Definition: pfs_instr_class.h:307
bool is_global() const
Definition: pfs_instr_class.h:248
char * m_documentation
Documentation.
Definition: pfs_instr_class.h:230
bool is_user() const
Definition: pfs_instr_class.h:244
uint m_enforced_flags
Instrument enforced flags.
Definition: pfs_instr_class.h:215
bool is_mutable() const
Definition: pfs_instr_class.h:234
bool is_shared_exclusive() const
Definition: pfs_instr_class.h:238
int m_volatility
Volatility index.
Definition: pfs_instr_class.h:217
void enforce_valid_flags(uint allowed_flags)
Definition: pfs_instr_class.h:268
bool is_system_thread() const
Definition: pfs_instr_class.h:246
bool has_seqnum() const
Definition: pfs_instr_class.h:250
User-defined instrument configuration.
Definition: pfs_instr_class.h:131
uint m_name_length
Definition: pfs_instr_class.h:135
bool m_enabled
Enabled flag.
Definition: pfs_instr_class.h:137
bool m_timed
Timed flag.
Definition: pfs_instr_class.h:139
char * m_name
Definition: pfs_instr_class.h:133
Instrumentation metadata for a memory.
Definition: pfs_instr_class.h:577
Instrumentation metadata for a mutex.
Definition: pfs_instr_class.h:322
PFS_mutex_stat m_mutex_stat
Mutex usage statistics.
Definition: pfs_instr_class.h:324
PFS_mutex * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:326
Statistics for mutex usage.
Definition: pfs_stat.h:177
Instrumented mutex implementation.
Definition: pfs_instr.h:101
Instrumentation metadata for a read write lock.
Definition: pfs_instr_class.h:332
PFS_rwlock * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:336
PFS_rwlock_stat m_rwlock_stat
Rwlock usage statistics.
Definition: pfs_instr_class.h:334
Statistics for rwlock usage.
Definition: pfs_stat.h:204
Instrumented rwlock implementation.
Definition: pfs_instr.h:127
Definition: pfs_name.h:186
Single statistic.
Definition: pfs_stat.h:52
Instrumentation metadata for a socket.
Definition: pfs_instr_class.h:569
PFS_socket_stat m_socket_stat
Socket usage statistics.
Definition: pfs_instr_class.h:571
PFS_socket * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:573
Statistics for SOCKET usage.
Definition: pfs_stat.h:875
Instrumented socket implementation.
Definition: pfs_instr.h:287
Instrumentation metadata for a stage.
Definition: pfs_instr_class.h:548
uint m_prefix_length
Length of the "stage/<component>/" prefix.
Definition: pfs_instr_class.h:553
PFS_stage_stat m_stage_stat
Stage usage statistics.
Definition: pfs_instr_class.h:555
Statistics for stage usage.
Definition: pfs_stat.h:323
Instrumentation metadata for a statement.
Definition: pfs_instr_class.h:559
Single table I/O statistic.
Definition: pfs_stat.h:648
Table index or 'key'.
Definition: pfs_instr_class.h:377
uint m_name_length
Length in bytes of m_name.
Definition: pfs_instr_class.h:381
char m_name[NAME_LEN]
Index name.
Definition: pfs_instr_class.h:379
Statistics for table locks.
Definition: pfs_stat.h:710
Definition: pfs_name.h:234
Index statistics of a table.
Definition: pfs_instr_class.h:385
PFS_table_key m_key
The index name.
Definition: pfs_instr_class.h:388
PFS_table_io_stat m_stat
The index stat.
Definition: pfs_instr_class.h:390
pfs_lock m_lock
Definition: pfs_instr_class.h:386
PFS_table_share * m_owner
Owner table share.
Definition: pfs_instr_class.h:392
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr_class.h:394
Key identifying a table share.
Definition: pfs_instr_class.h:365
PFS_schema_name m_schema_name
Table schema.
Definition: pfs_instr_class.h:370
PFS_table_name m_table_name
Table name.
Definition: pfs_instr_class.h:373
enum_object_type m_type
Object type.
Definition: pfs_instr_class.h:367
Lock statistics of a table.
Definition: pfs_instr_class.h:398
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr_class.h:405
pfs_lock m_lock
Definition: pfs_instr_class.h:399
PFS_table_share * m_owner
Owner table share.
Definition: pfs_instr_class.h:403
PFS_table_lock_stat m_stat
Lock stats.
Definition: pfs_instr_class.h:401
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:409
PFS_table_share_key m_key
Search key.
Definition: pfs_instr_class.h:451
std::atomic< PFS_table_share_lock * > m_race_lock_stat
Table locks statistics.
Definition: pfs_instr_class.h:471
uint32 get_version()
Definition: pfs_instr_class.h:411
enum_object_type get_object_type() const
Definition: pfs_instr_class.h:413
bool m_timed
True if table instrumentation is timed.
Definition: pfs_instr_class.h:448
bool m_enabled
True if table instrumentation is enabled.
Definition: pfs_instr_class.h:443
void inc_refcount()
Definition: pfs_instr_class.h:431
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr_class.h:456
void aggregate()
Definition: pfs_instr_class.h:422
int get_refcount()
Definition: pfs_instr_class.h:429
void init_refcount()
Definition: pfs_instr_class.h:427
std::atomic< int > m_refcount
Number of opened table handles.
Definition: pfs_instr_class.h:469
uint m_key_count
Number of indexes.
Definition: pfs_instr_class.h:454
void dec_refcount()
Definition: pfs_instr_class.h:433
pfs_lock m_lock
Internal lock.
Definition: pfs_instr_class.h:438
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:353
PFS_thread * m_singleton
Singleton instance.
Definition: pfs_instr_class.h:355
std::atomic< unsigned int > m_seqnum
Thread instance sequence number counter.
Definition: pfs_instr_class.h:361
Instrumented thread implementation.
Definition: pfs_instr.h:373
Instrumentation metadata for a transaction.
Definition: pfs_instr_class.h:562
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
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:690
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:154
unsigned int uint
Definition: uca9-dump.cc:75