50template <
typename Mutex>
97 msg <<
m_mutex->policy().to_string();
116 return (std::string(msg.str()));
198template <
typename Mutex>
214template <
typename Mutex>
331template <
typename Mutex>
339 typedef typename latch_meta_t::CounterType::Count
Count;
362 const char *
filename [[maybe_unused]],
Track aggregate metrics policy, used by the page mutex.
Definition: sync0policy.h:336
void init(const MutexType &mutex, latch_id_t id, const char *filename, uint32_t line) 1
Called when the mutex is "created".
Definition: sync0policy.h:361
latch_meta_t::CounterType Counter
Definition: sync0policy.h:444
void locked(const MutexType &mutex, const char *filename, ulint line) 1
Called when the mutex is locked.
Definition: sync0policy.h:413
void add(uint32_t n_spins, uint32_t n_waits) 1
Called after a successful mutex acquire.
Definition: sync0policy.h:398
void destroy() 1
Called when the mutex is destroyed.
Definition: sync0policy.h:381
std::string to_string() const
Definition: sync0policy.ic:42
std::string print() const 1
Print the information about the latch.
latch_meta_t::CounterType::Count Count
Definition: sync0policy.h:339
void enter(const MutexType &mutex, const char *filename, ulint line) 1
Called when an attempt is made to lock the mutex.
Definition: sync0policy.h:428
Counter::Count * m_count
The user visible counters, registered with the meta-data.
Definition: sync0policy.h:447
void release(const MutexType &mutex) 1
Called when the mutex is released.
Definition: sync0policy.h:420
Mutex MutexType
Definition: sync0policy.h:338
BlockMutexPolicy()
Default constructor.
Definition: sync0policy.h:342
~BlockMutexPolicy()=default
Destructor.
latch_id_t m_id
Latch meta data ID.
Definition: sync0policy.h:450
latch_id_t get_id() const
Definition: sync0policy.h:438
Definition: sync0policy.h:51
const char * get_enter_filename() const 1
Definition: sync0policy.h:177
bool is_owned() const 1
Definition: sync0policy.h:172
ulint get_enter_line() const 1
Definition: sync0policy.h:182
uint32_t m_magic_n
Magic number to check for memory corruption.
Definition: sync0policy.h:190
std::thread::id get_thread_id() const 1
Definition: sync0policy.h:185
void destroy() 1
Mutex is being destroyed.
Definition: sync0policy.h:140
Context m_context
Latch state of the mutex owner.
Definition: sync0policy.h:193
void enter(const Mutex *mutex, const char *filename, ulint line) 1
Called when an attempt is made to lock the mutex.
Definition: sync0policy.ic:61
void release(const Mutex *mutex) 1
Called when the mutex is released.
Definition: sync0policy.ic:87
void locked(const Mutex *mutex, const char *filename, ulint line) 1
Called when the mutex is locked.
Definition: sync0policy.ic:76
void init(latch_id_t id) 1
Called when the mutex is "created".
Definition: sync0policy.ic:52
MutexDebug()
Constructor.
Definition: sync0policy.h:133
Definition: gcs_xcom_synode.h:64
pid_type get_id()
Definition: process.h:48
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2870
const char * filename
Definition: pfs_example_component_population.cc:67
Server monitor counter related defines.
Collect the metrics per mutex instance, no aggregation.
Definition: sync0policy.h:219
void locked(const MutexType &mutex, const char *filename, ulint line) 1
Called when the mutex is locked.
Definition: sync0policy.h:298
void destroy() 1
Called when the mutex is destroyed.
Definition: sync0policy.h:257
std::string print() const 1
Print the information about the latch.
~GenericPolicy()=default
Destructor.
latch_id_t get_id() const 1
Definition: sync0policy.h:314
void enter(const MutexType &mutex, const char *filename, ulint line) 1
Called when an attempt is made to lock the mutex.
Definition: sync0policy.h:289
Counter::Count m_count
The user visible counters, registered with the meta-data.
Definition: sync0policy.h:323
void add(uint32_t n_spins, uint32_t n_waits) 1
Called after a successful mutex acquire.
Definition: sync0policy.h:272
void release(const MutexType &mutex) 1
Called when the mutex is released.
Definition: sync0policy.h:305
latch_id_t m_id
Latch meta data ID.
Definition: sync0policy.h:326
Mutex MutexType
Definition: sync0policy.h:221
std::string to_string() const
Definition: sync0policy.ic:37
latch_meta_t::CounterType Counter
Definition: sync0policy.h:320
void init(const MutexType &mutex, latch_id_t id, const char *filename, uint32_t line) 1
Called when the mutex is "created".
Definition: sync0policy.h:241
GenericPolicy() 1
Constructor.
Definition: sync0policy.h:224
For passing context to SyncDebug.
Definition: sync0policy.h:54
std::thread::id m_thread_id
Thread ID of the thread that own(ed) the mutex.
Definition: sync0policy.h:129
std::string to_string() const override 1
Print information about the latch.
Definition: sync0policy.h:94
virtual std::string locked_from() const override
Definition: sync0policy.h:111
Context()
Constructor.
Definition: sync0policy.h:56
void release() 1
Reset to unlock state.
Definition: sync0policy.h:82
const Mutex * m_mutex
Mutex to check for lock order violation.
Definition: sync0policy.h:120
ulint m_line
Line number in filename.
Definition: sync0policy.h:126
Context(latch_id_t id)
Create the context for SyncDebug.
Definition: sync0policy.h:63
void locked(const Mutex *mutex, const char *filename, ulint line) 1
Set to locked state.
Definition: sync0policy.h:70
const char * m_filename
Filename from where enter was called.
Definition: sync0policy.h:123
Definition: sync0policy.h:199
std::string to_string() const
Definition: sync0policy.h:209
void add(uint32_t, uint32_t) 1
Definition: sync0policy.h:206
void init(const Mutex &, latch_id_t, const char *, uint32_t) 1
Definition: sync0policy.h:203
void enter(const Mutex &, const char *, ulint line) 1
Definition: sync0policy.h:205
NoPolicy()=default
Default constructor.
latch_id_t get_id() const
void release(const Mutex &) 1
Definition: sync0policy.h:208
void destroy() 1
Definition: sync0policy.h:204
void locked(const Mutex &, const char *, ulint) 1
Definition: sync0policy.h:207
All (ordered) latches, used in debugging, must derive from this class.
Definition: sync0types.h:960
constexpr uint32_t MUTEX_MAGIC_N
Definition: sync0policy.h:48
void sync_file_created_register(const void *ptr, const char *filename, uint16_t line)
Register a latch, called when it is created.
Definition: sync0debug.cc:1641
latch_meta_t & sync_latch_get_meta(latch_id_t id)
Get the latch meta-data from the latch ID.
Definition: sync0types.h:881
latch_id_t
Each latch has an ID.
Definition: sync0types.h:342
const char * sync_basename(const char *filename)
Print the filename "basename".
Definition: sync0sync.cc:217
void sync_file_created_deregister(const void *ptr)
Deregister a latch, called when it is destroyed.
Definition: sync0debug.cc:1648
Version control for database, common definitions, and include files.
#define IF_DEBUG(...)
Definition: univ.i:674
#define UNIV_NOTHROW
Definition: univ.i:456
unsigned long int ulint
Definition: univ.i:406
constexpr ulint ULINT_UNDEFINED
The 'undefined' value for a ulint.
Definition: univ.i:420
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:69
#define ut_d(EXPR)
Debug statement.
Definition: ut0dbg.h:71
Random numbers and hashing.
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510