MySQL 9.1.0
Source Code Documentation
psi_stage_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_STAGE_BITS_H
25#define COMPONENTS_SERVICES_BITS_PSI_STAGE_BITS_H
26
28
29/**
30 @file mponents/services/bits/psi_stage_bits.h
31 Performance schema instrumentation interface.
32
33 @defgroup psi_abi_stage Stage Instrumentation (ABI)
34 @ingroup psi_abi
35 @{
36*/
37
38/**
39 Instrumented stage key.
40 To instrument a stage, a stage key must be obtained using @c register_stage.
41 Using a zero key always disable the instrumentation.
42*/
43typedef unsigned int PSI_stage_key;
44
45/**
46 @def PSI_STAGE_VERSION_1
47 Performance Schema Stage Interface number for version 1.
48 This version is supported.
49*/
50#define PSI_STAGE_VERSION_1 1
51
52/**
53 @def PSI_CURRENT_STAGE_VERSION
54 Performance Schema Stage Interface number for the most recent version.
55 The most current version is @c PSI_STAGE_VERSION_1
56*/
57#define PSI_CURRENT_STAGE_VERSION 1
58
59/**
60 Interface for an instrumented stage progress.
61 This is a public structure, for efficiency.
62*/
64 unsigned long long m_work_completed;
65 unsigned long long m_work_estimated;
66};
68
69/**
70 Stage instrument information.
71 @since PSI_STAGE_VERSION_1
72 This structure is used to register an instrumented stage.
73*/
75 /** The registered stage key. */
77 /** The name of the stage instrument to register. */
78 const char *m_name{nullptr};
79 /**
80 The flags of the stage instrument to register.
81 @sa PSI_FLAG_PROGRESS
82 */
83 unsigned int m_flags{0};
84 /** Documentation. */
85 const char *m_documentation{nullptr};
86};
88
89/**
90 Stage registration API.
91 @param category a category name
92 @param info an array of stage info to register
93 @param count the size of the info array
94*/
95typedef void (*register_stage_v1_t)(const char *category,
96 struct PSI_stage_info_v1 **info, int count);
97
98/**
99 Start a new stage, and implicitly end the previous stage.
100 @param key the key of the new stage
101 @param src_file the source file name
102 @param src_line the source line number
103 @return the new stage progress
104*/
105typedef PSI_stage_progress_v1 *(*start_stage_v1_t)(PSI_stage_key key,
106 const char *src_file,
107 int src_line);
108
109/**
110 Get the current stage progress.
111 @return the stage progress
112*/
113typedef PSI_stage_progress_v1 *(*get_current_stage_progress_v1_t)(void);
114
115/** End the current stage. */
116typedef void (*end_stage_v1_t)(void);
117
120
121/** @} (end of group psi_abi_stage) */
122
123#endif /* COMPONENTS_SERVICES_BITS_PSI_STAGE_BITS_H */
unsigned int PSI_stage_key
Instrumented stage key.
Definition: psi_stage_bits.h:43
void(* register_stage_v1_t)(const char *category, struct PSI_stage_info_v1 **info, int count)
Stage registration API.
Definition: psi_stage_bits.h:95
void(* end_stage_v1_t)(void)
End the current stage.
Definition: psi_stage_bits.h:116
static int count
Definition: myisam_ftdump.cc:45
static const char * category
Definition: sha2_password.cc:170
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Stage instrument information.
Definition: psi_stage_bits.h:74
unsigned int m_flags
The flags of the stage instrument to register.
Definition: psi_stage_bits.h:83
PSI_stage_key m_key
The registered stage key.
Definition: psi_stage_bits.h:76
const char * m_name
The name of the stage instrument to register.
Definition: psi_stage_bits.h:78
const char * m_documentation
Documentation.
Definition: psi_stage_bits.h:85
Interface for an instrumented stage progress.
Definition: psi_stage_bits.h:63
unsigned long long m_work_estimated
Definition: psi_stage_bits.h:65
unsigned long long m_work_completed
Definition: psi_stage_bits.h:64