vm_backtrace.c: let rb_profile_frames show cfunc frames#3299
Merged
mame merged 1 commit intoruby:masterfrom Jul 28, 2020
Merged
vm_backtrace.c: let rb_profile_frames show cfunc frames#3299mame merged 1 commit intoruby:masterfrom
mame merged 1 commit intoruby:masterfrom
Conversation
... in addition to normal iseq frames. It is sometimes useful to point the bottleneck more precisely.
dylanahsmith
reviewed
Aug 4, 2020
| else { | ||
| cme = rb_vm_frame_method_entry(cfp); | ||
| if (cme && cme->def->type == VM_METHOD_TYPE_CFUNC) { | ||
| buff[i] = (VALUE)cme; |
Contributor
There was a problem hiding this comment.
You forgot to handle the start argument. Although, it was already effectively being ignored (https://bugs.ruby-lang.org/issues/14607). I've updated #2713 to also fix the handling of the start argument for this branch.
ivoanjo
added a commit
to ivoanjo/backtracie
that referenced
this pull request
Mar 13, 2021
A few specs are still broken, but overall it seems to be close to working, **including what is effectively a backport of Ruby 3.0's addition of cfunc frames to this API** (<ruby/ruby#3299>)!.
aprocter-stripe
added a commit
to sorbet/sorbet
that referenced
this pull request
Jul 30, 2021
The patch is simply a cherry-pick of ruby/ruby#3299. This will allow us to see cfunc frames (e.g., Kernel#puts) in StackProf traces.
ivoanjo
added a commit
to DataDog/dd-trace-rb
that referenced
this pull request
May 4, 2022
…bies Ruby 3.0 finally added support for showing CFUNC frames (frames for methods written using native code) in stack traces gathered via `rb_profile_frames` (ruby/ruby#3299). To access this information on older Rubies, beyond using our custom `ddtrace_rb_profile_frames`, we also need to backport the Ruby 3.0+ version of `rb_profile_frame_method_name`.
ivoanjo
added a commit
to DataDog/dd-trace-rb
that referenced
this pull request
May 18, 2022
…bies Ruby 3.0 finally added support for showing CFUNC frames (frames for methods written using native code) in stack traces gathered via `rb_profile_frames` (ruby/ruby#3299). To access this information on older Rubies, beyond using our custom `ddtrace_rb_profile_frames`, we also need to backport the Ruby 3.0+ version of `rb_profile_frame_method_name`.
ivoanjo
added a commit
to DataDog/dd-trace-rb
that referenced
this pull request
May 20, 2022
…bies Ruby 3.0 finally added support for showing CFUNC frames (frames for methods written using native code) in stack traces gathered via `rb_profile_frames` (ruby/ruby#3299). To access this information on older Rubies, beyond using our custom `ddtrace_rb_profile_frames`, we also need to backport the Ruby 3.0+ version of `rb_profile_frame_method_name`.
ivoanjo
added a commit
to DataDog/dd-trace-rb
that referenced
this pull request
May 23, 2022
…bies Ruby 3.0 finally added support for showing CFUNC frames (frames for methods written using native code) in stack traces gathered via `rb_profile_frames` (ruby/ruby#3299). To access this information on older Rubies, beyond using our custom `ddtrace_rb_profile_frames`, we also need to backport the Ruby 3.0+ version of `rb_profile_frame_method_name`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
... in addition to normal iseq frames.
It is sometimes useful to point the bottleneck more precisely.
An example code:
stackprof --d3-flamegraphbefore the patch:stackprof --d3-flamegraphafter the patch: