Issue #15963 has been updated by gmcgibbon (Gannon McGibbon).


I have been using `Hash#clear` to clear the constants, but that's because a `clear` method doesn't exist. I will add the following to the PR:

```
rb_define_singleton_method(rb_cRubyVM, "USAGE_ANALYSIS_INSN_CLEAR", usage_analysis_insn_clear, 0);
rb_define_singleton_method(rb_cRubyVM, "USAGE_ANALYSIS_OPERAND_CLEAR", usage_analysis_operand_clear, 0);
rb_define_singleton_method(rb_cRubyVM, "USAGE_ANALYSIS_REGISTER_CLEAR", usage_analysis_register_clear, 0);
```

----------------------------------------
Feature #15963: Add *_start and *_running methods to VM_COLLECT_USAGE_DETAILS API
https://bugs.ruby-lang.org/issues/15963#change-80417

* Author: gmcgibbon (Gannon McGibbon)
* Status: Open
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version: 
----------------------------------------
I want to count how many VM instructions get executed for an arbitrary block of ruby code with `VM_COLLECT_USAGE_DETAILS` enabled. However, the current API enables VM usage detail collection immediately and only exposes methods to turn collection off.

I've issued a PR to add more methods to the VM usage details API and to disable collection by default: https://github.com/ruby/ruby/pull/2258




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>