MySQL 9.1.0
Source Code Documentation
Collaboration diagram for Thread Instrumentation (API):

Macros

#define mysql_thread_register(P1, P2, P3)    inline_mysql_thread_register(P1, P2, P3)
 Thread registration. More...
 
#define mysql_thread_create(K, P1, P2, P3, P4)    inline_mysql_thread_create(K, 0, P1, P2, P3, P4)
 Instrumented my_thread_create. More...
 
#define mysql_thread_create_seq(K, S, P1, P2, P3, P4)    inline_mysql_thread_create(K, S, P1, P2, P3, P4)
 Instrumented my_thread_create. More...
 
#define mysql_thread_set_psi_id(I)   inline_mysql_thread_set_psi_id(I)
 Set the thread identifier for the instrumentation. More...
 
#define mysql_thread_set_psi_THD(T)   inline_mysql_thread_set_psi_THD(T)
 Set the thread sql session for the instrumentation. More...
 

Functions

static void inline_mysql_thread_register (const char *category, PSI_thread_info *info, int count)
 
static int inline_mysql_thread_create (PSI_thread_key key, unsigned int sequence_number, my_thread_handle *thread, const my_thread_attr_t *attr, my_start_routine start_routine, void *arg)
 
static void inline_mysql_thread_set_psi_id (my_thread_id id)
 
static void inline_mysql_thread_set_psi_THD (THD *thd)
 
static void mysql_thread_set_peer_port (uint port)
 
static void mysql_thread_set_secondary_engine (bool secondary)
 
static void mysql_thread_set_info (const char *str, int len)
 Set the INFO attribute in the thread instrumentation. More...
 

Detailed Description

Macro Definition Documentation

◆ mysql_thread_create

#define mysql_thread_create (   K,
  P1,
  P2,
  P3,
  P4 
)     inline_mysql_thread_create(K, 0, P1, P2, P3, P4)

Instrumented my_thread_create.

This function creates both the thread instrumentation and a thread. mysql_thread_create is a replacement for my_thread_create. The parameter P4 (or, if it is NULL, P1) will be used as the instrumented thread "identity". Providing a P1 / P4 parameter with a different value for each call will on average improve performances, since this thread identity value is used internally to randomize access to data and prevent contention. This is optional, and the improvement is not guaranteed, only statistical.

Parameters
KThe PSI_thread_key for this instrumented thread
P1my_thread_create parameter 1
P2my_thread_create parameter 2
P3my_thread_create parameter 3
P4my_thread_create parameter 4

◆ mysql_thread_create_seq

#define mysql_thread_create_seq (   K,
  S,
  P1,
  P2,
  P3,
  P4 
)     inline_mysql_thread_create(K, S, P1, P2, P3, P4)

Instrumented my_thread_create.

See also
mysql_thread_create. This forms takes an additional sequence number parameter, used to name threads "name-N" in the operating system.
Parameters
KThe PSI_thread_key for this instrumented thread
SThe sequence number for this instrumented thread
P1my_thread_create parameter 1
P2my_thread_create parameter 2
P3my_thread_create parameter 3
P4my_thread_create parameter 4

◆ mysql_thread_register

#define mysql_thread_register (   P1,
  P2,
  P3 
)     inline_mysql_thread_register(P1, P2, P3)

Thread registration.

◆ mysql_thread_set_psi_id

#define mysql_thread_set_psi_id (   I)    inline_mysql_thread_set_psi_id(I)

Set the thread identifier for the instrumentation.

Parameters
IThe thread identifier

◆ mysql_thread_set_psi_THD

#define mysql_thread_set_psi_THD (   T)    inline_mysql_thread_set_psi_THD(T)

Set the thread sql session for the instrumentation.

Parameters
TThe thread sql session

Function Documentation

◆ inline_mysql_thread_create()

static int inline_mysql_thread_create ( PSI_thread_key  key,
unsigned int  sequence_number,
my_thread_handle thread,
const my_thread_attr_t attr,
my_start_routine  start_routine,
void *  arg 
)
inlinestatic

◆ inline_mysql_thread_register()

static void inline_mysql_thread_register ( const char *  category,
PSI_thread_info info,
int  count 
)
inlinestatic

◆ inline_mysql_thread_set_psi_id()

static void inline_mysql_thread_set_psi_id ( my_thread_id  id)
inlinestatic

◆ inline_mysql_thread_set_psi_THD()

static void inline_mysql_thread_set_psi_THD ( THD thd)
inlinestatic

◆ mysql_thread_set_info()

static void mysql_thread_set_info ( const char *  str,
int  len 
)
inlinestatic

Set the INFO attribute in the thread instrumentation.

Parameters
strquery string
lenquery length

◆ mysql_thread_set_peer_port()

static void mysql_thread_set_peer_port ( uint  port)
inlinestatic

◆ mysql_thread_set_secondary_engine()

static void mysql_thread_set_secondary_engine ( bool  secondary)
inlinestatic