  		EXEC_EVENT_HOOK(th, RUBY_EVENT_END, th->cfp->self, 0, 0);
 Index: vm_insnhelper.c
 ===================================================================
---- vm_insnhelper.c	(revision 27800)
+--- vm_insnhelper.c	(revision 27874)
 +++ vm_insnhelper.c	(working copy)
 @@ -26,9 +26,12 @@
  	      const VALUE *pc, VALUE *sp, VALUE *lfp,

     if (!rb_obj_is_proc(trace)) {
 	rb_raise(rb_eTypeError, "trace_func needs to be Proc");
     }
-
-    rb_threadptr_add_event_hook(th, call_trace_func, RUBY_EVENT_ALL, trace);
+    rb_threadptr_add_event_hook(th, call_trace_func, events, trace);
 }
 
 /*
  *  call-seq:
- *     thr.add_trace_func(proc)    => proc
+ *     thr.add_trace_func(proc, events=RUBY_EVENT_ALL)    => proc
  *
  *  Adds _proc_ as a handler for tracing.

 
 /*
  *  call-seq:
- *     thr.set_trace_func(proc)    -> proc
+ *     thr.set_trace_func(proc, events=RB_EVENT_ALL)    => proc
  *     thr.set_trace_func(nil)     -> nil
  *
  *  Establishes _proc_ on _thr_ as the handler for tracing, or
@@ -3979,16 +4054,24 @@
