MySQL 8.0.39
Source Code Documentation
psi_thread_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_THREAD_BITS_H
25#define COMPONENTS_SERVICES_BITS_PSI_THREAD_BITS_H
26
27#ifndef MYSQL_ABI_CHECK
28#include <stddef.h> /* size_t */
29#endif
30
31#include <mysql/components/services/bits/my_io_bits.h> /* sockaddr_storage */
32#include <mysql/components/services/bits/my_thread_bits.h> /* my_thread_handle */
34
35/**
36 @file mysql/components/services/bits/psi_thread_bits.h
37 Performance schema instrumentation interface.
38
39 @defgroup psi_abi_thread Thread Instrumentation (ABI)
40 @ingroup psi_abi
41 @{
42*/
43
44/**
45 Instrumented thread key.
46 To instrument a thread, a thread key must be obtained
47 using @c register_thread.
48 Using a zero key always disable the instrumentation.
49*/
50typedef unsigned int PSI_thread_key;
51
52/**
53 Instrumented thread sequence number.
54 This sequence number is used in conjunction
55 with @ref PSI_thread_info_v5::m_os_name "foo",
56 to print names like "foo-NN" in ps/top/debuggers ...
57 @see my_thread_self_setname().
58*/
59typedef unsigned int PSI_thread_seqnum;
60
61#ifdef __cplusplus
62class THD;
63#else
64/*
65 Phony declaration when compiling C code.
66 This is ok, because the C code will never have a THD anyway.
67*/
68struct opaque_THD {
69 int dummy;
70};
71typedef struct opaque_THD THD;
72#endif
73
74/** @sa enum_vio_type. */
75typedef int opaque_vio_type;
76
77/**
78 Interface for an instrumented thread.
79 This is an opaque structure.
80*/
81struct PSI_thread;
82typedef struct PSI_thread PSI_thread;
83
84/**
85 Thread instrument information.
86 @since PSI_THREAD_VERSION_1
87 This structure is used to register an instrumented thread.
88*/
90 /**
91 Pointer to the key assigned to the registered thread.
92 */
94 /**
95 The name of the thread instrument to register.
96 */
97 const char *m_name;
98 /**
99 The flags of the thread to register.
100 @sa PSI_FLAG_SINGLETON
101 @sa PSI_FLAG_USER
102 @sa PSI_FLAG_THREAD_SYSTEM
103 */
104 unsigned int m_flags;
105 /** Volatility index. */
107 /** Documentation. */
108 const char *m_documentation;
109};
111
112/**
113 Thread instrument information.
114 @since PSI_THREAD_VERSION_5
115 This structure is used to register an instrumented thread.
116*/
118 /**
119 Pointer to the key assigned to the registered thread.
120 */
122 /**
123 The name of the thread instrument to register.
124 */
125 const char *m_name;
126
127 /**
128 The thread name to advertise to the operating system.
129
130 The performance schema thread instrumentation
131 exports instrumented names to the operating system,
132 so they can be visible in:
133 - the output of ps
134 - the output of top
135 - a debugger
136 etc.
137
138 This feature is optional, and improves
139 observability for platforms that support
140 a flavor of pthread_setname_np().
141 On other platforms, there are no effects.
142
143 Performance schema thread names can be instrumented
144 in different ways.
145
146 First, the thread can be unique (@c PSI_FLAG_SINGLETON).
147 In this case, the @c m_os_name attribute is printed as is.
148
149 Second, for threads that exist in multiple instances
150 (flag @c PSI_FLAG_SINGLETON not set),
151 the caller code should pass a sequence number when creating
152 a thread instance with @c new_thread_v5_t or @c spawn_thread_v5_t.
153
154 This sequence number is concatenated (with a dash) to
155 the @c m_os_name so that a thread name "foo" with a sequence
156 of "12" is displayed as "foo-12".
157 When the actual value of the sequence number has a special meaning
158 to the instrumented code (for example, a worker number is also
159 exposed in different places), this is the preferred instrumentation.
160
161 Third, for threads that exist in multiple instances,
162 but do not rely on a specific numbering, setting the flag
163 @c PSI_FLAG_AUTO_SEQNUM causes the performance schema to number
164 threads automatically, so the calling code does not have to do it.
165
166 Fourth and last, for threads that exist in multiple instances,
167 and are executed so often that the total number of threads
168 grows to a very large number (for example, user sessions),
169 numbering threads is not practical because of size limitations,
170 and would introduce just noise in the ps output.
171
172 For this case, the flag @c PSI_FLAG_NO_SEQNUM can be used
173 to avoid numbering.
174
175 @sa my_thread_self_setname().
176 @sa new_thread_v5_t
177 @sa spawn_thread_v5_t
178
179 */
180 const char *m_os_name;
181 /**
182 The flags of the thread to register.
183 @sa PSI_FLAG_SINGLETON
184 @sa PSI_FLAG_USER
185 @sa PSI_FLAG_THREAD_SYSTEM
186 @sa PSI_FLAG_AUTO_SEQNUM
187 @sa PSI_FLAG_NO_SEQNUM
188 */
189 unsigned int m_flags;
190 /** Volatility index. */
192 /** Documentation. */
193 const char *m_documentation;
194};
196
197/**
198 Thread registration API.
199 @param category a category name (typically a plugin name)
200 @param info an array of thread info to register
201 @param count the size of the info array
202*/
203typedef void (*register_thread_v1_t)(const char *category,
204 struct PSI_thread_info_v1 *info,
205 int count);
206
207/**
208 Thread registration API.
209 @param category a category name (typically a plugin name)
210 @param info an array of thread info to register
211 @param count the size of the info array
212*/
213typedef void (*register_thread_v5_t)(const char *category,
214 struct PSI_thread_info_v5 *info,
215 int count);
216
217/**
218 Spawn a thread.
219 This method creates a new thread, with instrumentation.
220 @param key the instrumentation key for this thread
221 @param thread the resulting thread
222 @param attr the thread attributes
223 @param start_routine the thread start routine
224 @param arg the thread start routine argument
225*/
227 const my_thread_attr_t *attr,
228 void *(*start_routine)(void *), void *arg);
229
231 my_thread_handle *thread,
232 const my_thread_attr_t *attr,
233 void *(*start_routine)(void *), void *arg);
234
235/**
236 Create instrumentation for a thread.
237 @param key the registered key
238 @param identity an address typical of the thread
239 @param thread_id PROCESSLIST_ID of the thread
240 @return an instrumented thread
241*/
242typedef struct PSI_thread *(*new_thread_v1_t)(PSI_thread_key key,
243 const void *identity,
244 unsigned long long thread_id);
245
246typedef struct PSI_thread *(*new_thread_v5_t)(PSI_thread_key key,
247 PSI_thread_seqnum seqnum,
248 const void *identity,
249 unsigned long long thread_id);
250
251/**
252 Assign a THD to an instrumented thread.
253 @param thread the instrumented thread
254 @param thd the sql layer THD to assign
255*/
256typedef void (*set_thread_THD_v1_t)(struct PSI_thread *thread, THD *thd);
257
258/**
259 Assign an id to an instrumented thread.
260 @param thread the instrumented thread
261 @param id the PROCESSLIST_ID to assign
262*/
263typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread,
264 unsigned long long id);
265/**
266 Read the THREAD_ID of the current thread.
267 @return the id of the instrumented thread
268*/
269typedef unsigned long long (*get_current_thread_internal_id_v2_t)();
270
271/**
272 Read the THREAD_ID of an instrumented thread.
273 @param thread the instrumented thread
274 @return the id of the instrumented thread
275*/
276typedef unsigned long long (*get_thread_internal_id_v2_t)(
277 struct PSI_thread *thread);
278
279/**
280 Get the instrumentation for the thread of given PROCESSLIST_ID.
281 @param processlist_id the thread id
282 @return the instrumented thread
283*/
284typedef struct PSI_thread *(*get_thread_by_id_v2_t)(
285 unsigned long long processlist_id);
286
287/**
288 Assign the current operating system thread id to an instrumented thread.
289 The operating system task id is obtained from @c gettid()
290 @param thread the instrumented thread
291*/
292typedef void (*set_thread_os_id_v1_t)(struct PSI_thread *thread);
293
294/**
295 Get the instrumentation for the running thread.
296 For this function to return a result,
297 the thread instrumentation must have been attached to the
298 running thread using @c set_thread()
299 @return the instrumentation for the running thread
300*/
301typedef struct PSI_thread *(*get_thread_v1_t)(void);
302
303/**
304 Assign a user name to the instrumented thread.
305 @param user the user name
306 @param user_len the user name length
307*/
308typedef void (*set_thread_user_v1_t)(const char *user, int user_len);
309
310/**
311 Assign a user name and host name to the instrumented thread.
312 @param user the user name
313 @param user_len the user name length
314 @param host the host name
315 @param host_len the host name length
316*/
317typedef void (*set_thread_account_v1_t)(const char *user, int user_len,
318 const char *host, int host_len);
319
320/**
321 Assign a current database to the instrumented thread.
322 @param db the database name
323 @param db_len the database name length
324*/
325typedef void (*set_thread_db_v1_t)(const char *db, int db_len);
326
327/**
328 Assign a current command to the instrumented thread.
329 @param command the current command
330*/
331typedef void (*set_thread_command_v1_t)(int command);
332
333/**
334 Assign a connection type to the instrumented thread.
335 @param conn_type the connection type
336*/
337typedef void (*set_connection_type_v1_t)(opaque_vio_type conn_type);
338
339/**
340 Assign a start time to the instrumented thread.
341 @param start_time the thread start time
342*/
343typedef void (*set_thread_start_time_v1_t)(time_t start_time);
344
345/**
346 Assign a state to the instrumented thread.
347 @param state the thread state
348*/
349typedef void (*set_thread_state_v1_t)(const char *state);
350
351/**
352 Assign a process info to the instrumented thread.
353 @param info the process into string
354 @param info_len the process into string length
355*/
356typedef void (*set_thread_info_v1_t)(const char *info, unsigned int info_len);
357
358/**
359 Set a thread EXECUTION_ENGINE attribute.
360 @param secondary True for SECONDARY, false for PRIMARY.
361*/
362typedef void (*set_thread_secondary_engine_v6_t)(bool secondary);
363
364/**
365 Assign a resource group name to the current thread.
366
367 @param group_name resource group name string
368 @param group_name_len resource group name string length
369 @param user_data user-defined data
370 return 0 if successful, 1 otherwise
371*/
372typedef int (*set_thread_resource_group_v1_t)(const char *group_name,
373 int group_name_len,
374 void *user_data);
375
376/**
377 Assign a resource group name to an instrumented thread, identified either by
378 the thread instrumentation or Performance Schema thread id.
379
380 @param thread pointer to the thread instrumentation. Ignored if NULL.
381 @param thread_id thread id of the target thread. Only used if thread is NULL.
382 @param group_name resource group name string
383 @param group_name_len resource group name string length
384 @param user_data user-defined data
385 return 0 if successful, 1 otherwise
386*/
388 PSI_thread *thread, unsigned long long thread_id, const char *group_name,
389 int group_name_len, void *user_data);
390
391/**
392 Attach a thread instrumentation to the running thread.
393 In case of thread pools, this method should be called when
394 a worker thread picks a work item and runs it.
395 Also, this method should be called if the instrumented code does not
396 keep the pointer returned by @c new_thread() and relies on @c get_thread()
397 instead.
398 @param thread the thread instrumentation
399*/
400typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
401
402/**
403 Assign the remote (peer) port to the instrumented thread.
404
405 @param thread pointer to the thread instrumentation
406 @param port the remote port
407*/
408typedef void (*set_thread_peer_port_v4_t)(PSI_thread *thread,
409 unsigned int port);
410
411/** Aggregate the thread status variables. */
412typedef void (*aggregate_thread_status_v2_t)(struct PSI_thread *thread);
413
414/** Delete the current thread instrumentation. */
415typedef void (*delete_current_thread_v1_t)(void);
416
417/** Delete a thread instrumentation. */
418typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
419
420/**
421 Stores an array of connection attributes
422 @param buffer char array of length encoded connection attributes
423 in network format
424 @param length length of the data in buffer
425 @param from_cs charset in which @c buffer is encoded
426 @return state
427 @retval non_0 attributes truncated
428 @retval 0 stored the attribute
429*/
430typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer,
431 unsigned int length,
432 const void *from_cs);
433
434/**
435 Get the current thread current event.
436 @param [out] thread_internal_id The thread internal id
437 @param [out] event_id The per thread event id.
438*/
440 unsigned long long *thread_internal_id, unsigned long long *event_id);
441
442/**
443 Get the thread current event.
444 @deprecated
445 @param [out] thread_internal_id The thread internal id
446 @param [out] event_id The per thread event id.
447*/
448typedef void (*get_thread_event_id_v1_t)(unsigned long long *thread_internal_id,
449 unsigned long long *event_id);
450
451/**
452 Get the thread current event.
453 @param psi the instrumented thread
454 @param [out] thread_internal_id The thread internal id
455 @param [out] event_id The per thread event id.
456*/
457typedef void (*get_thread_event_id_v2_t)(struct PSI_thread *psi,
458 unsigned long long *thread_internal_id,
459 unsigned long long *event_id);
460
461/* Duplicate definitions to avoid dependency on mysql_com.h */
462#define PSI_USERNAME_LENGTH (32 * 3)
463#define PSI_NAME_LEN (64 * 3)
464#define PSI_HOSTNAME_LENGTH (255)
465
466/**
467 Performance Schema thread type: user/foreground or system/background.
468 @sa get_thread_system_attrs
469*/
471 /* PFS internal thread id, unique. */
472 unsigned long long m_thread_internal_id;
473
474 /* SHOW PROCESSLIST thread id, not unique. */
475 unsigned long m_processlist_id;
476
477 /* Operating system thread id, if any. */
478 unsigned long long m_thread_os_id;
479
480 /* User-defined data. */
482
483 /* User name. */
485
486 /* User name length. */
488
489 /* Host name. */
491
492 /* Host name length. */
494
495 /* Resource group name. */
497
498 /* Resource group name length. */
500
501 /** Raw socket address */
502 struct sockaddr_storage m_sock_addr;
503
504 /** Length of address */
506
507 /* True if system/background thread, false if user/foreground thread. */
509};
510
512
513/**
514 Callback for the pfs_notification service.
515 @param thread_attrs system attributes of the current thread.
516*/
517typedef void (*PSI_notification_cb_v3)(const PSI_thread_attrs_v3 *thread_attrs);
518
519/**
520 Registration structure for the pfs_notification service.
521 @sa register_notification_v3_t
522*/
529};
530
532
533/**
534 Get system attributes for the current thread.
535
536 @param thread_attrs pointer to pfs_thread_attr struct
537 @return 0 if successful, 1 otherwise
538*/
540
541/**
542 Get system attributes for an instrumented thread, identified either by the
543 thread instrumentation or Performance Schema thread id.
544
545 @param thread pointer to the thread instrumentation. Ignored if NULL.
546 @param thread_id thread id of the target thread. Only used if thread is NULL.
547 @param thread_attrs pointer to pfs_thread_attr struct
548 @return 0 if successful, 1 otherwise
549*/
551 PSI_thread *thread, unsigned long long thread_id,
552 PSI_thread_attrs_v3 *thread_attrs);
553
554/**
555 Register callback functions for the Notification service.
556 For best performance, set with_ref_count = false.
557
558 @param callbacks structure of user-defined callback functions
559 @param with_ref_count true if callbacks can be unregistered
560 @sa unregister_notification
561 @return registration handle on success, 0 if failure
562*/
564 bool with_ref_count);
565
566/**
567 Unregister callback functions for the Notification service.
568
569 @param handle registration handle returned by register_notification()
570 @sa register_notification
571 @return 0 if successful, non-zero otherwise
572*/
574
575/**
576 Invoke the callback function registered for a session connect event.
577
578 @param thread the thread instrumentation
579*/
581
582/**
583 Invoke the callback function registered for a session disconnect event.
584
585 @param thread the thread instrumentation
586*/
588
589/**
590 Invoke the callback function registered for a change user event.
591
592 @param thread the thread instrumentation
593*/
595
597
599
601
602/** @} (end of group psi_abi_thread) */
603
604#endif /* COMPONENTS_SERVICES_BITS_PSI_THREAD_BITS_H */
static const sasl_callback_t callbacks[]
Definition: auth_ldap_sasl_client.h:45
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
unsigned long long(* get_thread_internal_id_v2_t)(struct PSI_thread *thread)
Read the THREAD_ID of an instrumented thread.
Definition: psi_thread_bits.h:276
void(* set_thread_state_v1_t)(const char *state)
Assign a state to the instrumented thread.
Definition: psi_thread_bits.h:349
int(* spawn_thread_v1_t)(PSI_thread_key key, my_thread_handle *thread, const my_thread_attr_t *attr, void *(*start_routine)(void *), void *arg)
Spawn a thread.
Definition: psi_thread_bits.h:226
void(* get_current_thread_event_id_v2_t)(unsigned long long *thread_internal_id, unsigned long long *event_id)
Get the current thread current event.
Definition: psi_thread_bits.h:439
void(* set_thread_THD_v1_t)(struct PSI_thread *thread, THD *thd)
Assign a THD to an instrumented thread.
Definition: psi_thread_bits.h:256
void(* set_thread_os_id_v1_t)(struct PSI_thread *thread)
Assign the current operating system thread id to an instrumented thread.
Definition: psi_thread_bits.h:292
struct PSI_thread PSI_thread
Definition: psi_thread_bits.h:82
void(* set_thread_id_v1_t)(struct PSI_thread *thread, unsigned long long id)
Assign an id to an instrumented thread.
Definition: psi_thread_bits.h:263
void(* PSI_notification_cb_v3)(const PSI_thread_attrs_v3 *thread_attrs)
Callback for the pfs_notification service.
Definition: psi_thread_bits.h:517
void(* notify_session_change_user_v1_t)(PSI_thread *thread)
Invoke the callback function registered for a change user event.
Definition: psi_thread_bits.h:594
void(* set_thread_start_time_v1_t)(time_t start_time)
Assign a start time to the instrumented thread.
Definition: psi_thread_bits.h:343
void(* notify_session_disconnect_v1_t)(PSI_thread *thread)
Invoke the callback function registered for a session disconnect event.
Definition: psi_thread_bits.h:587
#define PSI_USERNAME_LENGTH
Definition: psi_thread_bits.h:462
void(* set_thread_command_v1_t)(int command)
Assign a current command to the instrumented thread.
Definition: psi_thread_bits.h:331
void(* get_thread_event_id_v1_t)(unsigned long long *thread_internal_id, unsigned long long *event_id)
Get the thread current event.
Definition: psi_thread_bits.h:448
unsigned int PSI_thread_seqnum
Instrumented thread sequence number.
Definition: psi_thread_bits.h:59
int(* spawn_thread_v5_t)(PSI_thread_key key, PSI_thread_seqnum seqnum, my_thread_handle *thread, const my_thread_attr_t *attr, void *(*start_routine)(void *), void *arg)
Definition: psi_thread_bits.h:230
void(* set_thread_info_v1_t)(const char *info, unsigned int info_len)
Assign a process info to the instrumented thread.
Definition: psi_thread_bits.h:356
void(* delete_current_thread_v1_t)(void)
Delete the current thread instrumentation.
Definition: psi_thread_bits.h:415
void(* set_thread_secondary_engine_v6_t)(bool secondary)
Set a thread EXECUTION_ENGINE attribute.
Definition: psi_thread_bits.h:362
void(* register_thread_v1_t)(const char *category, struct PSI_thread_info_v1 *info, int count)
Thread registration API.
Definition: psi_thread_bits.h:203
void(* set_thread_account_v1_t)(const char *user, int user_len, const char *host, int host_len)
Assign a user name and host name to the instrumented thread.
Definition: psi_thread_bits.h:317
int(* register_notification_v3_t)(const PSI_notification_v3 *callbacks, bool with_ref_count)
Register callback functions for the Notification service.
Definition: psi_thread_bits.h:563
void(* notify_session_connect_v1_t)(PSI_thread *thread)
Invoke the callback function registered for a session connect event.
Definition: psi_thread_bits.h:580
int(* set_thread_resource_group_v1_t)(const char *group_name, int group_name_len, void *user_data)
Assign a resource group name to the current thread.
Definition: psi_thread_bits.h:372
void(* set_thread_user_v1_t)(const char *user, int user_len)
Assign a user name to the instrumented thread.
Definition: psi_thread_bits.h:308
unsigned int PSI_thread_key
Instrumented thread key.
Definition: psi_thread_bits.h:50
#define PSI_HOSTNAME_LENGTH
Definition: psi_thread_bits.h:464
void(* register_thread_v5_t)(const char *category, struct PSI_thread_info_v5 *info, int count)
Thread registration API.
Definition: psi_thread_bits.h:213
#define PSI_NAME_LEN
Definition: psi_thread_bits.h:463
void(* aggregate_thread_status_v2_t)(struct PSI_thread *thread)
Aggregate the thread status variables.
Definition: psi_thread_bits.h:412
int(* unregister_notification_v1_t)(int handle)
Unregister callback functions for the Notification service.
Definition: psi_thread_bits.h:573
void(* delete_thread_v1_t)(struct PSI_thread *thread)
Delete a thread instrumentation.
Definition: psi_thread_bits.h:418
void(* set_thread_db_v1_t)(const char *db, int db_len)
Assign a current database to the instrumented thread.
Definition: psi_thread_bits.h:325
void(* set_thread_v1_t)(struct PSI_thread *thread)
Attach a thread instrumentation to the running thread.
Definition: psi_thread_bits.h:400
unsigned long long(* get_current_thread_internal_id_v2_t)()
Read the THREAD_ID of the current thread.
Definition: psi_thread_bits.h:269
int(* get_thread_system_attrs_v3_t)(PSI_thread_attrs_v3 *thread_attrs)
Get system attributes for the current thread.
Definition: psi_thread_bits.h:539
void(* set_thread_peer_port_v4_t)(PSI_thread *thread, unsigned int port)
Assign the remote (peer) port to the instrumented thread.
Definition: psi_thread_bits.h:408
int(* set_thread_connect_attrs_v1_t)(const char *buffer, unsigned int length, const void *from_cs)
Stores an array of connection attributes.
Definition: psi_thread_bits.h:430
int(* get_thread_system_attrs_by_id_v3_t)(PSI_thread *thread, unsigned long long thread_id, PSI_thread_attrs_v3 *thread_attrs)
Get system attributes for an instrumented thread, identified either by the thread instrumentation or ...
Definition: psi_thread_bits.h:550
int(* set_thread_resource_group_by_id_v1_t)(PSI_thread *thread, unsigned long long thread_id, const char *group_name, int group_name_len, void *user_data)
Assign a resource group name to an instrumented thread, identified either by the thread instrumentati...
Definition: psi_thread_bits.h:387
void(* thread_abort_telemetry_v7_t)(PSI_thread *thread)
Definition: psi_thread_bits.h:600
void(* set_connection_type_v1_t)(opaque_vio_type conn_type)
Assign a connection type to the instrumented thread.
Definition: psi_thread_bits.h:337
int opaque_vio_type
Definition: psi_thread_bits.h:62
void(* thread_detect_telemetry_v7_t)(PSI_thread *thread)
Definition: psi_thread_bits.h:598
void(* get_thread_event_id_v2_t)(struct PSI_thread *psi, unsigned long long *thread_internal_id, unsigned long long *event_id)
Get the thread current event.
Definition: psi_thread_bits.h:457
Types to make file and socket I/O compatible.
static my_thread_id thread_id
Definition: my_thr_init.cc:63
Types to make different thread packages compatible.
pthread_attr_t my_thread_attr_t
Definition: my_thread_bits.h:49
static int count
Definition: myisam_ftdump.cc:43
Log info(cout, "NOTE")
char * user
Definition: mysqladmin.cc:60
const char * host
Definition: mysqladmin.cc:59
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
static int handle(int sql_errno, const char *sqlstate, const char *message, void *state)
Bridge function between the C++ API offered by this module and the C API of the parser service.
Definition: services.cc:64
static const char * category
Definition: sha2_password.cc:170
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
Registration structure for the pfs_notification service.
Definition: psi_thread_bits.h:523
PSI_notification_cb_v3 session_connect
Definition: psi_thread_bits.h:526
PSI_notification_cb_v3 thread_destroy
Definition: psi_thread_bits.h:525
PSI_notification_cb_v3 session_change_user
Definition: psi_thread_bits.h:528
PSI_notification_cb_v3 thread_create
Definition: psi_thread_bits.h:524
PSI_notification_cb_v3 session_disconnect
Definition: psi_thread_bits.h:527
Performance Schema thread type: user/foreground or system/background.
Definition: psi_thread_bits.h:470
unsigned long long m_thread_internal_id
Definition: psi_thread_bits.h:472
char m_username[PSI_USERNAME_LENGTH]
Definition: psi_thread_bits.h:484
unsigned long long m_thread_os_id
Definition: psi_thread_bits.h:478
size_t m_username_length
Definition: psi_thread_bits.h:487
size_t m_groupname_length
Definition: psi_thread_bits.h:499
unsigned long m_processlist_id
Definition: psi_thread_bits.h:475
struct sockaddr_storage m_sock_addr
Raw socket address.
Definition: psi_thread_bits.h:502
socklen_t m_sock_addr_length
Length of address.
Definition: psi_thread_bits.h:505
char m_hostname[PSI_HOSTNAME_LENGTH]
Definition: psi_thread_bits.h:490
char m_groupname[PSI_NAME_LEN]
Definition: psi_thread_bits.h:496
size_t m_hostname_length
Definition: psi_thread_bits.h:493
void * m_user_data
Definition: psi_thread_bits.h:481
bool m_system_thread
Definition: psi_thread_bits.h:508
Thread instrument information.
Definition: psi_thread_bits.h:89
int m_volatility
Volatility index.
Definition: psi_thread_bits.h:106
const char * m_documentation
Documentation.
Definition: psi_thread_bits.h:108
const char * m_name
The name of the thread instrument to register.
Definition: psi_thread_bits.h:97
PSI_thread_key * m_key
Pointer to the key assigned to the registered thread.
Definition: psi_thread_bits.h:93
unsigned int m_flags
The flags of the thread to register.
Definition: psi_thread_bits.h:104
Thread instrument information.
Definition: psi_thread_bits.h:117
unsigned int m_flags
The flags of the thread to register.
Definition: psi_thread_bits.h:189
PSI_thread_key * m_key
Pointer to the key assigned to the registered thread.
Definition: psi_thread_bits.h:121
const char * m_os_name
The thread name to advertise to the operating system.
Definition: psi_thread_bits.h:180
int m_volatility
Volatility index.
Definition: psi_thread_bits.h:191
const char * m_name
The name of the thread instrument to register.
Definition: psi_thread_bits.h:125
const char * m_documentation
Documentation.
Definition: psi_thread_bits.h:193
Definition: my_thread_bits.h:52
command
Definition: version_token.cc:280
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510