diff options
author | Chris Seaton <chris.seaton@shopify.com> | 2022-12-07 19:09:30 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-07 17:09:30 -0800 |
commit | 645cd94d9a2383f973ae2fd83fef7024ae59c679 (patch) | |
tree | 8228e9a5407f6ef19f7c652c489e550b0204eb89 /debug_counter.c | |
parent | a2d3f5606a241999feda113f7331cf1a637bcaf0 (diff) | |
download | ruby-645cd94d9a2383f973ae2fd83fef7024ae59c679.tar.gz |
Add debug counters to RubyVM.stat (#6086)
* Add debug counters to RubyVM.stat
* Use SIZET2NUM
Co-author: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Prefix debug_counter_names
Diffstat (limited to 'debug_counter.c')
-rw-r--r-- | debug_counter.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/debug_counter.c b/debug_counter.c index cbaf15d496..463bebf849 100644 --- a/debug_counter.c +++ b/debug_counter.c @@ -16,7 +16,7 @@ #if USE_DEBUG_COUNTER -static const char *const debug_counter_names[] = { +const char *const rb_debug_counter_names[] = { #define DEBUG_COUNTER_NAME_EMPTY "" /* Suppress -Wstring-concatenation */ DEBUG_COUNTER_NAME_EMPTY #undef DEBUG_COUNTER_NAME_EMPTY @@ -26,7 +26,7 @@ static const char *const debug_counter_names[] = { }; MJIT_SYMBOL_EXPORT_BEGIN -size_t rb_debug_counter[numberof(debug_counter_names)]; +size_t rb_debug_counter[numberof(rb_debug_counter_names)]; void rb_debug_counter_add_atomic(enum rb_debug_counter_type type, int add); MJIT_SYMBOL_EXPORT_END @@ -67,7 +67,7 @@ ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr) int i; if (names_ptr != NULL) { for (i=0; i<RB_DEBUG_COUNTER_MAX; i++) { - names_ptr[i] = debug_counter_names[i]; + names_ptr[i] = rb_debug_counter_names[i]; } } if (counters_ptr != NULL) { @@ -97,7 +97,7 @@ rb_debug_counter_show_results(const char *msg) fprintf(stderr, "[RUBY_DEBUG_COUNTER]\t%d %s\n", getpid(), msg); for (i=0; i<RB_DEBUG_COUNTER_MAX; i++) { fprintf(stderr, "[RUBY_DEBUG_COUNTER]\t%-30s\t%'14"PRIuSIZE"\n", - debug_counter_names[i], + rb_debug_counter_names[i], rb_debug_counter[i]); } } |