MySQL 9.0.0
Source Code Documentation
pfs_file_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_FILE_PROVIDER_H
25#define PFS_FILE_PROVIDER_H
26
27/**
28 @file include/pfs_file_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_FILE_INTERFACE
38#if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
39#ifndef MYSQL_DYNAMIC_PLUGIN
40#ifndef WITH_LOCK_ORDER
41
42#include <stddef.h>
43
44#include "my_inttypes.h"
45#include "my_io.h"
46#include "my_macros.h"
47#include "mysql/psi/psi_file.h"
48
49/*
50 Naming current apis as _vc (version 'current'),
51 to avoid changing the names every time
52 psi_file_v<N> is replaced by psi_file_v<N+1>.
53*/
54
55#define PSI_FILE_CALL(M) pfs_##M##_vc
56
57void pfs_register_file_vc(const char *category, PSI_file_info_v1 *info,
58 int count);
59
61
64 const char *name, const void *identity);
65
68
71
72void pfs_start_file_open_wait_vc(PSI_file_locker *locker, const char *src_file,
73 uint src_line);
74
76
78 File file);
79
81 PSI_file_locker *locker, File file, const char *filename);
82
84 const char *src_file, uint src_line);
85
86void pfs_end_file_wait_vc(PSI_file_locker *locker, size_t byte_count);
87
88void pfs_start_file_close_wait_vc(PSI_file_locker *locker, const char *src_file,
89 uint src_line);
90
92
94 const char *old_name, const char *new_name,
95 const char *src_file, uint src_line);
96
97void pfs_end_file_rename_wait_vc(PSI_file_locker *locker, const char *old_name,
98 const char *new_name, int rc);
99
100#endif /* WITH_LOCK_ORDER */
101#endif /* MYSQL_DYNAMIC_PLUGIN */
102#endif /* MYSQL_SERVER || PFS_DIRECT_CALL */
103#endif /* HAVE_PSI_FILE_INTERFACE */
104
105#endif
struct PSI_file PSI_file
Definition: psi_file_bits.h:55
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:48
struct PSI_file_locker PSI_file_locker
Definition: psi_file_bits.h:62
PSI_file_operation
Operation performed on an instrumented file.
Definition: psi_file_bits.h:65
Some integer typedefs for easier portability.
Common #defines and includes for file and socket I/O.
int File
Definition: my_io_bits.h:51
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
Definition: os0file.h:89
static const char * category
Definition: sha2_password.cc:170
const char * filename
Definition: pfs_example_component_population.cc:67
void pfs_create_file_vc(PSI_file_key key, const char *name, File file)
Implementation of the file instrumentation interface.
Definition: pfs.cc:2959
void pfs_start_file_close_wait_vc(PSI_file_locker *locker, const char *src_file, uint src_line)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5774
void pfs_end_file_close_wait_vc(PSI_file_locker *locker, int rc)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5799
PSI_file_locker * pfs_get_thread_file_descriptor_locker_vc(PSI_file_locker_state *state, File file, PSI_file_operation op)
Implementation of the file instrumentation interface.
Definition: pfs.cc:4560
PSI_file_locker * pfs_get_thread_file_name_locker_vc(PSI_file_locker_state *state, PSI_file_key key, PSI_file_operation op, const char *name, const void *identity)
Implementation of the file instrumentation interface.
Definition: pfs.cc:4353
void pfs_end_file_open_wait_and_bind_to_descriptor_vc(PSI_file_locker *locker, File file)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5584
PSI_file * pfs_end_file_open_wait_vc(PSI_file_locker *locker, void *result)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5549
void pfs_end_file_rename_wait_vc(PSI_file_locker *locker, const char *old_name, const char *new_name, int rc)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5867
void pfs_start_file_wait_vc(PSI_file_locker *locker, size_t count, const char *src_file, uint src_line)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5638
void pfs_end_temp_file_open_wait_and_bind_to_descriptor_vc(PSI_file_locker *locker, File file, const char *filename)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5618
void pfs_register_file_vc(const char *category, PSI_file_info_v1 *info, int count)
Implementation of the file instrumentation interface.
Definition: pfs.cc:2568
PSI_file_locker * pfs_get_thread_file_stream_locker_vc(PSI_file_locker_state *state, PSI_file *file, PSI_file_operation op)
Implementation of the file instrumentation interface.
Definition: pfs.cc:4463
void pfs_start_file_open_wait_vc(PSI_file_locker *locker, const char *src_file, uint src_line)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5540
void pfs_end_file_wait_vc(PSI_file_locker *locker, size_t byte_count)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5666
void pfs_start_file_rename_wait_vc(PSI_file_locker *locker, size_t count, const char *old_name, const char *new_name, const char *src_file, uint src_line)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5844
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
case opt name
Definition: sslopt-case.h:29
File instrument information.
Definition: psi_file_bits.h:114
State data storage for get_thread_file_name_locker_v1_t.
Definition: psi_file_bits.h:146
Definition: result.h:30