MySQL 8.0.40
Source Code Documentation
|
Track mutex file creation name and line number. More...
Classes | |
struct | File |
For tracking the filename and line number. More... | |
Public Member Functions | |
CreateTracker () 1 | |
Constructor. More... | |
~CreateTracker () 1 | |
Destructor. More... | |
void | register_latch (const void *ptr, const char *filename, uint16_t line) 1 |
Register where the latch was created. More... | |
void | deregister_latch (const void *ptr) 1 |
Deregister a latch - when it is destroyed. More... | |
std::string | get (const void *ptr) 1 |
Get the create string, format is "name:line". More... | |
Private Types | |
typedef std::map< const void *, File, std::less< const void * >, ut::allocator< std::pair< const void *const, File > > > | Files |
Map the mutex instance to where it was created. More... | |
typedef OSMutex | Mutex |
Private Attributes | |
Mutex | m_mutex |
Mutex protecting m_files. More... | |
Files | m_files |
Track the latch creation. More... | |
Track mutex file creation name and line number.
This is to avoid storing { const char* name; uint16_t line; } in every instance. This results in the sizeof(Mutex) > 64. We use a lookup table to store it separately. Fetching the values is very rare, only required for diagnostic purposes. And, we don't create/destroy mutexes that frequently.
|
private |
Map the mutex instance to where it was created.
|
private |
|
inline |
Constructor.
|
inline |
Destructor.
|
inline |
Deregister a latch - when it is destroyed.
[in] | ptr | Latch instance being destroyed |
|
inline |
Get the create string, format is "name:line".
[in] | ptr | Latch instance |
|
inline |
Register where the latch was created.
[in] | ptr | Latch instance |
[in] | filename | Where created |
[in] | line | Line number in filename |
|
private |
Track the latch creation.
|
private |
Mutex protecting m_files.