MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pfs_events_waits.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2011, 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 as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
15 
16 #ifndef PFS_EVENTS_WAITS_H
17 #define PFS_EVENTS_WAITS_H
18 
24 #include "pfs_column_types.h"
25 #include "pfs_lock.h"
26 #include "pfs_events.h"
27 
28 struct PFS_mutex;
29 struct PFS_rwlock;
30 struct PFS_cond;
31 struct PFS_table;
32 struct PFS_file;
33 struct PFS_thread;
34 struct PFS_socket;
35 struct PFS_instr_class;
36 struct PFS_table_share;
37 struct PFS_account;
38 struct PFS_user;
39 struct PFS_host;
40 
43 {
44  NO_WAIT_CLASS= 0,
45  WAIT_CLASS_MUTEX,
46  WAIT_CLASS_RWLOCK,
47  WAIT_CLASS_COND,
48  WAIT_CLASS_TABLE,
49  WAIT_CLASS_FILE,
50  WAIT_CLASS_SOCKET,
51  WAIT_CLASS_IDLE
52 };
53 
56 {
94  uint m_index;
96  ulong m_flags;
97 };
98 
100 #define STATE_FLAG_TIMED (1<<0)
101 
102 #define STATE_FLAG_THREAD (1<<1)
103 
104 #define STATE_FLAG_EVENT (1<<2)
105 
106 #define STATE_FLAG_DIGEST (1<<3)
107 
109 
111 
112 extern bool flag_events_waits_current;
113 extern bool flag_events_waits_history;
115 extern bool flag_global_instrumentation;
116 extern bool flag_thread_instrumentation;
117 
119 extern volatile uint32 events_waits_history_long_index;
121 extern ulong events_waits_history_long_size;
122 
123 int init_events_waits_history_long(uint events_waits_history_long_sizing);
125 
133 void reset_events_waits_global();
134 void aggregate_account_waits(PFS_account *account);
135 void aggregate_user_waits(PFS_user *user);
136 void aggregate_host_waits(PFS_host *host);
137 
138 void reset_table_waits_by_table();
139 void reset_table_io_waits_by_table();
140 void reset_table_lock_waits_by_table();
141 void reset_table_waits_by_table_handle();
142 void reset_table_io_waits_by_table_handle();
143 void reset_table_lock_waits_by_table_handle();
144 
145 #endif
146