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