ruby-changes:26971
From: nobu <ko1@a...>
Date: Sun, 3 Feb 2013 09:40:10 +0900 (JST)
Subject: [ruby-changes:26971] nobu:r39023 (trunk): profiler.rb: block calls
nobu 2013-02-03 09:38:46 +0900 (Sun, 03 Feb 2013) New Revision: 39023 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39023 Log: profiler.rb: block calls * lib/profiler.rb (PROFILE_CALL_PROC, PROFILE_RETURN_PROC): add b_call and b_return to profile block calls. Modified files: trunk/ChangeLog trunk/lib/profiler.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 39022) +++ ChangeLog (revision 39023) @@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 -Sun Feb 3 09:37:22 2013 Nobuyoshi Nakada <nobu@r...> +Sun Feb 3 09:38:44 2013 Nobuyoshi Nakada <nobu@r...> + + * lib/profiler.rb (PROFILE_CALL_PROC, PROFILE_RETURN_PROC): add b_call + and b_return to profile block calls. * lib/profiler.rb (PROFILE_CALL_PROC, PROFILE_RETURN_PROC): split PROFILE_PROC for call and return events. Index: lib/profiler.rb =================================================================== --- lib/profiler.rb (revision 39022) +++ lib/profiler.rb (revision 39023) @@ -76,12 +76,12 @@ module Profiler__ https://github.com/ruby/ruby/blob/trunk/lib/profiler.rb#L76 @@start = nil # the start time that profiling began @@stacks = nil # the map of stacks keyed by thread @@maps = nil # the map of call data keyed by thread, class and id. Call data contains the call count, total time, - PROFILE_CALL_PROC = TracePoint.new(:call, :c_call) {|tp| # :nodoc: + PROFILE_CALL_PROC = TracePoint.new(*%i[call c_call b_call]) {|tp| # :nodoc: now = Process.times[0] stack = (@@stacks[Thread.current] ||= []) stack.push [now, 0.0] } - PROFILE_RETURN_PROC = TracePoint.new(:return, :c_return) {|tp| # :nodoc: + PROFILE_RETURN_PROC = TracePoint.new(*%i[return c_return b_return]) {|tp| # :nodoc: now = Process.times[0] key = Wrapper.new(tp.defined_class, tp.method_id) stack = (@@stacks[Thread.current] ||= []) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/