MySQL  8.0.27
Source Code Documentation
pfs_statement_provider.h
Go to the documentation of this file.
1 /* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef PFS_STATEMENT_PROVIDER_H
24 #define PFS_STATEMENT_PROVIDER_H
25 
26 /**
27  @file include/pfs_statement_provider.h
28  Performance schema instrumentation (declarations).
29 */
30 
31 #include <sys/types.h>
32 
33 /* HAVE_PSI_*_INTERFACE */
34 #include "my_psi_config.h" // IWYU pragma: keep
35 
36 #ifdef HAVE_PSI_STATEMENT_INTERFACE
37 #if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
38 #ifndef MYSQL_DYNAMIC_PLUGIN
39 #ifndef WITH_LOCK_ORDER
40 
41 #include "my_inttypes.h"
42 #include "my_macros.h"
44 #include "sql/sql_digest.h"
45 
46 struct PSI_digest_locker;
47 struct sql_digest_storage;
48 
49 #define PSI_STATEMENT_CALL(M) pfs_##M##_v2
50 #define PSI_DIGEST_CALL(M) pfs_##M##_v2
51 #define PSI_PS_CALL(M) pfs_##M##_v2
52 
54  int count);
55 
58  const void *charset, PSI_sp_share *sp_share);
59 
62 
63 void pfs_start_statement_v2(PSI_statement_locker *locker, const char *db,
64  uint db_len, const char *src_file, uint src_line);
65 
66 void pfs_set_statement_text_v2(PSI_statement_locker *locker, const char *text,
67  uint text_len);
68 
71 
74 
77 
80 
82  ulong count);
83 
85  ulong count);
86 
88  ulong count);
89 
91  ulong count);
92 
94  ulong count);
95 
97  ulong count);
98 
100  ulong count);
101 
103  ulong count);
104 
106 
108 
110 
112 
114 
115 void pfs_end_statement_v2(PSI_statement_locker *locker, void *stmt_da);
116 
117 PSI_prepared_stmt *pfs_create_prepared_stmt_v2(void *identity, uint stmt_id,
118  PSI_statement_locker *locker,
119  const char *stmt_name,
120  size_t stmt_name_length,
121  const char *sql_text,
122  size_t sql_text_length);
123 
125 
127 
129  PSI_prepared_stmt *ps);
130 
132  const char *text, uint text_len);
133 
135 
137  const sql_digest_storage *digest);
138 
139 #endif /* WITH_LOCK_ORDER */
140 #endif /* MYSQL_DYNAMIC_PLUGIN */
141 #endif /* MYSQL_SERVER || PFS_DIRECT_CALL */
142 #endif /* HAVE_PSI_STATEMENT_INTERFACE */
143 
144 #endif
struct PSI_digest_locker PSI_digest_locker
Definition: psi_statement_bits.h:89
unsigned int PSI_statement_key
Instrumented statement key.
Definition: psi_statement_bits.h:47
struct PSI_prepared_stmt PSI_prepared_stmt
Definition: psi_statement_bits.h:82
struct PSI_sp_share PSI_sp_share
Definition: psi_statement_bits.h:96
struct PSI_statement_locker PSI_statement_locker
Definition: psi_statement_bits.h:75
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
Some common macros.
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
static int count
Definition: myisam_ftdump.cc:42
Log info(cout, "NOTE")
const std::string charset("charset")
static const char * category
Definition: sha2_password.cc:168
void pfs_inc_statement_select_full_range_join_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6313
void pfs_inc_statement_sort_rows_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6343
void pfs_inc_statement_sort_merge_passes_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6333
void pfs_inc_statement_sort_scan_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6347
void pfs_start_statement_v2(PSI_statement_locker *locker, const char *db, uint db_len, const char *src_file, uint src_line)
Definition: pfs.cc:6151
PSI_statement_locker * pfs_refine_statement_v2(PSI_statement_locker *locker, PSI_statement_key key)
Definition: pfs.cc:6103
void pfs_set_statement_no_index_used_v2(PSI_statement_locker *locker)
Definition: pfs.cc:6351
void pfs_set_statement_rows_examined_v2(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6293
void pfs_inc_statement_select_full_join_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6308
void pfs_inc_statement_created_tmp_tables_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6303
void pfs_set_statement_query_id_v2(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6264
void pfs_destroy_prepared_stmt_v2(PSI_prepared_stmt *prepared_stmt)
Definition: pfs.cc:7405
void pfs_end_statement_v2(PSI_statement_locker *locker, void *stmt_da)
Definition: pfs.cc:6359
void pfs_reprepare_prepared_stmt_v2(PSI_prepared_stmt *prepared_stmt)
Definition: pfs.cc:7412
PSI_digest_locker * pfs_digest_start_v2(PSI_statement_locker *locker)
Definition: pfs.cc:7301
void pfs_inc_statement_sort_range_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6338
void pfs_execute_prepared_stmt_v2(PSI_statement_locker *locker, PSI_prepared_stmt *ps)
Definition: pfs.cc:7395
void pfs_register_statement_v2(const char *category, PSI_statement_info *info, int count)
Definition: pfs.cc:2492
PSI_statement_locker * pfs_get_thread_statement_locker_v2(PSI_statement_locker_state *state, PSI_statement_key key, const void *charset, PSI_sp_share *sp_share)
Definition: pfs.cc:5912
void pfs_inc_statement_select_range_check_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6323
void pfs_set_statement_lock_time_v2(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6283
void pfs_digest_end_v2(PSI_digest_locker *locker, const sql_digest_storage *digest)
Definition: pfs.cc:7317
void pfs_set_statement_rows_sent_v2(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6288
void pfs_inc_statement_created_tmp_disk_tables_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6298
void pfs_inc_statement_select_range_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6318
void pfs_set_statement_no_good_index_used_v2(PSI_statement_locker *locker)
Definition: pfs.cc:6355
void pfs_inc_statement_select_scan_v2(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6328
void pfs_set_statement_text_v2(PSI_statement_locker *locker, const char *text, uint text_len)
Definition: pfs.cc:6194
void pfs_set_prepared_stmt_text_v2(PSI_prepared_stmt *prepared_stmt, const char *text, uint text_len)
Definition: pfs.cc:7423
PSI_prepared_stmt * pfs_create_prepared_stmt_v2(void *identity, uint stmt_id, PSI_statement_locker *locker, const char *stmt_name, size_t stmt_name_length, const char *sql_text, size_t sql_text_length)
Definition: pfs.cc:7363
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
Statement instrument information.
Definition: psi_statement_bits.h:110
State data storage for get_thread_statement_locker_v1_t, get_thread_statement_locker_v1_t.
Definition: psi_statement_bits.h:138
Structure to store token count/array for a statement on which digest is to be calculated.
Definition: sql_digest.h:97
unsigned int uint
Definition: uca-dump.cc:29