MySQL 26.7.0
Source Code Documentation
psi.h
Go to the documentation of this file.
1// Copyright (c) 2026, Oracle and/or its affiliates.
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License, version 2.0,
5// as published by the Free Software Foundation.
6//
7// This program is designed to work with certain software (including
8// but not limited to OpenSSL) that is licensed under separate terms,
9// as designated in a particular file or component or in included license
10// documentation. The authors of MySQL hereby grant you an additional
11// permission to link the program and your derivative works with the
12// separately licensed software that they have either included with
13// the program or referenced in the documentation.
14//
15// This program is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License, version 2.0, for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with this program; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23
24#ifndef MYSQL_CSA_SERVICE_PSI_H
25#define MYSQL_CSA_SERVICE_PSI_H
26
33
34namespace mysql::csa {
35
36/// @brief PSI rwlock key for module locking.
38
39/// @name Mutex Keys
40/// @{
41/// @brief PSI mutex key for scheduler.
43/// @brief PSI mutex key for module.
45
46/// @brief PSI mutex key for CSA scheduler main.
48/// @brief PSI mutex key for CSA scheduler end.
50/// @brief PSI mutex key for CSA scheduler tasks.
52/// @brief PSI mutex key for CSA scheduler phases.
54
55/// @brief PSI mutex key for CSA session service entry.
57
58/// @brief PSI mutex key for CSA prefetcher wait.
60/// @brief PSI mutex key for CSA prefetcher file move.
62/// @}
63
64/// @name Condition Variable Keys
65/// @{
66/// @brief PSI cond key for CSA scheduler main.
68/// @brief PSI cond key for CSA scheduler end.
70/// @brief PSI cond key for CSA prefetcher wait.
72/// @brief PSI cond key for CSA prefetcher file move.
74/// @}
75
76/// Initializes PSI condition variable keys for MTA.
78
79/// @name Thread Keys
80/// @{
81/// @brief PSI thread key for worker threads.
83/// @brief PSI thread key for scheduler threads.
85/// @brief PSI thread key for prefetcher threads.
87/// @brief PSI thread key for prefetcher threads.
89/// @}
90
91/// @name Memory Keys
92/// @{
93/// @brief PSI memory key for CSA prefetcher.
95/// @brief PSI memory key for CSA THP.
97/// @brief PSI memory key for CSA provider.
99/// @brief PSI memory key for CSA session service.
101/// @brief PSI memory key for CSA scheduler.
103/// @brief PSI memory key for decompressing stream.
105/// @}
106
107/// @name Stage Information
108/// @{
109/// @brief Stage for CSA session attached.
111/// @brief Stage for CSA session detached.
113
114/// @brief Stage for CSA starting.
116/// @brief Stage for CSA working.
118/// @brief Stage for CSA wait for transaction.
120/// @brief Stage for CSA update statistics.
122/// @brief Stage for CSA enqueue transaction.
124/// @brief Stage for CSA stopping.
126/// @brief Stage for CSA stopped.
128
129/// @brief Stage for CSA job apply.
131/// @brief Stage for CSA session acquire.
133/// @brief Stage for CSA job attach.
135/// @brief Stage for CSA job detach.
137/// @brief Stage for CSA session release.
139
140/// @brief Stage for CSA clock add.
142/// @brief Stage for CSA clock tick.
144
145/// @brief Stage for CSA dependency register.
147/// @brief Stage for CSA dependency add.
149/// @brief Stage for CSA dependency task done.
151
152/// @brief Stage for CSA scheduler stopping.
154/// @brief Stage for CSA scheduler stopped.
156/// @brief Stage for CSA scheduler wait for work.
158/// @brief Stage for CSA scheduler check dependencies.
160/// @brief Stage for CSA scheduler check stage queues.
162/// @brief Stage for CSA scheduler enqueue ready tasks.
164/// @brief Stage for CSA scheduler sync clock.
166/// @brief Stage for CSA scheduler sync limit.
168
169/// @brief Stage for CSA THP worker wait.
171/// @brief Stage for CSA THP worker exec.
173/// @brief Stage for CSA THP worker stop.
175/// @}
176
177/// @brief Initializes PSI keys for CSA.
178void init_csa_psi();
179
180} // namespace mysql::csa
181
182#endif // MYSQL_CSA_SERVICE_PSI_H
unsigned int PSI_cond_key
Instrumented cond key.
Definition: psi_cond_bits.h:44
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_thread_key
Instrumented thread key.
Definition: psi_thread_bits.h:50
Definition: channel.cpp:28
PSI_stage_info stage_csa_sched_wait_for_work
Stage for CSA scheduler wait for work.
Definition: psi.cc:224
PSI_mutex_key key_mt_csa_session_service_entry
PSI mutex key for CSA session service entry.
Definition: psi.cc:64
PSI_stage_info stage_csa_enqueue_transaction
Stage for CSA enqueue transaction.
Definition: psi.cc:191
PSI_mutex_key key_mt_csa_sched_phases
PSI mutex key for CSA scheduler phases.
Definition: psi.cc:63
PSI_memory_key key_mem_csa_session_service
PSI memory key for CSA session service.
Definition: psi.cc:149
PSI_stage_info stage_csa_update_statistics
Stage for CSA update statistics.
Definition: psi.cc:189
PSI_stage_info stage_csa_clock_add
Stage for CSA clock add.
Definition: psi.cc:208
PSI_stage_info stage_csa_stopping
Stage for CSA stopping.
Definition: psi.cc:193
PSI_stage_info stage_csa_thp_worker_stop
Stage for CSA THP worker stop.
Definition: psi.cc:241
PSI_stage_info stage_csa_session_release
Stage for CSA session release.
Definition: psi.cc:205
PSI_stage_info stage_csa_working
Stage for CSA working.
Definition: psi.cc:185
PSI_mutex_key key_mutex_scheduler
Definition: psi.cc:57
PSI_stage_info stage_csa_thp_worker_exec
Stage for CSA THP worker exec.
Definition: psi.cc:239
PSI_mutex_key key_mt_csa_sched_tasks
PSI mutex key for CSA scheduler tasks.
Definition: psi.cc:62
PSI_memory_key key_decompressing_stream
PSI memory key for decompressing stream.
Definition: psi.cc:151
PSI_stage_info stage_csa_session_detached
Stage for CSA session detached.
Definition: psi.cc:180
PSI_thread_key key_thread_scheduler
PSI thread key for scheduler threads.
Definition: psi.cc:123
PSI_stage_info stage_csa_sched_enqueue_ready_tasks
Stage for CSA scheduler enqueue ready tasks.
Definition: psi.cc:230
PSI_mutex_key key_mt_csa_prefetcher_wait
PSI mutex key for CSA prefetcher wait.
Definition: psi.cc:65
PSI_memory_key key_mem_csa_prefetcher
Definition: psi.cc:146
PSI_stage_info stage_csa_thp_worker_wait
Stage for CSA THP worker wait.
Definition: psi.cc:237
PSI_thread_key key_thread_worker
Definition: psi.cc:122
PSI_cond_key key_cv_csa_prefetcher_file_move
PSI cond key for CSA prefetcher file move.
Definition: psi.cc:100
PSI_stage_info stage_csa_clock_tick
Stage for CSA clock tick.
Definition: psi.cc:210
void init_csa_psi(void)
Initializes PSI keys for CSA.
Definition: psi.cc:284
PSI_stage_info stage_csa_sched_sync_clock
Stage for CSA scheduler sync clock.
Definition: psi.cc:232
void init_mta_psi_cond_keys()
Initializes PSI condition variable keys for MTA.
PSI_stage_info stage_csa_job_apply
Stage for CSA job apply.
Definition: psi.cc:198
PSI_mutex_key key_mt_csa_prefetcher_file_move
PSI mutex key for CSA prefetcher file move.
Definition: psi.cc:66
PSI_cond_key key_cv_csa_sched_end
PSI cond key for CSA scheduler end.
Definition: psi.cc:98
PSI_stage_info stage_csa_dep_task_done
Stage for CSA dependency task done.
Definition: psi.cc:217
PSI_stage_info stage_csa_job_detach
Stage for CSA job detach.
Definition: psi.cc:203
PSI_stage_info stage_csa_session_acquire
Stage for CSA session acquire.
Definition: psi.cc:199
PSI_stage_info stage_csa_sched_check_stage_queues
Stage for CSA scheduler check stage queues.
Definition: psi.cc:228
PSI_cond_key key_cv_csa_prefetcher_wait
PSI cond key for CSA prefetcher wait.
Definition: psi.cc:99
PSI_stage_info stage_csa_job_attach
Stage for CSA job attach.
Definition: psi.cc:201
PSI_thread_key key_thread_session
PSI thread key for prefetcher threads.
Definition: psi.cc:125
PSI_stage_info stage_csa_sched_sync_limit
Stage for CSA scheduler sync limit.
Definition: psi.cc:234
PSI_stage_info stage_csa_dep_add
Stage for CSA dependency add.
Definition: psi.cc:215
PSI_stage_info stage_csa_stopped
Stage for CSA stopped.
Definition: psi.cc:195
PSI_mutex_key key_mt_csa_sched_end
PSI mutex key for CSA scheduler end.
Definition: psi.cc:61
PSI_memory_key key_mem_csa_scheduler
PSI memory key for CSA scheduler.
Definition: psi.cc:150
PSI_thread_key key_thread_prefetcher
PSI thread key for prefetcher threads.
Definition: psi.cc:124
PSI_mutex_key key_mutex_module
PSI mutex key for module.
Definition: psi.cc:58
PSI_mutex_key key_mt_csa_sched_main
PSI mutex key for CSA scheduler main.
Definition: psi.cc:60
PSI_stage_info stage_csa_session_attached
Definition: psi.cc:178
PSI_cond_key key_cv_csa_sched_main
Definition: psi.cc:97
PSI_rwlock_key key_rwlock_module
PSI rwlock key for module locking.
Definition: psi.cc:41
PSI_stage_info stage_csa_sched_check_dependencies
Stage for CSA scheduler check dependencies.
Definition: psi.cc:226
PSI_stage_info stage_csa_wait_for_trx
Stage for CSA wait for transaction.
Definition: psi.cc:187
PSI_memory_key key_mem_csa_thp
PSI memory key for CSA THP.
Definition: psi.cc:147
PSI_memory_key key_mem_csa_provider
PSI memory key for CSA provider.
Definition: psi.cc:148
PSI_stage_info stage_csa_dep_register
Stage for CSA dependency register.
Definition: psi.cc:213
PSI_stage_info stage_csa_sched_stopped
Stage for CSA scheduler stopped.
Definition: psi.cc:222
PSI_stage_info stage_csa_sched_stopping
Stage for CSA scheduler stopping.
Definition: psi.cc:220
PSI_stage_info stage_csa_starting
Stage for CSA starting.
Definition: psi.cc:183
Stage instrument information.
Definition: psi_stage_bits.h:74