diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-16 02:47:58 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-16 02:47:58 +0000 |
commit | 23e452b17b604c35339265b480b900581abc2ce3 (patch) | |
tree | 52e682beed9b5df4cd7c014c9f0fe63f267c2d30 /test | |
parent | 575993d74386157a9554e2b4f9f350d673be9613 (diff) | |
download | ruby-23e452b17b604c35339265b480b900581abc2ce3.tar.gz |
cleanup hook cleanup code.
* vm_trace.c: before this patch, deleted hooks are remvoed at
*the beggining* of hooks (exec_hooks_precheck).
This patch cleanup deleted hooks at
(1) just after hook is deleted (TracePoint#disable and so on)
(2) just after executing hooks (exec_hooks_postcheck)
Most of time (1) is enough, but if some threads running hooks,
we need to wait cleaning up deleted hooks until threads finish
running the hooks. This is why (2) is introduced (and this is
why current impl cleanup deleted hooks at the beggining of hooks).
* test/lib/tracepointchecker.rb: check also the number of delete
waiting hooks.
* cont.c (cont_restore_thread): fix VM->trace_running count.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/tracepointchecker.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lib/tracepointchecker.rb b/test/lib/tracepointchecker.rb index 447a63bc1e..2fa40546b2 100644 --- a/test/lib/tracepointchecker.rb +++ b/test/lib/tracepointchecker.rb @@ -7,7 +7,7 @@ module TracePointChecker module ZombieTraceHunter def before_setup - @tracepoint_captured_stat = TracePoint.stat.map{|k, (activated, _deleted)| [k, activated]} + @tracepoint_captured_stat = TracePoint.stat.map{|k, (activated, deleted)| [k, activated, deleted]} super end @@ -18,8 +18,8 @@ module TracePointChecker # detect zombie traces. assert_equal( @tracepoint_captured_stat, - TracePoint.stat.map{|k, (activated, _deleted)| [k, activated]}, - "The number of active trace events was changed" + TracePoint.stat.map{|k, (activated, deleted)| [k, activated, deleted]}, + "The number of active/deleted trace events was changed" ) # puts "TracePoint - deleted: #{deleted}" if deleted > 0 |