MySQL 9.1.0
Source Code Documentation
psi_idle_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_IDLE_BITS_H
25#define COMPONENTS_SERVICES_BITS_PSI_IDLE_BITS_H
26
27/**
28 @file mysql/components/services/bits/psi_idle_bits.h
29 Performance schema instrumentation interface.
30
31 @defgroup psi_abi_idle Idle Instrumentation (ABI)
32 @ingroup psi_abi
33 @{
34*/
35
36/**
37 Interface for an instrumented idle operation.
38 This is an opaque structure.
39*/
40struct PSI_idle_locker;
42
43/**
44 State data storage for @c start_idle_wait_v1_t.
45 This structure provide temporary storage to an idle locker.
46 The content of this structure is considered opaque,
47 the fields are only hints of what an implementation
48 of the psi interface can use.
49 This memory is provided by the instrumented code for performance reasons.
50 @sa start_idle_wait_v1_t.
51*/
53 /** Internal state. */
54 unsigned int m_flags;
55 /** Current thread. */
57 /** Timer start. */
58 unsigned long long m_timer_start;
59 /** Timer function. */
60 unsigned long long (*m_timer)(void);
61 /** Internal data. */
62 void *m_wait;
63};
65
66/**
67 Record an idle instrumentation wait start event.
68 @param state data storage for the locker
69 @param src_file the source file name
70 @param src_line the source line number
71 @return an idle locker, or NULL
72*/
73typedef struct PSI_idle_locker *(*start_idle_wait_v1_t)(
74 struct PSI_idle_locker_state_v1 *state, const char *src_file,
75 unsigned int src_line);
76
77/**
78 Record an idle instrumentation wait end event.
79 @param locker a thread locker for the running thread
80*/
81typedef void (*end_idle_wait_v1_t)(struct PSI_idle_locker *locker);
82
84
85/** @} (end of group psi_abi_idle) */
86
87#endif /* COMPONENTS_SERVICES_BITS_PSI_IDLE_BITS_H */
void(* end_idle_wait_v1_t)(struct PSI_idle_locker *locker)
Record an idle instrumentation wait end event.
Definition: psi_idle_bits.h:81
struct PSI_idle_locker PSI_idle_locker
Definition: psi_idle_bits.h:41
struct PSI_thread PSI_thread
Definition: psi_thread_bits.h:82
State data storage for start_idle_wait_v1_t.
Definition: psi_idle_bits.h:52
unsigned int m_flags
Internal state.
Definition: psi_idle_bits.h:54
unsigned long long m_timer_start
Timer start.
Definition: psi_idle_bits.h:58
unsigned long long(* m_timer)(void)
Timer function.
Definition: psi_idle_bits.h:60
struct PSI_thread * m_thread
Current thread.
Definition: psi_idle_bits.h:56
void * m_wait
Internal data.
Definition: psi_idle_bits.h:62