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