MySQL 26.7.0
Source Code Documentation
pfs_instr.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 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 PFS_INSTR_H
25#define PFS_INSTR_H
26
27/**
28 @file storage/perfschema/pfs_instr.h
29 Performance schema instruments (declarations).
30*/
31
32struct PFS_mutex_class;
33struct PFS_rwlock_class;
34struct PFS_cond_class;
35struct PFS_file_class;
36struct PFS_table_share;
37struct PFS_thread_class;
38struct PFS_socket_class;
39class PFS_opaque_container_page;
40
41class THD;
42
43#include "my_config.h"
44
45#include <sys/types.h>
46#include <time.h>
47#include <atomic>
48
49#include "my_inttypes.h"
50#include "my_io.h"
51#include "my_thread_os_id.h"
52#ifdef _WIN32
53#include <winsock2.h>
54#endif
55#ifdef HAVE_ARPA_INET_H
56#include <arpa/inet.h>
57#endif
58#include "lf.h"
59#include "my_compiler.h"
60#include "my_hostname.h" /* HOSTNAME_LENGTH */
61#include "sql/mdl.h"
74#include "violite.h" /* enum_vio_type */
75
77
80
81/**
82 @addtogroup performance_schema_buffers
83 @{
84*/
85
86struct PFS_thread;
87struct PFS_host;
88struct PFS_user;
89struct PFS_account;
90
91/** Base structure for wait instruments. */
92struct PFS_instr {
93 /** Internal lock. */
95 /** Enabled flag. */
97 /** Timed flag. */
98 bool m_timed;
99 /** Container page. */
100 PFS_opaque_container_page *m_page;
101};
102
103/** Instrumented mutex implementation. @see PSI_mutex. */
104struct PFS_mutex : public PSI_mutex {
105 /** Internal lock. */
107 /** Timed flag. */
109 /** Container page. */
110 PFS_opaque_container_page *m_page;
111
112 /** Mutex identity. */
114 /** Mutex class. */
116 /** Instrument statistics. */
118 /** Current owner. */
120#ifdef LATER_WL2333
121 /**
122 Time stamp of the last lock.
123 This statistic is not exposed in user visible tables yet.
124 */
125 ulonglong m_last_locked;
126#endif /* LATER_WL2333 */
127};
128
129/** Instrumented rwlock implementation. @see PSI_rwlock. */
130struct PFS_rwlock : public PSI_rwlock {
131 /** Internal lock. */
133 /** Timed flag. */
135 /** Container page. */
136 PFS_opaque_container_page *m_page;
137
138 /** RWLock identity. */
140 /** RWLock class. */
142 /** Instrument statistics. */
144 /** Current writer thread. */
146 /** Current count of readers. */
148#ifdef LATER_WL2333
149 /**
150 Time stamp of the last write.
151 This statistic is not exposed in user visible tables yet.
152 */
153 ulonglong m_last_written;
154 /**
155 Time stamp of the last read.
156 This statistic is not exposed in user visible tables yet.
157 */
158 ulonglong m_last_read;
159#endif /* LATER_WL2333 */
160};
161
162/** Instrumented condition implementation. @see PSI_cond. */
163struct PFS_cond : public PSI_cond {
164 /** Internal lock. */
166 /** Timed flag. */
168 /** Container page. */
169 PFS_opaque_container_page *m_page;
170
171 /** Condition identity. */
173 /** Condition class. */
175 /** Condition instance usage statistics. */
177};
178
179/** Instrumented File and FILE implementation. @see PSI_file. */
181 uint32 get_version() { return m_lock.get_version(); }
182
183 /** File identity. */
185 /** File name. */
187 /** File class. */
189 /** File usage statistics. */
191 /** True if a temporary file. */
193};
194
195/** Instrumented table implementation. @see PSI_table. */
197 /**
198 True if table I/O instrumentation is enabled.
199 This flag is computed.
200 */
202 /**
203 True if table lock instrumentation is enabled.
204 This flag is computed.
205 */
207 /**
208 True if table I/O instrumentation is timed.
209 This flag is computed.
210 */
212 /**
213 True if table lock instrumentation is timed.
214 This flag is computed.
215 */
217
218 /** True if table I/O statistics have been collected. */
220
221 /** True if table lock statistics have been collected. */
223
224 public:
225 /**
226 Aggregate this table handle statistics to the parents.
227 Only use this method for handles owned by the calling code.
228 @sa sanitized_aggregate.
229 */
230 void aggregate(const TABLE_SHARE *server_share) {
231 if (m_has_io_stats) {
232 safe_aggregate_io(server_share, &m_table_stat, m_share);
233 m_has_io_stats = false;
234 }
235 if (m_has_lock_stats) {
236 safe_aggregate_lock(&m_table_stat, m_share);
237 m_has_lock_stats = false;
238 }
239 }
240
241 /**
242 Aggregate this table handle statistics to the parents.
243 This method is safe to call on handles not owned by the calling code.
244 @sa aggregate
245 @sa sanitized_aggregate_io
246 @sa sanitized_aggregate_lock
247 */
248 void sanitized_aggregate();
249
250 /**
251 Aggregate this table handle I/O statistics to the parents.
252 This method is safe to call on handles not owned by the calling code.
253 */
254 void sanitized_aggregate_io();
255
256 /**
257 Aggregate this table handle lock statistics to the parents.
258 This method is safe to call on handles not owned by the calling code.
259 */
260 void sanitized_aggregate_lock();
261
262 /** Internal lock. */
264 /** Thread Owner. */
266 /** Event Owner. */
268 /** Table share. */
270 /** Table identity. */
272 /** Table statistics. */
274 /** Current internal lock. */
276 /** Current external lock. */
278 /** Container page. */
279 PFS_opaque_container_page *m_page;
280
281 private:
282 static void safe_aggregate_io(const TABLE_SHARE *optional_server_share,
283 PFS_table_stat *stat,
284 PFS_table_share *table_share);
285 static void safe_aggregate_lock(PFS_table_stat *stat,
286 PFS_table_share *table_share);
287};
288
289/** Instrumented socket implementation. @see PSI_socket. */
290struct PFS_socket : public PSI_socket {
291 /** Internal lock. */
293 /** Timed flag. */
295 /** Container page. */
296 PFS_opaque_container_page *m_page;
297
299
300 /** Socket identity. */
302 /** Owning thread, if applicable */
304 /** Socket file descriptor */
306 /** Raw socket address */
307 struct sockaddr_storage m_sock_addr;
308 /** Length of address */
309 socklen_t m_addr_len;
310 /** Idle flag. */
311 bool m_idle;
312 /** Socket class. */
314 /** Socket usage statistics. */
316};
317
318/** Instrumented metadata lock implementation. @see PSI_metadata_lock. */
320 uint32 get_version() { return m_lock.get_version(); }
321
322 /** Lock identity. */
328 const char *m_src_file;
332};
333
334/**
335 @def WAIT_STACK_LOGICAL_SIZE
336 Maximum number of nested waits.
337 Some waits, such as:
338 - "wait/io/table/sql/handler"
339 - "wait/lock/table/sql/handler"
340 are implemented by calling code in a storage engine,
341 that can cause nested waits (file I/O, mutex, ...)
342 Because of partitioned tables, a table I/O event (on the whole table)
343 can contain a nested table I/O event (on a partition).
344 Because of additional debug instrumentation,
345 waiting on what looks like a "mutex" (safe_mutex, innodb sync0sync, ...)
346 can cause nested waits to be recorded.
347 For example, a wait on innodb mutexes can lead to:
348 - wait/sync/mutex/innobase/some_mutex
349 - wait/sync/mutex/innobase/sync0sync
350 - wait/sync/mutex/innobase/os0sync
351 The max depth of the event stack must be sufficient
352 for these low level details to be visible.
353*/
354#define WAIT_STACK_LOGICAL_SIZE 5
355/**
356 @def WAIT_STACK_BOTTOM
357 Maximum number dummy waits records.
358 One dummy record is reserved for the parent stage / statement / transaction,
359 at the bottom of the wait stack.
360*/
361#define WAIT_STACK_BOTTOM 1
362/**
363 @def WAIT_STACK_SIZE
364 Physical size of the waits stack
365*/
366#define WAIT_STACK_SIZE (WAIT_STACK_BOTTOM + WAIT_STACK_LOGICAL_SIZE)
367
368/** Max size of the statements stack. */
369extern uint statement_stack_max;
370/** Max size of the digests token array. */
371extern size_t pfs_max_digest_length;
372/** Max size of SQL TEXT. */
373extern size_t pfs_max_sqltext;
374
375/** Instrumented thread implementation. @see PSI_thread. */
377 static PFS_thread *get_current_thread();
378
379 /** Thread instrumentation flag. */
381 /** Thread history instrumentation flag. */
383
384 /**
385 Derived flag flag_events_waits_history, per thread.
386 Cached computation of
387 TABLE SETUP_CONSUMERS[EVENTS_WAITS_HISTORY].ENABLED == 'YES'
388 AND
389 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
390 */
392 /**
393 Derived flag flag_events_waits_history_long, per thread.
394 Cached computation of
395 TABLE SETUP_CONSUMERS[EVENTS_WAITS_HISTORY_LONG].ENABLED == 'YES'
396 AND
397 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
398 */
400 /**
401 Derived flag flag_events_stages_history, per thread.
402 Cached computation of
403 TABLE SETUP_CONSUMERS[EVENTS_STAGES_HISTORY].ENABLED == 'YES'
404 AND
405 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
406 */
408 /**
409 Derived flag flag_events_stages_history_long, per thread.
410 Cached computation of
411 TABLE SETUP_CONSUMERS[EVENTS_STAGES_HISTORY_LONG].ENABLED == 'YES'
412 AND
413 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
414 */
416 /**
417 Derived flag flag_events_statements_history, per thread.
418 Cached computation of
419 TABLE SETUP_CONSUMERS[EVENTS_STATEMENTS_HISTORY].ENABLED == 'YES'
420 AND
421 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
422 */
424 /**
425 Derived flag flag_events_statements_history_long, per thread.
426 Cached computation of
427 TABLE SETUP_CONSUMERS[EVENTS_STATEMENTS_HISTORY_LONG].ENABLED == 'YES'
428 AND
429 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
430 */
432 /**
433 Derived flag flag_events_transactions_history, per thread.
434 Cached computation of
435 TABLE SETUP_CONSUMERS[EVENTS_TRANSACTIONS_HISTORY].ENABLED == 'YES'
436 AND
437 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
438 */
440 /**
441 Derived flag flag_events_transactions_history_long, per thread.
442 Cached computation of
443 TABLE SETUP_CONSUMERS[EVENTS_TRANSACTIONS_HISTORY_LONG].ENABLED == 'YES'
444 AND
445 TABLE THREADS[THREAD_ID].HISTORY == 'YES'
446 */
448
449 /** Current wait event in the event stack. */
451 /** Event ID counter */
453 /**
454 Internal lock.
455 This lock is exclusively used to protect against races
456 when creating and destroying PFS_thread.
457 Do not use this lock to protect thread attributes,
458 use one of @c m_stmt_lock or @c m_session_lock instead.
459 */
461 /** Pins for filename_hash. */
463 /** Pins for table_share_hash. */
465 /** Pins for setup_actor_hash. */
467 /** Pins for setup_object_hash. */
469 /** Pins for host_hash. */
471 /** Pins for user_hash. */
473 /** Pins for account_hash. */
475 /** Pins for digest_hash. */
477 /** Pins for routine_hash. */
479 /** Internal thread identifier, unique. */
481 /** Parent internal thread identifier. */
483 /** External (@code SHOW PROCESSLIST @endcode) thread identifier, not unique.
484 */
486 /** External (Operating system) thread identifier, if any. */
488 /** Thread class. */
490 /** True if a system thread. */
492 /**
493 Stack of events waits.
494 This member holds the data for the table
495 PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT.
496 Note that stack[0] is a dummy record that represents the parent
497 stage/statement/transaction.
498 For example, assuming the following tree:
499 - STAGE ID 100
500 - WAIT ID 101, parent STAGE 100
501 - WAIT ID 102, parent wait 101
502 the data in the stack will be:
503 stack[0].m_event_id= 100, set by the stage instrumentation
504 stack[0].m_event_type= STAGE, set by the stage instrumentation
505 stack[0].m_nesting_event_id= unused
506 stack[0].m_nesting_event_type= unused
507 stack[1].m_event_id= 101
508 stack[1].m_event_type= WAIT
509 stack[1].m_nesting_event_id= stack[0].m_event_id= 100
510 stack[1].m_nesting_event_type= stack[0].m_event_type= STAGE
511 stack[2].m_event_id= 102
512 stack[2].m_event_type= WAIT
513 stack[2].m_nesting_event_id= stack[1].m_event_id= 101
514 stack[2].m_nesting_event_type= stack[1].m_event_type= WAIT
515
516 The whole point of the stack[0] record is to allow this optimization
517 in the code, in the instrumentation for wait events:
518 wait->m_nesting_event_id= (wait-1)->m_event_id;
519 wait->m_nesting_event_type= (wait-1)->m_event_type;
520 This code works for both the top level wait, and nested waits,
521 and works without if conditions, which helps performances.
522 */
523 PFS_events_waits m_events_waits_stack[WAIT_STACK_SIZE];
524 /** True if the circular buffer @c m_waits_history is full. */
526 /** Current index in the circular buffer @c m_waits_history. */
528 /**
529 Waits history circular buffer.
530 This member holds the data for the table
531 PERFORMANCE_SCHEMA.EVENTS_WAITS_HISTORY.
532 */
534
535 /** True if the circular buffer @c m_stages_history is full. */
537 /** Current index in the circular buffer @c m_stages_history. */
539 /**
540 Stages history circular buffer.
541 This member holds the data for the table
542 PERFORMANCE_SCHEMA.EVENTS_STAGES_HISTORY.
543 */
545
546 /** True if the circular buffer @c m_statements_history is full. */
548 /** Current index in the circular buffer @c m_statements_history. */
550 /**
551 Statements history circular buffer.
552 This member holds the data for the table
553 PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_HISTORY.
554 */
556
557 /** True if the circular buffer @c m_transactions_history is full. */
559 /** Current index in the circular buffer @c m_transactions_history. */
561 /**
562 Statements history circular buffer.
563 This member holds the data for the table
564 PERFORMANCE_SCHEMA.EVENTS_TRANSACTIONS_HISTORY.
565 */
567
568 /**
569 Internal lock, for session attributes.
570 Statement attributes are expected to be updated in frequently,
571 typically per session execution.
572 */
574
575 /**
576 User name.
577 Protected by @c m_session_lock.
578 */
580
581 /**
582 Host name.
583 Protected by @c m_session_lock.
584 */
586
587 /**
588 Database name.
589 Protected by @c m_stmt_lock.
590 */
592
593 /**
594 Resource group name.
595 Protected by @c m_session_lock.
596 */
597 char m_groupname[NAME_LEN];
598 /**
599 Length of @c m_groupname.
600 Protected by @c m_session_lock.
601 */
603 /**
604 Operating system name.
605 */
606 char m_os_name[PFS_MAX_OS_NAME_LENGTH];
607 /** User-defined data. */
609 /** Current command. */
611 /** Connection type. */
613 /** Start time. */
615 /**
616 Internal lock, for statement attributes.
617 Statement attributes are expected to be updated frequently,
618 typically per statement execution.
619 */
621 /** Processlist state (derived from stage). */
623 /** Current stage progress. */
625 /**
626 Processlist info.
627 Protected by @c m_stmt_lock.
628 */
629 char m_processlist_info[COL_INFO_SIZE];
630 /**
631 Length of @c m_processlist_info_length.
632 Protected by @c m_stmt_lock.
633 */
635
636 /** Executed on secondary engine. */
638
640
641 /** Size of @c m_events_statements_stack. */
644
646
652
653 /** Remote (peer) port */
655 /** Raw socket address */
656 struct sockaddr_storage m_sock_addr;
657 /** Length of address */
659
660 /** Reset session connect attributes */
661 void reset_session_connect_attrs();
662
663 /**
664 Buffer for the connection attributes.
665 Protected by @c m_session_lock.
666 */
668 /**
669 Length used by @c m_connect_attrs.
670 Protected by @c m_session_lock.
671 */
673 /**
674 Character set in which @c m_connect_attrs are encoded.
675 Protected by @c m_session_lock.
676 */
678
679 /** Reset all memory statistics. */
680 void rebase_memory_stats();
681
682 void carry_memory_stat_alloc_delta(PFS_memory_stat_alloc_delta *delta,
683 uint index);
684 void carry_memory_stat_free_delta(PFS_memory_stat_free_delta *delta,
685 uint index);
686
687 void set_enabled(bool enabled) { m_enabled = enabled; }
688
689 void set_history(bool history) {
690 m_history = history;
691 set_history_derived_flags();
692 }
693
694 void set_history_derived_flags();
695
696 /**
697 Per thread memory aggregated statistics.
698 This member holds the data for the table
699 PERFORMANCE_SCHEMA.MEMORY_SUMMARY_BY_THREAD_BY_EVENT_NAME.
700 Immutable, safe to use without internal lock.
701 */
703
705 m_has_memory_stats = false;
706 m_instr_class_memory_stats = array;
707 }
708
710 if (!m_has_memory_stats) {
711 return nullptr;
712 }
713 return m_instr_class_memory_stats;
714 }
715
717 if (!m_has_memory_stats) {
718 rebase_memory_stats();
719 m_has_memory_stats = true;
720 }
721 return m_instr_class_memory_stats;
722 }
723 void mem_cnt_alloc(size_t size);
724 void mem_cnt_free(size_t size);
725#ifndef NDEBUG
726 const char *current_key_name;
727#endif
728
730
731 /** Copy of g_telemetry. */
733 telemetry_session_t *m_telemetry_session;
734
735#ifndef NDEBUG
737#endif
738};
739
741 uint index);
743 uint index);
744
748extern std::atomic<PFS_memory_shared_stat *> global_instr_class_memory_array;
749
757
758int init_instruments(const PFS_global_param *param);
760int init_file_hash(const PFS_global_param *param);
761void cleanup_file_hash();
762PFS_mutex *create_mutex(PFS_mutex_class *klass, const void *identity);
764PFS_rwlock *create_rwlock(PFS_rwlock_class *klass, const void *identity);
766PFS_cond *create_cond(PFS_cond_class *klass, const void *identity);
768
770 const void *identity, ulonglong processlist_id);
771
774
776
778 const char *filename, uint len, bool create);
779
780PFS_file *start_file_rename(PFS_thread *thread, const char *old_name);
781int end_file_rename(PFS_thread *thread, PFS_file *pfs, const char *new_name,
782 int rename_result);
783
785 const char *filename, uint len);
788void destroy_file(PFS_thread *thread, PFS_file *pfs, bool delete_name);
790 const void *identity);
792
794 const struct sockaddr *addr, socklen_t addr_len);
796
797PFS_metadata_lock *create_metadata_lock(void *identity, const MDL_key *mdl_key,
798 opaque_mdl_type mdl_type,
799 opaque_mdl_duration mdl_duration,
800 opaque_mdl_status mdl_status,
801 const char *src_file, uint src_line);
803
804/* For iterators and show status. */
805
806extern long file_handle_max;
807extern ulong file_handle_lost;
812extern ulong locker_lost;
813extern ulong statement_lost;
814extern ulong session_connect_attrs_lost;
817
818/* Exposing the data directly, for iterators. */
819
821
826
828 PFS_single_stat *to_array);
830 PFS_single_stat *to_array_1,
831 PFS_single_stat *to_array_2);
832
833void aggregate_all_stages(PFS_stage_stat *from_array, PFS_stage_stat *to_array);
834void aggregate_all_stages(PFS_stage_stat *from_array,
835 PFS_stage_stat *to_array_1,
836 PFS_stage_stat *to_array_2);
837
839 PFS_statement_stat *to_array);
841 PFS_statement_stat *to_array_1,
842 PFS_statement_stat *to_array_2);
843
845 PFS_transaction_stat *to_array);
847 PFS_transaction_stat *to_array_1,
848 PFS_transaction_stat *to_array_2);
849
850void aggregate_all_errors(PFS_error_stat *from_array, PFS_error_stat *to_array);
851void aggregate_all_errors(PFS_error_stat *from_array,
852 PFS_error_stat *to_array_1,
853 PFS_error_stat *to_array_2);
854
856 PFS_memory_safe_stat *from_array,
857 PFS_memory_shared_stat *to_array,
858 PFS_memory_shared_stat *global_array);
860 PFS_memory_safe_stat *from_array,
861 PFS_memory_shared_stat *to_array_1,
862 PFS_memory_shared_stat *to_array_2,
863 PFS_memory_shared_stat *global_array);
864
865void aggregate_all_memory(bool alive, PFS_memory_safe_stat *from_array,
866 PFS_memory_shared_stat *to_array);
868 PFS_memory_shared_stat *to_array);
870 PFS_memory_shared_stat *to_array_1,
871 PFS_memory_shared_stat *to_array_2);
872
873void aggregate_thread(PFS_thread *thread, PFS_account *safe_account,
874 PFS_user *safe_user, PFS_host *safe_host);
875void aggregate_thread_waits(PFS_thread *thread, PFS_account *safe_account,
876 PFS_user *safe_user, PFS_host *safe_host);
877void aggregate_thread_stages(PFS_thread *thread, PFS_account *safe_account,
878 PFS_user *safe_user, PFS_host *safe_host);
879void aggregate_thread_statements(PFS_thread *thread, PFS_account *safe_account,
880 PFS_user *safe_user, PFS_host *safe_host);
882 PFS_account *safe_account,
883 PFS_user *safe_user, PFS_host *safe_host);
884void aggregate_thread_errors(PFS_thread *thread, PFS_account *safe_account,
885 PFS_user *safe_user, PFS_host *safe_host);
886void aggregate_thread_memory(bool alive, PFS_thread *thread,
887 PFS_account *safe_account, PFS_user *safe_user,
888 PFS_host *safe_host);
889
890void aggregate_thread_status(PFS_thread *thread, PFS_account *safe_account,
891 PFS_user *safe_user, PFS_host *safe_host);
892
893void clear_thread_account(PFS_thread *thread);
894void set_thread_account(PFS_thread *thread);
895
896/** Update derived flags for all mutex instances. */
898/** Update derived flags for all rwlock instances. */
900/** Update derived flags for all condition instances. */
902/** Update derived flags for all file handles. */
904/** Update derived flags for all table handles. */
906/** Update derived flags for all socket instances. */
908/** Update derived flags for all metadata instances. */
910/** Update derived flags for all thread instances. */
912/** Update derived flags for all instruments. */
914
915/** Clear source file pointers for all statements, stages, waits and
916 * transactions. */
918
920
921/** @} */
922#endif
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
std::atomic< PFS_memory_shared_stat * > global_instr_class_memory_array
Definition: pfs_instr.cc:99
ulong session_connect_attrs_longest_seen
Longest connection attributes string seen so far, pre-truncation.
Definition: pfs_instr.cc:82
void cleanup_file_hash()
Cleanup the file name hash.
Definition: pfs_instr.cc:328
uint statement_stack_max
Max size of the statements stack.
Definition: pfs_instr.cc:72
PFS_thread * find_thread_by_internal_id(ulonglong thread_id)
Find a PFS thread given an internal thread id.
Definition: pfs_instr.cc:746
void carry_global_memory_stat_alloc_delta(PFS_memory_stat_alloc_delta *delta, uint index)
Definition: pfs_instr.cc:571
int init_instruments(const PFS_global_param *param)
Initialize all the instruments instance buffers.
Definition: pfs_instr.cc:113
void update_mutex_derived_flags()
Update derived flags for all mutex instances.
Definition: pfs_instr.cc:2440
PFS_metadata_lock * create_metadata_lock(void *, const MDL_key *mdl_key, opaque_mdl_type mdl_type, opaque_mdl_duration mdl_duration, opaque_mdl_status mdl_status, const char *src_file, uint src_line)
Definition: pfs_instr.cc:1549
LF_HASH filename_hash
Hash table for instrumented files.
Definition: pfs_instr.cc:104
void destroy_cond(PFS_cond *pfs)
Destroy instrumentation for a condition instance.
Definition: pfs_instr.cc:474
PFS_rwlock * create_rwlock(PFS_rwlock_class *klass, const void *)
Create instrumentation for a rwlock instance.
Definition: pfs_instr.cc:399
void aggregate_all_stages(PFS_stage_stat *from_array, PFS_stage_stat *to_array)
Definition: pfs_instr.cc:1687
ulong session_connect_attrs_size_per_thread
Size of connection attribute storage per thread.
Definition: pfs_instr.cc:80
void update_table_derived_flags()
Update derived flags for all table handles.
Definition: pfs_instr.cc:2506
ulong statement_lost
Number of statements lost.
Definition: pfs_instr.cc:78
void aggregate_thread_statements(PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:2140
PFS_statement_stat * global_instr_class_statements_array
Definition: pfs_instr.cc:97
PFS_mutex * create_mutex(PFS_mutex_class *klass, const void *)
Create instrumentation for a mutex instance.
Definition: pfs_instr.cc:340
PFS_file * find_or_create_file(PFS_thread *thread, PFS_file_class *klass, const char *filename, uint len, bool create)
Find or create instrumentation for a file instance by file name.
Definition: pfs_instr.cc:1055
PFS_histogram global_statements_histogram
Definition: pfs_instr.cc:98
ulong events_stages_history_per_thread
Number of EVENTS_STAGES_HISTORY records per thread.
Definition: pfs_instr.cc:69
PFS_thread * create_thread(PFS_thread_class *klass, PSI_thread_seqnum seqnum, const void *identity, ulonglong processlist_id)
Create instrumentation for a thread instance.
Definition: pfs_instr.cc:611
PFS_cond * sanitize_cond(PFS_cond *unsafe)
Definition: pfs_instr.cc:798
void update_thread_derived_flags()
Update derived flags for all thread instances.
Definition: pfs_instr.cc:2543
PFS_table * create_table(PFS_table_share *share, PFS_thread *opening_thread, const void *)
Create instrumentation for a table instance.
Definition: pfs_instr.cc:1308
void aggregate_thread_status(PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:1941
void update_socket_derived_flags()
Update derived flags for all socket instances.
Definition: pfs_instr.cc:2521
void cleanup_instruments()
Cleanup all the instruments buffers.
Definition: pfs_instr.cc:231
PFS_TL_LOCK_TYPE
Definition: pfs_stat.h:689
void update_cond_derived_flags()
Update derived flags for all condition instances.
Definition: pfs_instr.cc:2470
PFS_socket * sanitize_socket(PFS_socket *unsafe)
Definition: pfs_instr.cc:819
void destroy_metadata_lock(PFS_metadata_lock *pfs)
Definition: pfs_instr.cc:1579
int init_file_hash(const PFS_global_param *param)
Initialize the file name hash.
Definition: pfs_instr.cc:317
void update_instruments_derived_flags()
Update derived flags for all instruments.
Definition: pfs_instr.cc:2547
ulong locker_lost
Number of locker lost.
Definition: pfs_instr.cc:76
void clear_thread_account(PFS_thread *thread)
Definition: pfs_instr.cc:2397
void destroy_file(PFS_thread *thread, PFS_file *pfs, bool delete_name)
Destroy instrumentation for a file instance.
Definition: pfs_instr.cc:1282
void update_file_derived_flags()
Update derived flags for all file handles.
Definition: pfs_instr.cc:2485
void aggregate_all_memory_with_reassign(bool alive, PFS_memory_safe_stat *from_array, PFS_memory_shared_stat *to_array, PFS_memory_shared_stat *global_array)
Definition: pfs_instr.cc:1817
void reset_file_instance_io()
Reset the I/O statistics per file instance.
Definition: pfs_instr.cc:1632
void reset_histogram_global()
Definition: pfs_instr.cc:1645
size_t pfs_max_sqltext
Max size of SQL TEXT.
Definition: pfs_instr.cc:74
void aggregate_thread_waits(PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:2025
void carry_global_memory_stat_free_delta(PFS_memory_stat_free_delta *delta, uint index)
Definition: pfs_instr.cc:580
void reset_events_waits_by_instance()
Reset the wait statistics per object instance.
Definition: pfs_instr.cc:1619
int end_file_rename(PFS_thread *thread, PFS_file *pfs, const char *new_name, int rename_result)
After the rename operation: Assign the new filename to the file instrumentation instance,...
Definition: pfs_instr.cc:1195
PFS_socket * create_socket(PFS_socket_class *klass, const my_socket *fd, const struct sockaddr *addr, socklen_t addr_len)
Create instrumentation for a socket instance.
Definition: pfs_instr.cc:1464
PFS_thread * sanitize_thread(PFS_thread *unsafe)
Sanitize a PFS_thread pointer.
Definition: pfs_instr.cc:811
void destroy_socket(PFS_socket *pfs)
Destroy instrumentation for a socket instance.
Definition: pfs_instr.cc:1515
PFS_metadata_lock * sanitize_metadata_lock(PFS_metadata_lock *unsafe)
Definition: pfs_instr.cc:823
PFS_file ** file_handle_array
File instrumentation handle array.
Definition: pfs_instr.cc:94
void aggregate_all_event_names(PFS_single_stat *from_array, PFS_single_stat *to_array)
Definition: pfs_instr.cc:1647
void update_metadata_derived_flags()
Update derived flags for all metadata instances.
Definition: pfs_instr.cc:2535
ulong events_waits_history_per_thread
Number of EVENTS_WAITS_HISTORY records per thread.
Definition: pfs_instr.cc:67
void aggregate_all_memory(bool alive, PFS_memory_safe_stat *from_array, PFS_memory_shared_stat *to_array)
Definition: pfs_instr.cc:1843
PFS_file * start_file_rename(PFS_thread *thread, const char *old_name)
Before the rename operation: Find the file instrumentation by name, then delete the filename from the...
Definition: pfs_instr.cc:1147
void aggregate_thread_transactions(PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:2202
PFS_rwlock * sanitize_rwlock(PFS_rwlock *unsafe)
Definition: pfs_instr.cc:794
PFS_stage_stat * global_instr_class_stages_array
Definition: pfs_instr.cc:96
void aggregate_thread_memory(bool alive, PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:2328
void reset_socket_instance_io()
Reset the I/O statistics per socket instance.
Definition: pfs_instr.cc:1641
void aggregate_thread(PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:1995
void aggregate_thread_stages(PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:2079
ulong events_statements_history_per_thread
Number of EVENTS_STATEMENTS_HISTORY records per thread.
Definition: pfs_instr.cc:71
unsigned int PFS_stage_key
Key, naming a stage instrument.
Definition: pfs_instr_class.h:100
ulong session_connect_attrs_lost
Number of connection attributes lost.
Definition: pfs_instr.cc:84
ulong events_transactions_history_per_thread
Number of EVENTS_TRANSACTIONS_HISTORY records per thread.
Definition: pfs_instr.cc:87
void update_rwlock_derived_flags()
Update derived flags for all rwlock instances.
Definition: pfs_instr.cc:2455
ulong file_handle_lost
Number of file handle lost.
Definition: pfs_instr.cc:65
void release_file(PFS_file *pfs)
Release instrumentation for a file instance.
Definition: pfs_instr.cc:1256
void aggregate_all_transactions(PFS_transaction_stat *from_array, PFS_transaction_stat *to_array)
Definition: pfs_instr.cc:1767
void aggregate_all_errors(PFS_error_stat *from_array, PFS_error_stat *to_array)
Definition: pfs_instr.cc:1792
#define WAIT_STACK_SIZE
Physical size of the waits stack.
Definition: pfs_instr.h:366
long file_handle_max
Size of the file handle array.
Definition: pfs_instr.cc:61
void delete_file_name(PFS_thread *thread, PFS_file *pfs)
Delete file name from the hash table.
Definition: pfs_instr.cc:1266
void set_thread_account(PFS_thread *thread)
Definition: pfs_instr.cc:2414
void aggregate_all_statements(PFS_statement_stat *from_array, PFS_statement_stat *to_array)
Definition: pfs_instr.cc:1727
void reset_source_file_pointers()
Clear the source file pointers from all waits, stages, statements and transaction events.
Definition: pfs_instr.cc:2626
PFS_cond * create_cond(PFS_cond_class *klass, const void *)
Create instrumentation for a condition instance.
Definition: pfs_instr.cc:449
void destroy_thread(PFS_thread *pfs)
Destroy instrumentation for a thread instance.
Definition: pfs_instr.cc:831
PFS_file * find_file(PFS_thread *thread, PFS_file_class *klass, const char *filename, uint len)
Find a file instrumentation instance by name.
Definition: pfs_instr.cc:1247
PFS_mutex * sanitize_mutex(PFS_mutex *unsafe)
Definition: pfs_instr.cc:790
void aggregate_thread_errors(PFS_thread *thread, PFS_account *safe_account, PFS_user *safe_user, PFS_host *safe_host)
Definition: pfs_instr.cc:2268
void destroy_mutex(PFS_mutex *pfs)
Destroy instrumentation for a mutex instance.
Definition: pfs_instr.cc:381
PFS_thread * find_thread_by_processlist_id(ulonglong processlist_id)
Find a PFS thread given a processlist id.
Definition: pfs_instr.cc:769
size_t pfs_max_digest_length
Max size of the digests token array.
Definition: pfs_instr.cc:73
void destroy_table(PFS_table *pfs)
Destroy instrumentation for a table instance.
Definition: pfs_instr.cc:1450
PFS_file * sanitize_file(PFS_file *unsafe)
Definition: pfs_instr.cc:815
void destroy_rwlock(PFS_rwlock *pfs)
Destroy instrumentation for a rwlock instance.
Definition: pfs_instr.cc:431
int opaque_mdl_duration
Definition: psi_mdl_bits.h:42
int opaque_mdl_status
Definition: psi_mdl_bits.h:45
int opaque_mdl_type
Definition: psi_mdl_bits.h:36
unsigned int PSI_thread_seqnum
Instrumented thread sequence number.
Definition: psi_thread_bits.h:59
Header for compiler-dependent features.
Common definition used by mysys, performance schema and server & client.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
static my_thread_id thread_id
Definition: my_thr_init.cc:60
Portable wrapper for gettid().
unsigned long long my_thread_os_id_t
Definition: my_thread_os_id.h:48
int my_socket
Definition: mysql.h:65
#define NAME_LEN
Definition: mysql_com.h:67
static PFS_engine_table_share_proxy share
Definition: connection_control_pfs_table.cc:92
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
static mysql_service_status_t create(my_h_string *) noexcept
Definition: mysql_string_all_empty.cc:43
size_t size(const char *const c)
Definition: base64.h:46
Data types for columns used in the performance schema tables (declarations)
#define COL_INFO_SIZE
Size of INFO columns, in bytes.
Definition: pfs_column_types.h:71
Performance schema connection slice (declarations).
Events waits data structures (declarations).
Events statements data structures (declarations).
Events transactions data structures (declarations).
Events waits data structures (declarations).
const char * filename
Definition: pfs_example_component_population.cc:67
#define PFS_ALIGNED
Definition: pfs_global.h:57
PFS_single_stat * thread_instr_class_waits_array_end
PFS_single_stat * thread_instr_class_waits_array_start
Performance schema instruments metadata (declarations).
#define PFS_MAX_OS_NAME_LENGTH
Maximum length of the thread os name.
Definition: pfs_instr_class.h:68
Performance schema internal locks (declarations).
Object names (declarations).
Private interface for the server (declarations).
Statistics (declarations).
required bool enabled
Definition: replication_group_member_actions.proto:33
struct sockaddr sockaddr
Definition: sock_probe_win32.h:63
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Performance schema instrumentation (declarations).
std::uint64_t pfs_identity
Definition: pfs.h:34
Definition: lf.h:165
Definition: lf.h:86
Metadata lock object key.
Definition: mdl.h:366
Per account statistics.
Definition: pfs_account.h:67
Instrumentation metadata for a condition.
Definition: pfs_instr_class.h:383
Statistics for conditions usage.
Definition: pfs_stat.h:238
Instrumented condition implementation.
Definition: pfs_instr.h:163
PFS_cond_class * m_class
Condition class.
Definition: pfs_instr.h:174
pfs_identity m_identity
Condition identity.
Definition: pfs_instr.h:172
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:169
PFS_cond_stat m_cond_stat
Condition instance usage statistics.
Definition: pfs_instr.h:176
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:165
bool m_timed
Timed flag.
Definition: pfs_instr.h:167
A connection slice, an arbitrary grouping of several connections.
Definition: pfs_con_slice.h:54
Statistics for all server errors.
Definition: pfs_stat.h:557
A stage record.
Definition: pfs_events_stages.h:45
A statement record.
Definition: pfs_events_statements.h:47
A transaction record.
Definition: pfs_events_transactions.h:86
A wait event record.
Definition: pfs_events_waits.h:70
Instrumentation metadata for a file.
Definition: pfs_instr_class.h:644
Definition: pfs_name.h:610
Statistics for FILE usage.
Definition: pfs_stat.h:308
Instrumented File and FILE implementation.
Definition: pfs_instr.h:180
uint32 get_version()
Definition: pfs_instr.h:181
pfs_identity m_identity
File identity.
Definition: pfs_instr.h:184
PFS_file_class * m_class
File class.
Definition: pfs_instr.h:188
PFS_file_stat m_file_stat
File usage statistics.
Definition: pfs_instr.h:190
bool m_temporary
True if a temporary file.
Definition: pfs_instr.h:192
PFS_file_name m_file_name
File name.
Definition: pfs_instr.h:186
Performance schema global sizing parameters.
Definition: pfs_server.h:124
Definition: pfs_histogram.h:38
Definition: pfs_name.h:522
Per host statistics.
Definition: pfs_host.h:64
Base structure for wait instruments.
Definition: pfs_instr.h:92
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:100
bool m_enabled
Enabled flag.
Definition: pfs_instr.h:96
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:94
bool m_timed
Timed flag.
Definition: pfs_instr.h:98
Memory statistics.
Definition: pfs_stat.h:913
Definition: pfs_stat.h:937
Definition: pfs_stat.h:883
Definition: pfs_stat.h:888
Instrumented metadata lock implementation.
Definition: pfs_instr.h:319
ulonglong m_owner_event_id
Definition: pfs_instr.h:331
uint32 get_version()
Definition: pfs_instr.h:320
ulonglong m_owner_thread_id
Definition: pfs_instr.h:330
pfs_identity m_identity
Lock identity.
Definition: pfs_instr.h:323
uint m_src_line
Definition: pfs_instr.h:329
opaque_mdl_status m_mdl_status
Definition: pfs_instr.h:327
opaque_mdl_duration m_mdl_duration
Definition: pfs_instr.h:326
opaque_mdl_type m_mdl_type
Definition: pfs_instr.h:325
const char * m_src_file
Definition: pfs_instr.h:328
MDL_key m_mdl_key
Definition: pfs_instr.h:324
Instrumentation metadata for a mutex.
Definition: pfs_instr_class.h:363
Statistics for mutex usage.
Definition: pfs_stat.h:177
Instrumented mutex implementation.
Definition: pfs_instr.h:104
PFS_mutex_class * m_class
Mutex class.
Definition: pfs_instr.h:115
bool m_timed
Timed flag.
Definition: pfs_instr.h:108
pfs_identity m_identity
Mutex identity.
Definition: pfs_instr.h:113
PFS_thread * m_owner
Current owner.
Definition: pfs_instr.h:119
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:106
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:110
PFS_mutex_stat m_mutex_stat
Instrument statistics.
Definition: pfs_instr.h:117
Instrumentation metadata for a read write lock.
Definition: pfs_instr_class.h:373
Statistics for rwlock usage.
Definition: pfs_stat.h:204
Instrumented rwlock implementation.
Definition: pfs_instr.h:130
uint m_readers
Current count of readers.
Definition: pfs_instr.h:147
PFS_thread * m_writer
Current writer thread.
Definition: pfs_instr.h:145
PFS_rwlock_class * m_class
RWLock class.
Definition: pfs_instr.h:141
PFS_rwlock_stat m_rwlock_stat
Instrument statistics.
Definition: pfs_instr.h:143
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:132
pfs_identity m_identity
RWLock identity.
Definition: pfs_instr.h:139
bool m_timed
Timed flag.
Definition: pfs_instr.h:134
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:136
Definition: pfs_name.h:194
Definition: pfs_stat.h:1136
Single statistic.
Definition: pfs_stat.h:52
Instrumentation metadata for a socket.
Definition: pfs_instr_class.h:673
Statistics for SOCKET usage.
Definition: pfs_stat.h:875
Instrumented socket implementation.
Definition: pfs_instr.h:290
pfs_identity m_identity
Socket identity.
Definition: pfs_instr.h:301
bool m_idle
Idle flag.
Definition: pfs_instr.h:311
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:292
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:296
bool m_timed
Timed flag.
Definition: pfs_instr.h:294
uint32 get_version()
Definition: pfs_instr.h:298
socklen_t m_addr_len
Length of address.
Definition: pfs_instr.h:309
PFS_thread * m_thread_owner
Owning thread, if applicable.
Definition: pfs_instr.h:303
my_socket m_fd
Socket file descriptor.
Definition: pfs_instr.h:305
struct sockaddr_storage m_sock_addr
Raw socket address.
Definition: pfs_instr.h:307
PFS_socket_stat m_socket_stat
Socket usage statistics.
Definition: pfs_instr.h:315
PFS_socket_class * m_class
Socket class.
Definition: pfs_instr.h:313
Statistics for stage usage.
Definition: pfs_stat.h:323
Statistics for statement usage.
Definition: pfs_stat.h:376
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:513
Statistics for TABLE usage.
Definition: pfs_stat.h:740
Instrumented table implementation.
Definition: pfs_instr.h:196
PFS_table_stat m_table_stat
Table statistics.
Definition: pfs_instr.h:273
ulonglong m_owner_event_id
Event Owner.
Definition: pfs_instr.h:267
bool m_lock_timed
True if table lock instrumentation is timed.
Definition: pfs_instr.h:216
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:263
pfs_identity m_identity
Table identity.
Definition: pfs_instr.h:271
bool m_has_io_stats
True if table I/O statistics have been collected.
Definition: pfs_instr.h:219
PFS_thread * m_thread_owner
Thread Owner.
Definition: pfs_instr.h:265
bool m_lock_enabled
True if table lock instrumentation is enabled.
Definition: pfs_instr.h:206
PFS_TL_LOCK_TYPE m_external_lock
Current external lock.
Definition: pfs_instr.h:277
bool m_io_enabled
True if table I/O instrumentation is enabled.
Definition: pfs_instr.h:201
PFS_TL_LOCK_TYPE m_internal_lock
Current internal lock.
Definition: pfs_instr.h:275
bool m_io_timed
True if table I/O instrumentation is timed.
Definition: pfs_instr.h:211
void aggregate(const TABLE_SHARE *server_share)
Aggregate this table handle statistics to the parents.
Definition: pfs_instr.h:230
bool m_has_lock_stats
True if table lock statistics have been collected.
Definition: pfs_instr.h:222
PFS_table_share * m_share
Table share.
Definition: pfs_instr.h:269
PFS_opaque_container_page * m_page
Container page.
Definition: pfs_instr.h:279
Instrumentation metadata of a thread.
Definition: pfs_instr_class.h:394
Instrumented thread implementation.
Definition: pfs_instr.h:376
bool m_secondary
Executed on secondary engine.
Definition: pfs_instr.h:637
bool m_flag_events_statements_history_long
Derived flag flag_events_statements_history_long, per thread.
Definition: pfs_instr.h:431
uint m_session_connect_attrs_cs_number
Character set in which m_connect_attrs are encoded.
Definition: pfs_instr.h:677
uint m_events_statements_count
Size of m_events_statements_stack.
Definition: pfs_instr.h:642
THD * m_cnt_thd
Definition: pfs_instr.h:648
PFS_user * m_user
Definition: pfs_instr.h:650
LF_PINS * m_user_hash_pins
Pins for user_hash.
Definition: pfs_instr.h:472
PFS_events_transactions m_transaction_current
Definition: pfs_instr.h:645
PFS_events_waits * m_events_waits_current
Current wait event in the event stack.
Definition: pfs_instr.h:450
PFS_events_statements * m_statement_stack
Definition: pfs_instr.h:643
bool m_system_thread
True if a system thread.
Definition: pfs_instr.h:491
LF_PINS * m_account_hash_pins
Pins for account_hash.
Definition: pfs_instr.h:474
uint m_session_connect_attrs_length
Length used by m_connect_attrs.
Definition: pfs_instr.h:672
bool m_flag_events_stages_history_long
Derived flag flag_events_stages_history_long, per thread.
Definition: pfs_instr.h:415
telemetry_session_t * m_telemetry_session
Definition: pfs_instr.h:733
bool m_statements_history_full
True if the circular buffer m_statements_history is full.
Definition: pfs_instr.h:547
PSI_stage_progress * m_stage_progress
Current stage progress.
Definition: pfs_instr.h:624
bool m_flag_events_transactions_history
Derived flag flag_events_transactions_history, per thread.
Definition: pfs_instr.h:439
bool m_waits_history_full
True if the circular buffer m_waits_history is full.
Definition: pfs_instr.h:525
LF_PINS * m_filename_hash_pins
Pins for filename_hash.
Definition: pfs_instr.h:462
PFS_host_name m_host_name
Host name.
Definition: pfs_instr.h:585
void set_enabled(bool enabled)
Definition: pfs_instr.h:687
PFS_events_stages * m_stages_history
Stages history circular buffer.
Definition: pfs_instr.h:544
LF_PINS * m_digest_hash_pins
Pins for digest_hash.
Definition: pfs_instr.h:476
bool m_history
Thread history instrumentation flag.
Definition: pfs_instr.h:382
int m_command
Current command.
Definition: pfs_instr.h:610
pfs_lock m_session_lock
Internal lock, for session attributes.
Definition: pfs_instr.h:573
void set_history(bool history)
Definition: pfs_instr.h:689
socklen_t m_sock_addr_len
Length of address.
Definition: pfs_instr.h:658
PFS_thread_class * m_class
Thread class.
Definition: pfs_instr.h:489
const char * current_key_name
Definition: pfs_instr.h:726
ulonglong m_thread_internal_id
Internal thread identifier, unique.
Definition: pfs_instr.h:480
void set_instr_class_memory_stats(PFS_memory_safe_stat *array)
Definition: pfs_instr.h:704
PFS_schema_name m_db_name
Database name.
Definition: pfs_instr.h:591
bool m_flag_events_stages_history
Derived flag flag_events_stages_history, per thread.
Definition: pfs_instr.h:407
uint m_peer_port
Remote (peer) port.
Definition: pfs_instr.h:654
ulonglong m_parent_thread_internal_id
Parent internal thread identifier.
Definition: pfs_instr.h:482
uint m_processlist_info_length
Length of m_processlist_info_length.
Definition: pfs_instr.h:634
LF_PINS * m_setup_actor_hash_pins
Pins for setup_actor_hash.
Definition: pfs_instr.h:466
PFS_memory_safe_stat * m_instr_class_memory_stats
Per thread memory aggregated statistics.
Definition: pfs_instr.h:702
LF_PINS * m_setup_object_hash_pins
Pins for setup_object_hash.
Definition: pfs_instr.h:468
my_thread_os_id_t m_thread_os_id
External (Operating system) thread identifier, if any.
Definition: pfs_instr.h:487
pfs_lock m_lock
Internal lock.
Definition: pfs_instr.h:460
enum_vio_type m_connection_type
Connection type.
Definition: pfs_instr.h:612
bool m_flag_events_waits_history_long
Derived flag flag_events_waits_history_long, per thread.
Definition: pfs_instr.h:399
bool m_stages_history_full
True if the circular buffer m_stages_history is full.
Definition: pfs_instr.h:536
LF_PINS * m_program_hash_pins
Pins for routine_hash.
Definition: pfs_instr.h:478
PFS_account * m_account
Definition: pfs_instr.h:651
bool m_debug_session_notified
Definition: pfs_instr.h:736
uint m_statements_history_index
Current index in the circular buffer m_statements_history.
Definition: pfs_instr.h:549
bool m_flag_events_statements_history
Derived flag flag_events_statements_history, per thread.
Definition: pfs_instr.h:423
THD * m_thd
Definition: pfs_instr.h:647
uint m_transactions_history_index
Current index in the circular buffer m_transactions_history.
Definition: pfs_instr.h:560
bool m_flag_events_waits_history
Derived flag flag_events_waits_history, per thread.
Definition: pfs_instr.h:391
ulonglong m_event_id
Event ID counter.
Definition: pfs_instr.h:452
void * m_user_data
User-defined data.
Definition: pfs_instr.h:608
bool m_enabled
Thread instrumentation flag.
Definition: pfs_instr.h:380
PFS_session_all_memory_stat m_session_all_memory_stat
Definition: pfs_instr.h:729
PFS_events_waits * m_waits_history
Waits history circular buffer.
Definition: pfs_instr.h:533
pfs_lock m_stmt_lock
Internal lock, for statement attributes.
Definition: pfs_instr.h:620
PFS_memory_safe_stat * write_instr_class_memory_stats()
Definition: pfs_instr.h:716
PFS_events_statements * m_statements_history
Statements history circular buffer.
Definition: pfs_instr.h:555
PFS_events_stages m_stage_current
Definition: pfs_instr.h:639
uint m_groupname_length
Length of m_groupname.
Definition: pfs_instr.h:602
const PFS_memory_safe_stat * read_instr_class_memory_stats() const
Definition: pfs_instr.h:709
telemetry_t * m_telemetry
Copy of g_telemetry.
Definition: pfs_instr.h:732
time_t m_start_time
Start time.
Definition: pfs_instr.h:614
uint m_stages_history_index
Current index in the circular buffer m_stages_history.
Definition: pfs_instr.h:538
bool m_flag_events_transactions_history_long
Derived flag flag_events_transactions_history_long, per thread.
Definition: pfs_instr.h:447
PFS_user_name m_user_name
User name.
Definition: pfs_instr.h:579
ulong m_processlist_id
External (.
Definition: pfs_instr.h:485
uint m_waits_history_index
Current index in the circular buffer m_waits_history.
Definition: pfs_instr.h:527
bool m_transactions_history_full
True if the circular buffer m_transactions_history is full.
Definition: pfs_instr.h:558
PFS_events_transactions * m_transactions_history
Statements history circular buffer.
Definition: pfs_instr.h:566
LF_PINS * m_host_hash_pins
Pins for host_hash.
Definition: pfs_instr.h:470
PFS_stage_key m_stage
Processlist state (derived from stage).
Definition: pfs_instr.h:622
PFS_host * m_host
Definition: pfs_instr.h:649
char * m_session_connect_attrs
Buffer for the connection attributes.
Definition: pfs_instr.h:667
LF_PINS * m_table_share_hash_pins
Pins for table_share_hash.
Definition: pfs_instr.h:464
Statistics for transaction usage.
Definition: pfs_stat.h:459
Definition: pfs_name.h:478
Per user statistics.
Definition: pfs_user.h:63
Interface for an instrumented condition.
Definition: psi_cond_bits.h:64
Interface for an instrumented mutex.
Definition: psi_mutex_bits.h:97
Interface for an instrumented rwlock.
Definition: psi_rwlock_bits.h:71
Interface for an instrumented socket descriptor.
Definition: psi_socket_bits.h:69
Interface for an instrumented stage progress.
Definition: psi_stage_bits.h:63
This structure is shared between different table objects.
Definition: table.h:731
A 'lock' protecting performance schema internal buffers.
Definition: pfs_lock.h:154
uint32 get_version()
Definition: pfs_lock.h:342
Definition: server_telemetry_traces_bits.h:137
Vio Lite.
enum_vio_type
Definition: violite.h:79
static void alive(server *s)
Definition: xcom_transport.cc:174