24#ifndef COMPONENTS_SERVICES_BITS_PSI_THREAD_BITS_H
25#define COMPONENTS_SERVICES_BITS_PSI_THREAD_BITS_H
27#ifndef MYSQL_ABI_CHECK
71typedef struct opaque_THD
THD;
228 void *(*start_routine)(
void *),
void *arg);
233 void *(*start_routine)(
void *),
void *arg);
243 const void *identity,
248 const void *identity,
264 unsigned long long id);
284typedef struct PSI_thread *(*get_thread_by_id_v2_t)(
285 unsigned long long processlist_id);
301typedef struct PSI_thread *(*get_thread_v1_t)(void);
318 const char *
host,
int host_len);
389 int group_name_len,
void *user_data);
432 const void *from_cs);
440 unsigned long long *thread_internal_id,
unsigned long long *event_id);
449 unsigned long long *event_id);
458 unsigned long long *thread_internal_id,
459 unsigned long long *event_id);
462#define PSI_USERNAME_LENGTH (32 * 3)
463#define PSI_NAME_LEN (64 * 3)
464#define PSI_HOSTNAME_LENGTH (255)
564 bool with_ref_count);
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
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