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