summaryrefslogtreecommitdiff
path: root/vm_sync.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm_sync.h')
-rw-r--r--vm_sync.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/vm_sync.h b/vm_sync.h
index 8712e1a1ca..b8ebb3bbc5 100644
--- a/vm_sync.h
+++ b/vm_sync.h
@@ -3,6 +3,7 @@
#define RUBY_VM_SYNC_H
#include "vm_debug.h"
+#include "debug_counter.h"
#if USE_RUBY_DEBUG_LOG
#define LOCATION_ARGS const char *file, int line
@@ -51,6 +52,8 @@ rb_multi_ractor_p(void)
static inline void
rb_vm_lock(const char *file, int line)
{
+ RB_DEBUG_COUNTER_INC(vm_sync_lock);
+
if (rb_multi_ractor_p()) {
rb_vm_lock_body(LOCATION_PARAMS);
}
@@ -67,6 +70,8 @@ rb_vm_unlock(const char *file, int line)
static inline void
rb_vm_lock_enter(unsigned int *lev, const char *file, int line)
{
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter);
+
if (rb_multi_ractor_p()) {
rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS);
}
@@ -75,6 +80,8 @@ rb_vm_lock_enter(unsigned int *lev, const char *file, int line)
static inline void
rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line)
{
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_nb);
+
if (rb_multi_ractor_p()) {
rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS);
}
@@ -91,6 +98,7 @@ rb_vm_lock_leave(unsigned int *lev, const char *file, int line)
static inline void
rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
{
+ RB_DEBUG_COUNTER_INC(vm_sync_lock_enter_cr);
rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
}