MySQL 8.0.39
Source Code Documentation
psi_file.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 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 MYSQL_PSI_FILE_H
25#define MYSQL_PSI_FILE_H
26
27/**
28 @file include/mysql/psi/psi_file.h
29 Performance schema instrumentation interface.
30
31 @defgroup psi_abi_file File Instrumentation (ABI)
32 @ingroup psi_abi
33 @{
34*/
35
36#include "my_macros.h"
37
38/* HAVE_PSI_*_INTERFACE */
39#include "my_psi_config.h" // IWYU pragma: keep
40
41#include "my_sharedlib.h"
43
44/**
45 @def PSI_FILE_VERSION_1
46 Performance Schema File Interface number for version 1.
47 This version is obsolete.
48*/
49#define PSI_FILE_VERSION_1 1
50
51/**
52 @def PSI_FILE_VERSION_2
53 Performance Schema File Interface number for version 2.
54 This version is supported.
55*/
56#define PSI_FILE_VERSION_2 2
57
58/**
59 @def PSI_CURRENT_FILE_VERSION
60 Performance Schema File Interface number for the most recent version.
61 The most current version is @c PSI_FILE_VERSION_2
62*/
63#define PSI_CURRENT_FILE_VERSION 2
64
65/** Entry point for the performance schema interface. */
67 /**
68 ABI interface finder.
69 Calling this method with an interface version number returns either
70 an instance of the ABI for this version, or NULL.
71 @sa PSI_FILE_VERSION_1
72 @sa PSI_FILE_VERSION_2
73 @sa PSI_CURRENT_FILE_VERSION
74 */
75 void *(*get_interface)(int version);
76};
77
78#ifdef HAVE_PSI_FILE_INTERFACE
79
80/**
81 Performance Schema file Interface, version 2.
82 @since PSI_FILE_VERSION_2
83*/
85 /** @sa register_file_v1_t. */
87 /** @sa create_file_v1_t. */
89 /** @sa get_thread_file_name_locker_v1_t. */
91 /** @sa get_thread_file_stream_locker_v1_t. */
93 /** @sa get_thread_file_descriptor_locker_v1_t. */
95 /** @sa start_file_open_wait_v1_t. */
97 /** @sa end_file_open_wait_v1_t. */
99 /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */
102 /** @sa end_temp_file_open_wait_and_bind_to_descriptor_v1_t. */
105 /** @sa start_file_wait_v1_t. */
107 /** @sa end_file_wait_v1_t. */
109 /** @sa start_file_close_wait_v1_t. */
111 /** @sa end_file_close_wait_v1_t. */
113 /** @sa start_file_rename_wait_v1_t. */
115 /** @sa end_file_rename_wait_v1_t. */
117};
118
120
122
123#endif /* HAVE_PSI_FILE_INTERFACE */
124
125/** @} (end of group psi_abi_file) */
126
127#endif /* MYSQL_PSI_FILE_H */
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:313
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:325
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:283
MYSQL_PLUGIN_IMPORT PSI_file_service_t * psi_file_service
Definition: psi_noop.cc:440
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:240
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:267
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:220
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:248
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:292
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:209
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:257
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:187
void(* register_file_v1_t)(const char *category, struct PSI_file_info_v1 *info, int count)
File registration API.
Definition: psi_file_bits.h:176
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:301
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:198
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:230
Some common macros.
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:71
Performance schema instrumentation interface.
required uint64 version
Definition: replication_group_member_actions.proto:41
Entry point for the performance schema interface.
Definition: psi_file.h:66
Performance Schema file Interface, version 2.
Definition: psi_file.h:84
start_file_close_wait_v1_t start_file_close_wait
Definition: psi_file.h:110
end_file_close_wait_v1_t end_file_close_wait
Definition: psi_file.h:112
get_thread_file_stream_locker_v1_t get_thread_file_stream_locker
Definition: psi_file.h:92
get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker
Definition: psi_file.h:94
end_file_rename_wait_v1_t end_file_rename_wait
Definition: psi_file.h:116
end_file_wait_v1_t end_file_wait
Definition: psi_file.h:108
end_file_open_wait_and_bind_to_descriptor_v1_t end_file_open_wait_and_bind_to_descriptor
Definition: psi_file.h:101
end_file_open_wait_v1_t end_file_open_wait
Definition: psi_file.h:98
create_file_v1_t create_file
Definition: psi_file.h:88
start_file_rename_wait_v1_t start_file_rename_wait
Definition: psi_file.h:114
get_thread_file_name_locker_v1_t get_thread_file_name_locker
Definition: psi_file.h:90
register_file_v1_t register_file
Definition: psi_file.h:86
start_file_open_wait_v1_t start_file_open_wait
Definition: psi_file.h:96
end_temp_file_open_wait_and_bind_to_descriptor_v1_t end_temp_file_open_wait_and_bind_to_descriptor
Definition: psi_file.h:104
start_file_wait_v1_t start_file_wait
Definition: psi_file.h:106