MySQL  8.0.17
Source Code Documentation
psi_mutex.h
Go to the documentation of this file.
1 /* Copyright (c) 2008, 2019, 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_MUTEX_H
24 #define MYSQL_PSI_MUTEX_H
25 
26 /**
27  @file include/mysql/psi/psi_mutex.h
28  Performance schema instrumentation interface.
29 
30  @defgroup psi_abi_mutex Mutex Instrumentation (ABI)
31  @ingroup psi_abi
32  @{
33 */
34 
35 #include "my_inttypes.h"
36 #include "my_macros.h"
37 #include "my_psi_config.h" // IWYU pragma: keep
38 #include "my_sharedlib.h"
40 
41 /** Entry point for the performance schema interface. */
43  /**
44  ABI interface finder.
45  Calling this method with an interface version number returns either
46  an instance of the ABI for this version, or NULL.
47  @sa PSI_MUTEX_VERSION_1
48  @sa PSI_MUTEX_VERSION_2
49  @sa PSI_CURRENT_MUTEX_VERSION
50  */
51  void *(*get_interface)(int version);
52 };
53 
54 #ifdef HAVE_PSI_MUTEX_INTERFACE
55 
56 /**
57  Performance Schema Mutex Interface, version 1.
58  @since PSI_MUTEX_VERSION_1
59 */
61  /** @sa register_mutex_v1_t. */
63  /** @sa init_mutex_v1_t. */
65  /** @sa destroy_mutex_v1_t. */
67  /** @sa start_mutex_wait_v1_t. */
69  /** @sa end_mutex_wait_v1_t. */
71  /** @sa unlock_mutex_v1_t. */
73 };
74 
76 
78 
79 #endif /* HAVE_PSI_MUTEX_INTERFACE */
80 
81 /** @} (end of group psi_abi_mutex) */
82 
83 #endif /* MYSQL_PSI_MUTEX_H */
Some common macros.
unlock_mutex_v1_t unlock_mutex
Definition: psi_mutex.h:72
start_mutex_wait_v1_t start_mutex_wait
Definition: psi_mutex.h:68
void(* end_mutex_wait_v1_t)(struct PSI_mutex_locker *locker, int rc)
Record a mutex instrumentation wait end event.
Definition: psi_mutex_bits.h:188
Entry point for the performance schema interface.
Definition: psi_mutex.h:42
Some integer typedefs for easier portability.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:70
struct PSI_mutex_locker *(* start_mutex_wait_v1_t)(struct PSI_mutex_locker_state_v1 *state, struct PSI_mutex *mutex, enum PSI_mutex_operation op, const char *src_file, unsigned int src_line)
Record a mutex instrumentation wait start event.
Definition: psi_mutex_bits.h:179
Functions related to handling of plugins and other dynamically loaded libraries.
void(* register_mutex_v1_t)(const char *category, struct PSI_mutex_info_v1 *info, int count)
Mutex registration API.
Definition: psi_mutex_bits.h:146
MYSQL_PLUGIN_IMPORT PSI_mutex_service_t * psi_mutex_service
Definition: psi_noop.cc:253
Performance Schema Mutex Interface, version 1.
Definition: psi_mutex.h:60
struct PSI_mutex *(* init_mutex_v1_t)(PSI_mutex_key key, const void *identity)
Mutex instrumentation initialization API.
Definition: psi_mutex_bits.h:155
Defines various enable/disable and HAVE_ macros related to the performance schema instrumentation sys...
void(* unlock_mutex_v1_t)(struct PSI_mutex *mutex)
Record a mutex instrumentation unlock event.
Definition: psi_mutex_bits.h:168
const string version("\ersion\)
Instrumentation helpers for mutexes.
register_mutex_v1_t register_mutex
Definition: psi_mutex.h:62
end_mutex_wait_v1_t end_mutex_wait
Definition: psi_mutex.h:70
destroy_mutex_v1_t destroy_mutex
Definition: psi_mutex.h:66
init_mutex_v1_t init_mutex
Definition: psi_mutex.h:64
void(* destroy_mutex_v1_t)(struct PSI_mutex *mutex)
Mutex instrumentation destruction API.
Definition: psi_mutex_bits.h:162