MySQL 8.4.3
Source Code Documentation
|
Thread instrument information. More...
#include <psi_thread_bits.h>
Public Attributes | |
PSI_thread_key * | m_key |
Pointer to the key assigned to the registered thread. More... | |
const char * | m_name |
The name of the thread instrument to register. More... | |
const char * | m_os_name |
The thread name to advertise to the operating system. More... | |
unsigned int | m_flags |
The flags of the thread to register. More... | |
int | m_volatility |
Volatility index. More... | |
const char * | m_documentation |
Documentation. More... | |
Thread instrument information.
const char* PSI_thread_info_v5::m_documentation |
Documentation.
unsigned int PSI_thread_info_v5::m_flags |
The flags of the thread to register.
PSI_thread_key* PSI_thread_info_v5::m_key |
Pointer to the key assigned to the registered thread.
const char* PSI_thread_info_v5::m_name |
The name of the thread instrument to register.
const char* PSI_thread_info_v5::m_os_name |
The thread name to advertise to the operating system.
The performance schema thread instrumentation exports instrumented names to the operating system, so they can be visible in:
This feature is optional, and improves observability for platforms that support a flavor of pthread_setname_np(). On other platforms, there are no effects.
Performance schema thread names can be instrumented in different ways.
First, the thread can be unique (PSI_FLAG_SINGLETON
). In this case, the m_os_name
attribute is printed as is.
Second, for threads that exist in multiple instances (flag PSI_FLAG_SINGLETON
not set), the caller code should pass a sequence number when creating a thread instance with new_thread_v5_t
or spawn_thread_v5_t
.
This sequence number is concatenated (with a dash) to the m_os_name
so that a thread name "foo" with a sequence of "12" is displayed as "foo-12". When the actual value of the sequence number has a special meaning to the instrumented code (for example, a worker number is also exposed in different places), this is the preferred instrumentation.
Third, for threads that exist in multiple instances, but do not rely on a specific numbering, setting the flag PSI_FLAG_AUTO_SEQNUM
causes the performance schema to number threads automatically, so the calling code does not have to do it.
Fourth and last, for threads that exist in multiple instances, and are executed so often that the total number of threads grows to a very large number (for example, user sessions), numbering threads is not practical because of size limitations, and would introduce just noise in the ps output.
For this case, the flag PSI_FLAG_NO_SEQNUM
can be used to avoid numbering.
int PSI_thread_info_v5::m_volatility |
Volatility index.