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