MySQL  8.0.21
Source Code Documentation
psi_file.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 MYSQL_PSI_FILE_H
24 #define MYSQL_PSI_FILE_H
25 
26 /**
27  @file include/mysql/psi/psi_file.h
28  Performance schema instrumentation interface.
29 
30  @defgroup psi_abi_file File Instrumentation (ABI)
31  @ingroup psi_abi
32  @{
33 */
34 
35 #include "my_macros.h"
36 #include "my_psi_config.h" // IWYU pragma: keep
37 #include "my_sharedlib.h"
39 
40 /**
41  @def PSI_FILE_VERSION_1
42  Performance Schema File Interface number for version 1.
43  This version is obsolete.
44 */
45 #define PSI_FILE_VERSION_1 1
46 
47 /**
48  @def PSI_FILE_VERSION_2
49  Performance Schema File Interface number for version 2.
50  This version is supported.
51 */
52 #define PSI_FILE_VERSION_2 2
53 
54 /**
55  @def PSI_CURRENT_FILE_VERSION
56  Performance Schema File Interface number for the most recent version.
57  The most current version is @c PSI_FILE_VERSION_2
58 */
59 #define PSI_CURRENT_FILE_VERSION 2
60 
61 /** Entry point for the performance schema interface. */
63  /**
64  ABI interface finder.
65  Calling this method with an interface version number returns either
66  an instance of the ABI for this version, or NULL.
67  @sa PSI_FILE_VERSION_1
68  @sa PSI_FILE_VERSION_2
69  @sa PSI_CURRENT_FILE_VERSION
70  */
71  void *(*get_interface)(int version);
72 };
73 
74 #ifdef HAVE_PSI_FILE_INTERFACE
75 
76 /**
77  Performance Schema file Interface, version 2.
78  @since PSI_FILE_VERSION_2
79 */
81  /** @sa register_file_v1_t. */
83  /** @sa create_file_v1_t. */
85  /** @sa get_thread_file_name_locker_v1_t. */
87  /** @sa get_thread_file_stream_locker_v1_t. */
89  /** @sa get_thread_file_descriptor_locker_v1_t. */
91  /** @sa start_file_open_wait_v1_t. */
93  /** @sa end_file_open_wait_v1_t. */
95  /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */
98  /** @sa end_temp_file_open_wait_and_bind_to_descriptor_v1_t. */
101  /** @sa start_file_wait_v1_t. */
103  /** @sa end_file_wait_v1_t. */
105  /** @sa start_file_close_wait_v1_t. */
107  /** @sa end_file_close_wait_v1_t. */
109  /** @sa start_file_rename_wait_v1_t. */
111  /** @sa end_file_rename_wait_v1_t. */
113 };
114 
116 
118 
119 #endif /* HAVE_PSI_FILE_INTERFACE */
120 
121 /** @} (end of group psi_abi_file) */
122 
123 #endif /* MYSQL_PSI_FILE_H */
Some common macros.
void(* start_file_rename_wait_v1_t)(struct PSI_file_locker *locker, size_t count, const char *old_name, const char *new_name, const char *src_file, unsigned int src_line)
Record a file instrumentation start event.
Definition: psi_file_bits.h:311
end_file_open_wait_and_bind_to_descriptor_v1_t end_file_open_wait_and_bind_to_descriptor
Definition: psi_file.h:97
end_file_close_wait_v1_t end_file_close_wait
Definition: psi_file.h:108
void(* start_file_close_wait_v1_t)(struct PSI_file_locker *locker, const char *src_file, unsigned int src_line)
Start a file instrumentation close operation.
Definition: psi_file_bits.h:290
void(* end_temp_file_open_wait_and_bind_to_descriptor_v1_t)(struct PSI_file_locker *locker, File file, const char *filename)
End a file instrumentation open operation, for non stream temporary files.
Definition: psi_file_bits.h:255
start_file_close_wait_v1_t start_file_close_wait
Definition: psi_file.h:106
end_temp_file_open_wait_and_bind_to_descriptor_v1_t end_temp_file_open_wait_and_bind_to_descriptor
Definition: psi_file.h:100
void(* start_file_wait_v1_t)(struct PSI_file_locker *locker, size_t count, const char *src_file, unsigned int src_line)
Record a file instrumentation start event.
Definition: psi_file_bits.h:265
void(* end_file_wait_v1_t)(struct PSI_file_locker *locker, size_t count)
Record a file instrumentation end event.
Definition: psi_file_bits.h:281
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
void(* end_file_close_wait_v1_t)(struct PSI_file_locker *locker, int rc)
End a file instrumentation close operation.
Definition: psi_file_bits.h:299
get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker
Definition: psi_file.h:90
struct PSI_file_locker *(* get_thread_file_stream_locker_v1_t)(struct PSI_file_locker_state_v1 *state, struct PSI_file *file, enum PSI_file_operation op)
Get a file stream instrumentation locker.
Definition: psi_file_bits.h:207
struct PSI_file_locker *(* get_thread_file_name_locker_v1_t)(struct PSI_file_locker_state_v1 *state, PSI_file_key key, enum PSI_file_operation op, const char *name, const void *identity)
Get a file instrumentation locker, for opening or creating a file.
Definition: psi_file_bits.h:196
void(* start_file_open_wait_v1_t)(struct PSI_file_locker *locker, const char *src_file, unsigned int src_line)
Start a file instrumentation open operation.
Definition: psi_file_bits.h:228
Functions related to handling of plugins and other dynamically loaded libraries.
Performance schema instrumentation interface.
void(* end_file_open_wait_and_bind_to_descriptor_v1_t)(struct PSI_file_locker *locker, File file)
End a file instrumentation open operation, for non stream files.
Definition: psi_file_bits.h:246
get_thread_file_stream_locker_v1_t get_thread_file_stream_locker
Definition: psi_file.h:88
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
void(* end_file_rename_wait_v1_t)(struct PSI_file_locker *locker, const char *old_name, const char *new_name, int rc)
Rename a file instrumentation close operation.
Definition: psi_file_bits.h:323
start_file_rename_wait_v1_t start_file_rename_wait
Definition: psi_file.h:110
const string version("\ersion\)
Performance Schema file Interface, version 2.
Definition: psi_file.h:80
struct PSI_file_locker *(* get_thread_file_descriptor_locker_v1_t)(struct PSI_file_locker_state_v1 *state, File file, enum PSI_file_operation op)
Get a file instrumentation locker.
Definition: psi_file_bits.h:218
end_file_open_wait_v1_t end_file_open_wait
Definition: psi_file.h:94
void(* create_file_v1_t)(PSI_file_key key, const char *name, File file)
Create a file instrumentation for a created file.
Definition: psi_file_bits.h:185
start_file_wait_v1_t start_file_wait
Definition: psi_file.h:102
struct PSI_file *(* end_file_open_wait_v1_t)(struct PSI_file_locker *locker, void *result)
End a file instrumentation open operation, for file streams.
Definition: psi_file_bits.h:238
register_file_v1_t register_file
Definition: psi_file.h:82
void(* register_file_v1_t)(const char *category, struct PSI_file_info_v1 *info, int count)
File registration API.
Definition: psi_file_bits.h:174
end_file_wait_v1_t end_file_wait
Definition: psi_file.h:104
Entry point for the performance schema interface.
Definition: psi_file.h:62
create_file_v1_t create_file
Definition: psi_file.h:84
get_thread_file_name_locker_v1_t get_thread_file_name_locker
Definition: psi_file.h:86
start_file_open_wait_v1_t start_file_open_wait
Definition: psi_file.h:92
MYSQL_PLUGIN_IMPORT PSI_file_service_t * psi_file_service
Definition: psi_noop.cc:420
end_file_rename_wait_v1_t end_file_rename_wait
Definition: psi_file.h:112