19static const char *
const debug_counter_names[] = {
21#define RB_DEBUG_COUNTER(name) #name,
23#undef RB_DEBUG_COUNTER
27size_t rb_debug_counter[
numberof(debug_counter_names)];
31rb_nativethread_lock_t debug_counter_lock;
35debug_counter_setup(
void)
50int debug_counter_disable_show_at_exit = 0;
58 case RB_DEBUG_COUNTER_mjit_length_unit_queue:
59 case RB_DEBUG_COUNTER_mjit_length_active_units:
60 case RB_DEBUG_COUNTER_mjit_length_compact_units:
61 case RB_DEBUG_COUNTER_mjit_length_stale_units:
65 rb_debug_counter[i] = 0;
76 if (names_ptr !=
NULL) {
78 names_ptr[i] = debug_counter_names[i];
81 if (counters_ptr !=
NULL) {
83 counters_ptr[i] = rb_debug_counter[i];
93 debug_counter_disable_show_at_exit = !enable;
99 const char *
env =
getenv(
"RUBY_DEBUG_COUNTER_DISABLE");
101 setlocale(LC_NUMERIC,
"");
105 fprintf(stderr,
"[RUBY_DEBUG_COUNTER]\t%d %s\n", getpid(), msg);
107 fprintf(stderr,
"[RUBY_DEBUG_COUNTER]\t%-30s\t%'14"PRIuSIZE"\n",
108 debug_counter_names[i],
109 rb_debug_counter[i]);
131debug_counter_show_results_at_exit(
void)
133 if (debug_counter_disable_show_at_exit == 0) {
void rb_debug_counter_show_results(const char *msg)
size_t ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr)
void ruby_debug_counter_show_at_exit(int enable)
void ruby_debug_counter_reset(void)
#define MJIT_SYMBOL_EXPORT_END
#define MJIT_SYMBOL_EXPORT_BEGIN
void *PTR64 __attribute__((mode(DI)))
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
VALUE type(ANYARGS)
ANYARGS-ed function type.
void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock)
void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock)
void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock)