From 3af5298e8cc9d88fb0c763fb623b722a97912877 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 21 Aug 2015 09:51:01 +0000 Subject: * include/ruby/ruby.h, cont.c, vm_trace.c: add a new event fiber_switch. We need more discussion about this feature so that I don't write it on NEWS. [Feature #11348] * test/ruby/test_settracefunc.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_trace.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index 529cb720df..1ce11f9548 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -595,6 +595,7 @@ get_event_id(rb_event_flag_t event) C(b_return, B_RETURN); C(thread_begin, THREAD_BEGIN); C(thread_end, THREAD_END); + C(fiber_switch, FIBER_SWITCH); C(specified_line, SPECIFIED_LINE); case RUBY_EVENT_LINE | RUBY_EVENT_SPECIFIED_LINE: CONST_ID(id, "line"); return id; #undef C @@ -700,6 +701,7 @@ symbol2event_flag(VALUE v) C(b_return, B_RETURN); C(thread_begin, THREAD_BEGIN); C(thread_end, THREAD_END); + C(fiber_switch, FIBER_SWITCH); C(specified_line, SPECIFIED_LINE); C(a_call, A_CALL); C(a_return, A_RETURN); @@ -1445,6 +1447,7 @@ Init_vm_trace(void) * +:b_return+:: event hook at block ending * +:thread_begin+:: event hook at thread beginning * +:thread_end+:: event hook at thread ending + * +:fiber_siwtch+:: event hook at fiber switch * */ rb_cTracePoint = rb_define_class("TracePoint", rb_cObject); -- cgit v1.2.3