* vm_sync_lock
* vm_sync_lock_enter
* vm_sync_lock_enter_nb
* vm_sync_lock_enter_cr
* vm_sync_barrier
This commit is contained in:
Koichi Sasada 2020-12-16 10:10:05 +09:00
Родитель 171f0431e7
Коммит 0b678cc9e5
4 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -4464,6 +4464,7 @@ encoding.$(OBJEXT): {$(VPATH)}backward/2/long_long.h
encoding.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h encoding.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
encoding.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h encoding.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
encoding.$(OBJEXT): {$(VPATH)}config.h encoding.$(OBJEXT): {$(VPATH)}config.h
encoding.$(OBJEXT): {$(VPATH)}debug_counter.h
encoding.$(OBJEXT): {$(VPATH)}defines.h encoding.$(OBJEXT): {$(VPATH)}defines.h
encoding.$(OBJEXT): {$(VPATH)}encindex.h encoding.$(OBJEXT): {$(VPATH)}encindex.h
encoding.$(OBJEXT): {$(VPATH)}encoding.c encoding.$(OBJEXT): {$(VPATH)}encoding.c
@ -4639,6 +4640,7 @@ enum.$(OBJEXT): $(top_srcdir)/internal/numeric.h
enum.$(OBJEXT): $(top_srcdir)/internal/object.h enum.$(OBJEXT): $(top_srcdir)/internal/object.h
enum.$(OBJEXT): $(top_srcdir)/internal/proc.h enum.$(OBJEXT): $(top_srcdir)/internal/proc.h
enum.$(OBJEXT): $(top_srcdir)/internal/rational.h enum.$(OBJEXT): $(top_srcdir)/internal/rational.h
enum.$(OBJEXT): $(top_srcdir)/internal/re.h
enum.$(OBJEXT): $(top_srcdir)/internal/serial.h enum.$(OBJEXT): $(top_srcdir)/internal/serial.h
enum.$(OBJEXT): $(top_srcdir)/internal/static_assert.h enum.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
enum.$(OBJEXT): $(top_srcdir)/internal/vm.h enum.$(OBJEXT): $(top_srcdir)/internal/vm.h
@ -13824,6 +13826,7 @@ symbol.$(OBJEXT): {$(VPATH)}backward/2/long_long.h
symbol.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h symbol.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
symbol.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h symbol.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
symbol.$(OBJEXT): {$(VPATH)}config.h symbol.$(OBJEXT): {$(VPATH)}config.h
symbol.$(OBJEXT): {$(VPATH)}debug_counter.h
symbol.$(OBJEXT): {$(VPATH)}defines.h symbol.$(OBJEXT): {$(VPATH)}defines.h
symbol.$(OBJEXT): {$(VPATH)}encoding.h symbol.$(OBJEXT): {$(VPATH)}encoding.h
symbol.$(OBJEXT): {$(VPATH)}gc.h symbol.$(OBJEXT): {$(VPATH)}gc.h
@ -15953,6 +15956,7 @@ vm_sync.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
vm_sync.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h vm_sync.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
vm_sync.$(OBJEXT): {$(VPATH)}config.h vm_sync.$(OBJEXT): {$(VPATH)}config.h
vm_sync.$(OBJEXT): {$(VPATH)}constant.h vm_sync.$(OBJEXT): {$(VPATH)}constant.h
vm_sync.$(OBJEXT): {$(VPATH)}debug_counter.h
vm_sync.$(OBJEXT): {$(VPATH)}defines.h vm_sync.$(OBJEXT): {$(VPATH)}defines.h
vm_sync.$(OBJEXT): {$(VPATH)}gc.h vm_sync.$(OBJEXT): {$(VPATH)}gc.h
vm_sync.$(OBJEXT): {$(VPATH)}id.h vm_sync.$(OBJEXT): {$(VPATH)}id.h

Просмотреть файл

@ -322,6 +322,13 @@ RB_DEBUG_COUNTER(theap_alloc)
RB_DEBUG_COUNTER(theap_alloc_fail) RB_DEBUG_COUNTER(theap_alloc_fail)
RB_DEBUG_COUNTER(theap_evacuate) RB_DEBUG_COUNTER(theap_evacuate)
// VM sync
RB_DEBUG_COUNTER(vm_sync_lock)
RB_DEBUG_COUNTER(vm_sync_lock_enter)
RB_DEBUG_COUNTER(vm_sync_lock_enter_nb)
RB_DEBUG_COUNTER(vm_sync_lock_enter_cr)
RB_DEBUG_COUNTER(vm_sync_barrier)
/* mjit_exec() counts */ /* mjit_exec() counts */
RB_DEBUG_COUNTER(mjit_exec) RB_DEBUG_COUNTER(mjit_exec)
RB_DEBUG_COUNTER(mjit_exec_not_added) RB_DEBUG_COUNTER(mjit_exec_not_added)

Просмотреть файл

@ -228,6 +228,8 @@ vm_barrier_finish_p(rb_vm_t *vm)
void void
rb_vm_barrier(void) rb_vm_barrier(void)
{ {
RB_DEBUG_COUNTER_INC(vm_sync_barrier);
if (!rb_multi_ractor_p()) { if (!rb_multi_ractor_p()) {
// no other ractors // no other ractors
return; return;

Просмотреть файл

@ -3,6 +3,7 @@
#define RUBY_VM_SYNC_H #define RUBY_VM_SYNC_H
#include "vm_debug.h" #include "vm_debug.h"
#include "debug_counter.h"
#if USE_RUBY_DEBUG_LOG #if USE_RUBY_DEBUG_LOG
#define LOCATION_ARGS const char *file, int line #define LOCATION_ARGS const char *file, int line
@ -51,6 +52,8 @@ rb_multi_ractor_p(void)
static inline void static inline void
rb_vm_lock(const char *file, int line) rb_vm_lock(const char *file, int line)
{ {
RB_DEBUG_COUNTER_INC(vm_sync_lock);
if (rb_multi_ractor_p()) { if (rb_multi_ractor_p()) {
rb_vm_lock_body(LOCATION_PARAMS); rb_vm_lock_body(LOCATION_PARAMS);
} }
@ -67,6 +70,8 @@ rb_vm_unlock(const char *file, int line)
static inline void static inline void
rb_vm_lock_enter(unsigned int *lev, const char *file, int line) 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()) { if (rb_multi_ractor_p()) {
rb_vm_lock_enter_body(lev APPEND_LOCATION_PARAMS); 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 static inline void
rb_vm_lock_enter_nb(unsigned int *lev, const char *file, int line) 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()) { if (rb_multi_ractor_p()) {
rb_vm_lock_enter_body_nb(lev APPEND_LOCATION_PARAMS); 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 static inline void
rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line) 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); rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
} }