trace(*args)
A convenience method for TracePoint.new, that activates the trace automatically.
trace = TracePoint.trace(:call) { |tp| [tp.lineno, tp.event] } #=> #<TracePoint:enabled> trace.enabled? #=> true
static VALUE tracepoint_trace_s(int argc, VALUE *argv, VALUE self) { VALUE trace = tracepoint_new_s(argc, argv, self); rb_tracepoint_enable(trace); return trace; }