summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorYusuke Endoh <[email protected]>2020-07-08 17:32:28 +0900
committerYusuke Endoh <[email protected]>2020-07-28 13:18:08 +0900
commitda31900d9d9e4e9dcd6381a23dd863b18fe65e3d ()
tree354d7cecad4199e23ddf923344c7f48be05455d3 /vm_backtrace.c
parente4b63202eb25ee86c5173364c13a8ead02419f7d (diff)
vm_backtrace.c: let rb_profile_frames show cfunc frames
... in addition to normal iseq frames. It is sometimes useful to point the bottleneck more precisely.
Notes: Merged: https://.com/ruby/ruby/pull/3299
-rw-r--r--vm_backtrace.c67
1 files changed, 63 insertions, 4 deletions
@@ -1360,6 +1360,14 @@ rb_profile_frames(int start, int limit, VALUE *buff, int *lines)
i++;
}
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
@@ -1399,9 +1407,42 @@ rb_profile_frame_path(VALUE frame)
return iseq ? rb_iseq_path(iseq) : Qnil;
}
VALUE
rb_profile_frame_absolute_path(VALUE frame)
{
const rb_iseq_t *iseq = frame2iseq(frame);
return iseq ? rb_iseq_realpath(iseq) : Qnil;
}
@@ -1479,15 +1520,18 @@ rb_profile_frame_singleton_method_p(VALUE frame)
VALUE
rb_profile_frame_method_name(VALUE frame)
{
const rb_iseq_t *iseq = frame2iseq(frame);
return iseq ? rb_iseq_method_name(iseq) : Qnil;
}
-VALUE
-rb_profile_frame_qualified_method_name(VALUE frame)
{
- VALUE method_name = rb_profile_frame_method_name(frame);
-
if (method_name != Qnil) {
VALUE classpath = rb_profile_frame_classpath(frame);
VALUE singleton_p = rb_profile_frame_singleton_method_p(frame);
@@ -1506,8 +1550,23 @@ rb_profile_frame_qualified_method_name(VALUE frame)
}
VALUE
rb_profile_frame_full_label(VALUE frame)
{
VALUE label = rb_profile_frame_label(frame);
VALUE base_label = rb_profile_frame_base_label(frame);
VALUE qualified_method_name = rb_profile_frame_qualified_method_name(frame);