summaryrefslogtreecommitdiff
path: root/spec/ruby/core/tracepoint
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-08-21 10:15:01 -0700
committerGitHub <noreply@github.com>2021-08-21 10:15:01 -0700
commit48c8df9e0eb295af06d593ce37ce1933c0ee1d90 (patch)
tree4a8092796f397a12835f89c4f220a84fa8f5f867 /spec/ruby/core/tracepoint
parentf51a6ace06cecd193bf00747a63809849e254050 (diff)
Allow tracing of optimized methods
This updates the trace instructions to directly dispatch to opt_send_without_block. So this should cause no slowdown in non-trace mode. To enable the tracing of the optimized methods, RUBY_EVENT_C_CALL and RUBY_EVENT_C_RETURN are added as events to the specialized instructions. Fixes [Bug #14870] Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4739 Merged-By: jeremyevans <code@jeremyevans.net>
Diffstat (limited to 'spec/ruby/core/tracepoint')
-rw-r--r--spec/ruby/core/tracepoint/inspect_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/ruby/core/tracepoint/inspect_spec.rb b/spec/ruby/core/tracepoint/inspect_spec.rb
index 06bed9c99a..67e2ad1494 100644
--- a/spec/ruby/core/tracepoint/inspect_spec.rb
+++ b/spec/ruby/core/tracepoint/inspect_spec.rb
@@ -65,11 +65,12 @@ describe 'TracePoint#inspect' do
it 'returns a String showing the event, method, path and line for a :c_call event' do
inspect = nil
line = nil
- TracePoint.new(:c_call) { |tp|
+ tp = TracePoint.new(:c_call) { |tp|
next unless TracePointSpec.target_thread?
inspect ||= tp.inspect
- }.enable do
- line = __LINE__ + 1
+ }
+ line = __LINE__ + 2
+ tp.enable do
[0, 1].max
end