[前][次][番号順一覧][スレッド一覧]

ruby-changes:67109

From: Koichi <ko1@a...>
Date: Tue, 10 Aug 2021 15:48:22 +0900 (JST)
Subject: [ruby-changes:67109] 42b6dc84d3 (master): add some lines to delete unused TracePoint

https://git.ruby-lang.org/ruby.git/commit/?id=42b6dc84d3

From 42b6dc84d3e0abb19432a1cf24f327b37b176fa8 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Tue, 10 Aug 2021 15:32:20 +0900
Subject: add some lines to delete unused TracePoint

`TracePoint.stat` returns the "to be deleted" TP numbers, and
http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20210810T030003Z.fail.html.gz
shows there is a "to be deleted" TP.

This patch uses only :line event and add some lines to allow MRI
deletes "to be deleted" TPs.
---
 test/ruby/test_settracefunc.rb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index dafe58d..1393caa 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -982,20 +982,24 @@ class TestSetTraceFunc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L982
 
   def test_tracepoint_with_multithreads
     assert_nothing_raised do
-      TracePoint.new{
+      TracePoint.new(:line){
         10.times{
           Thread.pass
         }
       }.enable do
         (1..10).map{
           Thread.new{
-            1000.times{
+            1_000.times{|i|
+              _a = i
             }
           }
         }.each{|th|
           th.join
         }
       end
+      _a = 1
+      _b = 2
+      _c = 3 # to make sure the deletion of unused TracePoints
     end
   end
 
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]