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