MySQL 9.1.0
Source Code Documentation
pfs_statement_provider.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 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_STATEMENT_PROVIDER_H
25#define PFS_STATEMENT_PROVIDER_H
26
27/**
28 @file include/pfs_statement_provider.h
29 Performance schema instrumentation (declarations).
30*/
31
32#include <sys/types.h>
33
34/* HAVE_PSI_*_INTERFACE */
35#include "my_psi_config.h" // IWYU pragma: keep
36
37#ifdef HAVE_PSI_STATEMENT_INTERFACE
38#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
39#ifndef MYSQL_DYNAMIC_PLUGIN
40#ifndef WITH_LOCK_ORDER
41
42#include "my_inttypes.h"
43#include "my_macros.h"
45#include "sql/sql_digest.h"
46
49
50#define PSI_STATEMENT_CALL(M) pfs_##M##_vc
51#define PSI_DIGEST_CALL(M) pfs_##M##_vc
52#define PSI_PS_CALL(M) pfs_##M##_vc
53
55 int count);
56
59 const void *charset, PSI_sp_share *sp_share);
60
63
64void pfs_start_statement_vc(PSI_statement_locker *locker, const char *db,
65 uint db_len, const char *src_file, uint src_line);
66
67void pfs_set_statement_text_vc(PSI_statement_locker *locker, const char *text,
68 uint text_len);
69
72
75
78
81
83 ulong count);
84
86 ulong count);
87
89 ulong count);
90
92 ulong count);
93
95 ulong count);
96
98 ulong count);
99
101 ulong count);
102
104 ulong count);
105
107
109
111
113
115
117 bool with_query_attributes);
118
120
122 bool secondary);
123
124void pfs_end_statement_vc(PSI_statement_locker *locker, void *stmt_da);
125
126PSI_prepared_stmt *pfs_create_prepared_stmt_vc(void *identity, uint stmt_id,
127 PSI_statement_locker *locker,
128 const char *stmt_name,
129 size_t stmt_name_length,
130 const char *sql_text,
131 size_t sql_text_length);
132
134
136
139
141 const char *text, uint text_len);
142
144 bool secondary);
145
147
149 const sql_digest_storage *digest);
150
151#endif /* WITH_LOCK_ORDER */
152#endif /* MYSQL_DYNAMIC_PLUGIN */
153#endif /* MYSQL_SERVER || PFS_DIRECT_CALL */
154#endif /* HAVE_PSI_STATEMENT_INTERFACE */
155
156#endif
struct PSI_digest_locker PSI_digest_locker
Definition: psi_statement_bits.h:112
unsigned int PSI_statement_key
Instrumented statement key.
Definition: psi_statement_bits.h:49
struct PSI_prepared_stmt PSI_prepared_stmt
Definition: psi_statement_bits.h:105
struct PSI_sp_share PSI_sp_share
Definition: psi_statement_bits.h:119
struct PSI_statement_locker PSI_statement_locker
Definition: psi_statement_bits.h:98
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Some common macros.
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
static int count
Definition: myisam_ftdump.cc:45
const std::string charset("charset")
static const char * category
Definition: sha2_password.cc:170
void pfs_register_statement_vc(const char *category, PSI_statement_info *info, int count)
Definition: pfs.cc:2616
void pfs_inc_statement_select_range_check_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6874
PSI_statement_locker * pfs_refine_statement_vc(PSI_statement_locker *locker, PSI_statement_key key)
Definition: pfs.cc:6386
void pfs_inc_statement_created_tmp_tables_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6854
void pfs_set_statement_lock_time_vc(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6834
void pfs_execute_prepared_stmt_vc(PSI_statement_locker *locker, PSI_prepared_stmt *ps)
Definition: pfs.cc:8207
void pfs_set_statement_secondary_engine_vc(PSI_statement_locker *locker, bool secondary)
Definition: pfs.cc:6910
void pfs_inc_statement_created_tmp_disk_tables_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6849
void pfs_inc_statement_select_full_join_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6859
void pfs_inc_statement_sort_scan_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6898
void pfs_digest_end_vc(PSI_digest_locker *locker, const sql_digest_storage *digest)
Definition: pfs.cc:8097
void pfs_reprepare_prepared_stmt_vc(PSI_prepared_stmt *prepared_stmt)
Definition: pfs.cc:8222
PSI_prepared_stmt * pfs_create_prepared_stmt_vc(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:8137
void pfs_set_statement_query_id_vc(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6820
void pfs_inc_statement_select_scan_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6879
void pfs_statement_abort_telemetry_vc(PSI_statement_locker *locker)
Definition: pfs.cc:7646
void pfs_inc_statement_sort_range_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6889
void pfs_notify_statement_query_attributes_vc(PSI_statement_locker *locker, bool with_query_attributes)
Definition: pfs.cc:7612
PSI_digest_locker * pfs_digest_start_vc(PSI_statement_locker *locker)
Definition: pfs.cc:8085
void pfs_set_statement_no_index_used_vc(PSI_statement_locker *locker)
Definition: pfs.cc:6902
void pfs_inc_statement_sort_merge_passes_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6884
void pfs_set_statement_text_vc(PSI_statement_locker *locker, const char *text, uint text_len)
Definition: pfs.cc:6746
void pfs_set_prepared_stmt_secondary_engine_vc(PSI_prepared_stmt *prepared_stmt, bool secondary)
Definition: pfs.cc:8247
void pfs_destroy_prepared_stmt_vc(PSI_prepared_stmt *prepared_stmt)
Definition: pfs.cc:8216
void pfs_inc_statement_sort_rows_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6894
void pfs_end_statement_vc(PSI_statement_locker *locker, void *stmt_da)
Definition: pfs.cc:6927
void pfs_inc_statement_select_range_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6869
void pfs_inc_statement_select_full_range_join_vc(PSI_statement_locker *locker, ulong count)
Definition: pfs.cc:6864
PSI_statement_locker * pfs_get_thread_statement_locker_vc(PSI_statement_locker_state *state, PSI_statement_key key, const void *charset, PSI_sp_share *sp_share)
This is the entry point to the performance schema statement instrumentation.
Definition: pfs.cc:6354
void pfs_set_statement_rows_examined_vc(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6844
void pfs_set_statement_rows_sent_vc(PSI_statement_locker *locker, ulonglong count)
Definition: pfs.cc:6839
void pfs_start_statement_vc(PSI_statement_locker *locker, const char *db, uint db_len, const char *src_file, uint src_line)
Definition: pfs.cc:6439
void pfs_set_prepared_stmt_text_vc(PSI_prepared_stmt *prepared_stmt, const char *text, uint text_len)
Definition: pfs.cc:8232
void pfs_set_statement_no_good_index_used_vc(PSI_statement_locker *locker)
Definition: pfs.cc:6906
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Statement instrument information.
Definition: psi_statement_bits.h:133
State data storage for get_thread_statement_locker_v5_t.
Definition: psi_statement_bits.h:166
Structure to store token count/array for a statement on which digest is to be calculated.
Definition: sql_digest.h:98