Module: PLine

Extended by:
Summarize, Util
Defined in:
lib/pline.rb,
lib/pline/minfo.rb,
lib/pline/summarize.rb

Defined Under Namespace

Modules: Summarize, Util Classes: MethodInfo, SourceInfo

Constant Summary

Constants included from Summarize

Summarize::DEFAULT_OUTPUT, Summarize::DIVISOR_MSEC, Summarize::DIVISOR_NSEC, Summarize::DIVISOR_SEC, Summarize::DIVISOR_USEC

Class Method Summary collapse

Methods included from Util

bug, dlog, todo, vlog

Methods included from Summarize

output=, show_msec, show_nsec, show_sec, show_usec

Class Method Details

.profile(*args) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'ext/pline/profiler.c', line 101

static VALUE profiler_m_profile(int argc, VALUE *argv, VALUE self)
{
  rb_iseq_t *iseq;
  VALUE minfo, obj, mid, singleton_p = Qfalse;

  rb_scan_args(argc, argv, "21", &obj, &mid, &singleton_p);

  if (rb_obj_class(mid) != rb_cSymbol) {
    rb_raise(rb_eArgError, "second argument should be symbol");
  }

  iseq = iseq_find(obj, mid, singleton_p);
  minfo = rb_funcall(cMethodInfo, rb_intern("new"), 4, iseq->self, obj, mid, singleton_p);
  iseq_inject(iseq);
  profiler_linetrace(0);
  rb_funcall(cMethodInfo, rb_intern("register"), 1, minfo);

  return Qnil;
}