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