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