MySQL  8.0.27
Source Code Documentation
pfs_file_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_FILE_PROVIDER_H
24 #define PFS_FILE_PROVIDER_H
25 
26 /**
27  @file include/pfs_file_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_FILE_INTERFACE
37 #if defined(MYSQL_SERVER) || defined(PFS_DIRECT_CALL)
38 #ifndef MYSQL_DYNAMIC_PLUGIN
39 #ifndef WITH_LOCK_ORDER
40 
41 #include <stddef.h>
42 
43 #include "my_inttypes.h"
44 #include "my_io.h"
45 #include "my_macros.h"
46 #include "mysql/psi/psi_file.h"
47 
48 /*
49  Naming current apis as _vc (version 'current'),
50  to avoid changing the names every time
51  psi_file_v<N> is replaced by psi_file_v<N+1>.
52 */
53 
54 #define PSI_FILE_CALL(M) pfs_##M##_vc
55 
57  int count);
58 
59 void pfs_create_file_vc(PSI_file_key key, const char *name, File file);
60 
63  const char *name, const void *identity);
64 
67 
70 
71 void pfs_start_file_open_wait_vc(PSI_file_locker *locker, const char *src_file,
72  uint src_line);
73 
75 
77  File file);
78 
80  PSI_file_locker *locker, File file, const char *filename);
81 
82 void pfs_start_file_wait_vc(PSI_file_locker *locker, size_t count,
83  const char *src_file, uint src_line);
84 
85 void pfs_end_file_wait_vc(PSI_file_locker *locker, size_t byte_count);
86 
87 void pfs_start_file_close_wait_vc(PSI_file_locker *locker, const char *src_file,
88  uint src_line);
89 
90 void pfs_end_file_close_wait_vc(PSI_file_locker *locker, int rc);
91 
93  const char *old_name, const char *new_name,
94  const char *src_file, uint src_line);
95 
96 void pfs_end_file_rename_wait_vc(PSI_file_locker *locker, const char *old_name,
97  const char *new_name, int rc);
98 
99 #endif /* WITH_LOCK_ORDER */
100 #endif /* MYSQL_DYNAMIC_PLUGIN */
101 #endif /* MYSQL_SERVER || PFS_DIRECT_CALL */
102 #endif /* HAVE_PSI_FILE_INTERFACE */
103 
104 #endif
struct PSI_file PSI_file
Definition: psi_file_bits.h:54
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:47
struct PSI_file_locker PSI_file_locker
Definition: psi_file_bits.h:61
PSI_file_operation
Operation performed on an instrumented file.
Definition: psi_file_bits.h:64
Some integer typedefs for easier portability.
Common #defines and includes for file and socket I/O.
int File
Definition: my_io_bits.h:50
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")
Definition: os0file.h:85
static const char * category
Definition: sha2_password.cc:168
const char * filename
Definition: pfs_example_component_population.cc:64
void pfs_create_file_vc(PSI_file_key key, const char *name, File file)
Implementation of the file instrumentation interface.
Definition: pfs.cc:2842
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:5608
void pfs_end_file_close_wait_vc(PSI_file_locker *locker, int rc)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5636
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:4370
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:5412
void pfs_end_file_rename_wait_vc(PSI_file_locker *locker, const char *old_name, const char *new_name, int rc)
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:5468
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:4163
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:5447
void pfs_register_file_vc(const char *category, PSI_file_info_v1 *info, int count)
Implementation of the file instrumentation interface.
Definition: pfs.cc:2449
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:4273
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:5364
void pfs_end_file_wait_vc(PSI_file_locker *locker, size_t byte_count)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5498
PSI_file * pfs_end_file_open_wait_vc(PSI_file_locker *locker, void *result)
Implementation of the file instrumentation interface.
Definition: pfs.cc:5375
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)
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
case opt name
Definition: sslopt-case.h:32
File instrument information.
Definition: psi_file_bits.h:113
State data storage for get_thread_file_name_locker_v1_t.
Definition: psi_file_bits.h:145
Definition: result.h:29
unsigned int uint
Definition: uca-dump.cc:29