diff options
Diffstat (limited to 'test/lib')
-rw-r--r-- | test/lib/tracepointchecker.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/lib/tracepointchecker.rb b/test/lib/tracepointchecker.rb index 2fa40546b2..47822ecef5 100644 --- a/test/lib/tracepointchecker.rb +++ b/test/lib/tracepointchecker.rb @@ -6,9 +6,16 @@ module TracePointChecker } module ZombieTraceHunter - def before_setup - @tracepoint_captured_stat = TracePoint.stat.map{|k, (activated, deleted)| [k, activated, deleted]} + def tracepoint_capture_stat_get + TracePoint.stat.map{|k, (activated, deleted)| + deleted = 0 unless @tracepoint_captured_singlethread + [k, activated, deleted] + } + end + def before_setup + @tracepoint_captured_singlethread = (Thread.list.size == 1) + @tracepoint_captured_stat = tracepoint_capture_stat_get() super end @@ -18,7 +25,7 @@ module TracePointChecker # detect zombie traces. assert_equal( @tracepoint_captured_stat, - TracePoint.stat.map{|k, (activated, deleted)| [k, activated, deleted]}, + tracepoint_capture_stat_get(), "The number of active/deleted trace events was changed" ) # puts "TracePoint - deleted: #{deleted}" if deleted > 0 |