MySQL 8.3.0
Source Code Documentation
psi_mdl_bits.h
Go to the documentation of this file.
1/* Copyright (c) 2008, 2023, 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 COMPONENTS_SERVICES_BITS_PSI_MDL_BITS_H
24#define COMPONENTS_SERVICES_BITS_PSI_MDL_BITS_H
25
26/**
27 @file mysql/components/services/bits/psi_mdl_bits.h
28 Performance schema instrumentation interface.
29
30 @defgroup psi_abi_mdl Metadata Lock Instrumentation (ABI)
31 @ingroup psi_abi
32 @{
33*/
34
35struct MDL_key;
36
37/** @sa enum_mdl_type. */
38typedef int opaque_mdl_type;
39
40/** @sa enum_mdl_duration. */
42
43/** @sa MDL_wait::enum_wait_status. */
45
46/**
47 Interface for an instrumented metadata lock.
48 This is an opaque structure.
49*/
52
53/**
54 Interface for an instrumented MDL operation.
55 This is an opaque structure.
56*/
59
60/**
61 State data storage for @c start_metadata_wait_v1_t.
62 This structure provide temporary storage to a metadata locker.
63 The content of this structure is considered opaque,
64 the fields are only hints of what an implementation
65 of the psi interface can use.
66 This memory is provided by the instrumented code for performance reasons.
67 @sa start_metadata_wait_v1_t
68*/
70 /** Internal state. */
71 unsigned int m_flags;
72 /** Current metadata lock. */
74 /** Current thread. */
76 /** Timer start. */
77 unsigned long long m_timer_start;
78 /** Timer function. */
79 unsigned long long (*m_timer)(void);
80 /** Internal data. */
81 void *m_wait;
82};
84
85typedef PSI_metadata_lock *(*create_metadata_lock_v1_t)(
86 void *identity, const struct MDL_key *key, opaque_mdl_type mdl_type,
87 opaque_mdl_duration mdl_duration, opaque_mdl_status mdl_status,
88 const char *src_file, unsigned int src_line);
89
91 opaque_mdl_status mdl_status);
92
95
97
98typedef struct PSI_metadata_locker *(*start_metadata_wait_v1_t)(
99 struct PSI_metadata_locker_state_v1 *state, struct PSI_metadata_lock *mdl,
100 const char *src_file, unsigned int src_line);
101
102typedef void (*end_metadata_wait_v1_t)(struct PSI_metadata_locker *locker,
103 int rc);
104
106
107/** @} (end of group psi_abi_mdl) */
108
109#endif /* COMPONENTS_SERVICES_BITS_PSI_MDL_BITS_H */
void(* destroy_metadata_lock_v1_t)(PSI_metadata_lock *lock)
Definition: psi_mdl_bits.h:96
void(* end_metadata_wait_v1_t)(struct PSI_metadata_locker *locker, int rc)
Definition: psi_mdl_bits.h:102
int opaque_mdl_duration
Definition: psi_mdl_bits.h:41
struct PSI_metadata_locker PSI_metadata_locker
Definition: psi_mdl_bits.h:58
int opaque_mdl_status
Definition: psi_mdl_bits.h:44
int opaque_mdl_type
Definition: psi_mdl_bits.h:35
void(* set_metadata_lock_status_v1_t)(PSI_metadata_lock *lock, opaque_mdl_status mdl_status)
Definition: psi_mdl_bits.h:90
struct PSI_metadata_lock PSI_metadata_lock
Definition: psi_mdl_bits.h:51
void(* set_metadata_lock_duration_v2_t)(PSI_metadata_lock *lock, opaque_mdl_duration mdl_duration)
Definition: psi_mdl_bits.h:93
struct PSI_thread PSI_thread
Definition: psi_thread_bits.h:81
static std::mutex lock
Definition: net_ns.cc:55
required string key
Definition: replication_asynchronous_connection_failover.proto:59
Metadata lock object key.
Definition: mdl.h:364
State data storage for start_metadata_wait_v1_t.
Definition: psi_mdl_bits.h:69
struct PSI_metadata_lock * m_metadata_lock
Current metadata lock.
Definition: psi_mdl_bits.h:73
struct PSI_thread * m_thread
Current thread.
Definition: psi_mdl_bits.h:75
unsigned long long(* m_timer)(void)
Timer function.
Definition: psi_mdl_bits.h:79
unsigned int m_flags
Internal state.
Definition: psi_mdl_bits.h:71
unsigned long long m_timer_start
Timer start.
Definition: psi_mdl_bits.h:77
void * m_wait
Internal data.
Definition: psi_mdl_bits.h:81