23#ifndef COMPONENTS_SERVICES_BITS_PSI_THREAD_BITS_H
24#define COMPONENTS_SERVICES_BITS_PSI_THREAD_BITS_H
26#ifndef MYSQL_ABI_CHECK
70typedef struct opaque_THD
THD;
227 void *(*start_routine)(
void *),
void *arg);
232 void *(*start_routine)(
void *),
void *arg);
242 const void *identity,
247 const void *identity,
263 unsigned long long id);
283typedef struct PSI_thread *(*get_thread_by_id_v2_t)(
284 unsigned long long processlist_id);
300typedef struct PSI_thread *(*get_thread_v1_t)(void);
317 const char *
host,
int host_len);
388 int group_name_len,
void *user_data);
431 const void *from_cs);
439 unsigned long long *thread_internal_id,
unsigned long long *event_id);
448 unsigned long long *event_id);
457 unsigned long long *thread_internal_id,
458 unsigned long long *event_id);
461#define PSI_USERNAME_LENGTH (32 * 3)
462#define PSI_NAME_LEN (64 * 3)
463#define PSI_HOSTNAME_LENGTH (255)
563 bool with_ref_count);
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_lexer_thd.h:35
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:438
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:516
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:593
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:586
#define PSI_USERNAME_LENGTH
Definition: psi_thread_bits.h:461
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:447
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:414
void(* set_thread_secondary_engine_v6_t)(bool secondary)
Set a thread EXECUTION_ENGINE attribute.
Definition: psi_thread_bits.h:361
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:562
void(* notify_session_connect_v1_t)(PSI_thread *thread)
Invoke the callback function registered for a session connect event.
Definition: psi_thread_bits.h:579
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:371
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:463
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:462
void(* aggregate_thread_status_v2_t)(struct PSI_thread *thread)
Aggregate the thread status variables.
Definition: psi_thread_bits.h:411
int(* unregister_notification_v1_t)(int handle)
Unregister callback functions for the Notification service.
Definition: psi_thread_bits.h:572
void(* delete_thread_v1_t)(struct PSI_thread *thread)
Delete a thread instrumentation.
Definition: psi_thread_bits.h:417
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:399
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:538
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:407
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:429
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:549
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:386
void(* thread_abort_telemetry_v7_t)(PSI_thread *thread)
Definition: psi_thread_bits.h:599
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(* thread_detect_telemetry_v7_t)(PSI_thread *thread)
Definition: psi_thread_bits.h:597
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:456
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:44
char * user
Definition: mysqladmin.cc:64
const char * host
Definition: mysqladmin.cc:63
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:417
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:63
static const char * category
Definition: sha2_password.cc:169
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:522
PSI_notification_cb_v3 session_connect
Definition: psi_thread_bits.h:525
PSI_notification_cb_v3 thread_destroy
Definition: psi_thread_bits.h:524
PSI_notification_cb_v3 session_change_user
Definition: psi_thread_bits.h:527
PSI_notification_cb_v3 thread_create
Definition: psi_thread_bits.h:523
PSI_notification_cb_v3 session_disconnect
Definition: psi_thread_bits.h:526
Performance Schema thread type: user/foreground or system/background.
Definition: psi_thread_bits.h:469
unsigned long long m_thread_internal_id
Definition: psi_thread_bits.h:471
char m_username[PSI_USERNAME_LENGTH]
Definition: psi_thread_bits.h:483
unsigned long long m_thread_os_id
Definition: psi_thread_bits.h:477
size_t m_username_length
Definition: psi_thread_bits.h:486
size_t m_groupname_length
Definition: psi_thread_bits.h:498
unsigned long m_processlist_id
Definition: psi_thread_bits.h:474
struct sockaddr_storage m_sock_addr
Raw socket address.
Definition: psi_thread_bits.h:501
socklen_t m_sock_addr_length
Length of address.
Definition: psi_thread_bits.h:504
char m_hostname[PSI_HOSTNAME_LENGTH]
Definition: psi_thread_bits.h:489
char m_groupname[PSI_NAME_LEN]
Definition: psi_thread_bits.h:495
size_t m_hostname_length
Definition: psi_thread_bits.h:492
void * m_user_data
Definition: psi_thread_bits.h:480
bool m_system_thread
Definition: psi_thread_bits.h:507
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:509