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