mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add UJIT.reset_stats!
To allow analyzing sections of the application.
This commit is contained in:
parent
699bf97493
commit
8302eb57b0
2 changed files with 19 additions and 0 deletions
6
ujit.rb
6
ujit.rb
|
@ -43,6 +43,12 @@ module UJIT
|
||||||
Primitive.get_stat_counters
|
Primitive.get_stat_counters
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Discard statistics collected for --ujit-stats.
|
||||||
|
def self.reset_stats!
|
||||||
|
# defined in ujit_iface.c
|
||||||
|
Primitive.reset_stats_bang
|
||||||
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
13
ujit_iface.c
13
ujit_iface.c
|
@ -561,6 +561,19 @@ get_stat_counters(rb_execution_context_t *ec, VALUE self)
|
||||||
#endif // if RUBY_DEBUG
|
#endif // if RUBY_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Primitive called in ujit.rb. Zero out all the counters.
|
||||||
|
static VALUE
|
||||||
|
reset_stats_bang(rb_execution_context_t *ec, VALUE self)
|
||||||
|
{
|
||||||
|
#if RUBY_DEBUG
|
||||||
|
vm_insns_count = 0;
|
||||||
|
rb_compiled_iseq_count = 0;
|
||||||
|
memset(&exit_op_count, 0, sizeof(exit_op_count));
|
||||||
|
memset(&ujit_runtime_counters, 0, sizeof(ujit_runtime_counters));
|
||||||
|
#endif // if RUBY_DEBUG
|
||||||
|
return Qnil;
|
||||||
|
}
|
||||||
|
|
||||||
#include "ujit.rbinc"
|
#include "ujit.rbinc"
|
||||||
|
|
||||||
#if RUBY_DEBUG
|
#if RUBY_DEBUG
|
||||||
|
|
Loading…
Add table
Reference in a new issue