
Issue #21338 has been updated by k0kubun (Takashi Kokubun). I see that you're calling `Numeric#times` in your profiled test code. We used to use a `block_given?` C call inside it to check if a block is given. @nobu changed it to `defined?(yield)` at commit:3dccb716daaee74d2ae00a5766fe1779fe220a81 to protect it from possible method redefinitions of `block_given?`. I think that's what's happening in your test code. It's effectively testing the implementation details of CRuby core methods like `Numeric#times`. And it can change between different Ruby minor versions. To make the test code less fragile, I recommend you to define every method you call in the profiled code yourself. ---------------------------------------- Bug #21338: TracePoint Not Triggered for Kernel#block_given? https://bugs.ruby-lang.org/issues/21338#change-113299 * Author: cfis (Charlie Savage) * Status: Rejected * ruby -v: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- When updating ruby-prof for Ruby 3.4, various tests now fail because a method enter/leave tracepoint is not triggered for `Kernel#block_given?` For example: https://github.com/ruby-prof/ruby-prof/blob/master/test/line_number_test.rb#... In 3.3 a tracepoint was triggered but not in earlier Ruby versions. -- https://bugs.ruby-lang.org/