summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-11-23 09:02:14 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2022-11-23 14:18:10 -0800
commite788215125a015d32281aff0a7891d2d2020dbcb (patch)
tree0e2ccee73e12d514f3ab936427f5aeca4e9c38a4 /vm.c
parenta50aabde9cf3b58c63563427b2e7d22c60370cdd (diff)
downloadruby-e788215125a015d32281aff0a7891d2d2020dbcb.tar.gz
Add next_shape_id to vm stats
We need to track this number in CI. It's important to know how changes to the codebase impact the number of shapes in the system, so lets add the number to the VM stat hash
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vm.c b/vm.c
index 7bb17036dc..7de6322877 100644
--- a/vm.c
+++ b/vm.c
@@ -588,7 +588,7 @@ rb_dtrace_setup(rb_execution_context_t *ec, VALUE klass, ID id,
static VALUE
vm_stat(int argc, VALUE *argv, VALUE self)
{
- static VALUE sym_constant_cache_invalidations, sym_constant_cache_misses, sym_global_cvar_state;
+ static VALUE sym_constant_cache_invalidations, sym_constant_cache_misses, sym_global_cvar_state, sym_next_shape_id;
VALUE arg = Qnil;
VALUE hash = Qnil, key = Qnil;
@@ -609,6 +609,7 @@ vm_stat(int argc, VALUE *argv, VALUE self)
S(constant_cache_invalidations);
S(constant_cache_misses);
S(global_cvar_state);
+ S(next_shape_id);
#undef S
#define SET(name, attr) \
@@ -620,6 +621,7 @@ vm_stat(int argc, VALUE *argv, VALUE self)
SET(constant_cache_invalidations, ruby_vm_constant_cache_invalidations);
SET(constant_cache_misses, ruby_vm_constant_cache_misses);
SET(global_cvar_state, ruby_vm_global_cvar_state);
+ SET(next_shape_id, (rb_serial_t)GET_VM()->next_shape_id);
#undef SET
if (!NIL_P(key)) { /* matched key should return above */