1 /* Copyright (c) 2012, 2015, 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 as published by
5   the Free Software Foundation; version 2 of the License.
6 
7   This program is distributed in the hope that it will be useful,
8   but WITHOUT ANY WARRANTY; without even the implied warranty of
9   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10   GNU General Public License for more details.
11 
12   You should have received a copy of the GNU General Public License
13   along with this program; if not, write to the Free Software Foundation,
14   51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
15 
16 #ifndef PFS_TABLE_PROVIDER_H
17 #define PFS_TABLE_PROVIDER_H
18 
19 /**
20   @file include/pfs_table_provider.h
21   Performance schema instrumentation (declarations).
22 */
23 
24 #ifdef HAVE_PSI_TABLE_INTERFACE
25 #ifdef MYSQL_SERVER
26 #ifndef EMBEDDED_LIBRARY
27 #ifndef MYSQL_DYNAMIC_PLUGIN
28 
29 #include "mysql/psi/psi.h"
30 
31 #define PSI_TABLE_CALL(M) pfs_ ## M ## _v1
32 
33 C_MODE_START
34 
35 PSI_table_share*
36 pfs_get_table_share_v1(my_bool temporary, struct TABLE_SHARE *share);
37 
38 void pfs_release_table_share_v1(PSI_table_share* share);
39 
40 void
41 pfs_drop_table_share_v1(my_bool temporary,
42                         const char *schema_name, int schema_name_length,
43                         const char *table_name, int table_name_length);
44 
45 PSI_table*
46 pfs_open_table_v1(PSI_table_share *share, const void *identity);
47 
48 void pfs_unbind_table_v1(PSI_table *table);
49 
50 PSI_table *
51 pfs_rebind_table_v1(PSI_table_share *share, const void *identity, PSI_table *table);
52 
53 void pfs_close_table_v1(struct TABLE_SHARE *server_share, PSI_table *table);
54 
55 PSI_table_locker*
56 pfs_start_table_io_wait_v1(PSI_table_locker_state *state,
57                            PSI_table *table,
58                            PSI_table_io_operation op,
59                            uint index,
60                            const char *src_file, uint src_line);
61 
62 PSI_table_locker*
63 pfs_start_table_lock_wait_v1(PSI_table_locker_state *state,
64                              PSI_table *table,
65                              PSI_table_lock_operation op,
66                              ulong op_flags,
67                              const char *src_file, uint src_line);
68 
69 void pfs_end_table_io_wait_v1(PSI_table_locker* locker, ulonglong numrows);
70 
71 void pfs_end_table_lock_wait_v1(PSI_table_locker* locker);
72 
73 void pfs_unlock_table_v1(PSI_table *table);
74 
75 C_MODE_END
76 
77 #endif /* MYSQL_DYNAMIC_PLUGIN */
78 #endif /* EMBEDDED_LIBRARY */
79 #endif /* MYSQL_SERVER */
80 #endif /* HAVE_PSI_TABLE_INTERFACE */
81 
82 #endif
83 
84