From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 145DEC6C747; Thu, 15 Aug 2024 16:24:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 145DEC6C747 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1723728284; bh=B2IdNZagZ4qvgNG0IOUFC7rlvSRX9ibS0oRO2EMVi+c=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=MNpZGmQmNXrdQRGxLiyk/c0BcB+Wgi8Y2UUA1ibCSryCO8pkIXj7bwPPVOly7T7Bq dXviWcgG3ACA9aMRmLwsitw3RBOP/5Z7EPbMaUbWyuMmMAXuLzGHyjRPcbj3qWd0Bf lP+fDh4UBEU0PEA5REN77+Jk4P0ke5imS2P10FsE= Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [95.163.41.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 9B8CDC6C74A for ; Thu, 15 Aug 2024 16:24:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9B8CDC6C74A Received: by smtp31.i.mail.ru with esmtpa (envelope-from ) id 1seaT3-000000006sq-3Crv; Thu, 15 Aug 2024 16:24:42 +0300 Content-Type: multipart/alternative; boundary="------------TwIB0S0jeyAhLmblPnnS7gOa" Message-ID: <7f8344b0-3cc5-4ab2-8432-ff8fe7992d90@tarantool.org> Date: Thu, 15 Aug 2024 16:24:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9F97E3C14763C38E21D034174EA8ECC476D3C65BCD9935719182A05F5380850408EF2354F82197DD93DE06ABAFEAF67052C7D3657113270657B0786321B2BD618DB2FAAB0A8254537 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7798B95EC47D21699EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E565730CA785C4918638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84221606F7063A9C402382632AD74B26617A3DD9636F1A712CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F3E38EE449E3E2AE389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637121C23106E7898E1D32BA5DBAC0009BE395957E7521B51C2330BD67F2E7D9AF1090A508E0FED6299176DF2183F8FC7C08FBB52F5C7ECD1BBB3661434B16C20ACC84D3B47A649675FE827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B47E915A23788DB9575ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A500434D7031AFB7E75002B1117B3ED696A3BC44F4EFD2B036CA7E60A991436CA2823CB91A9FED034534781492E4B8EEADA2D5570B22232E1EBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF833A8F8783258ED834CECEC4B6CADA1859467A43697FBA30083A04675136BA416F890FCD3CEE011B470327EB0AC8E693A4D0321EBD0EA9CEBD29CE6875C43F5AF966E643EBCA077F5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojD5rM0r3KxnFATKSequoLaw== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D614021EDCD7AD505BD592EB5D77EF37489D179900FF4C32AA7AD0152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 10/36] test: enable LuaJIT test X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------TwIB0S0jeyAhLmblPnnS7gOa Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey thanks for the patch! On 14.08.2024 16:55, Sergey Kaplun wrote: > This patch moves the aforementioned test from the to the > directory, includes it in , and names subtests. Please describe a reason. > > The first test is adjusted to be runable in the test suite. > > Part of tarantool/tarantool#9398 > --- > .../{misc/gc_trace.lua => trace/gc.lua} | 27 +++++++++---------- > test/LuaJIT-tests/trace/index | 1 + > 2 files changed, 14 insertions(+), 14 deletions(-) > rename test/LuaJIT-tests/{misc/gc_trace.lua => trace/gc.lua} (60%) > > diff --git a/test/LuaJIT-tests/misc/gc_trace.lua b/test/LuaJIT-tests/trace/gc.lua > similarity index 60% > rename from test/LuaJIT-tests/misc/gc_trace.lua > rename to test/LuaJIT-tests/trace/gc.lua > index bc38ce0c..4d984ed6 100644 > --- a/test/LuaJIT-tests/misc/gc_trace.lua > +++ b/test/LuaJIT-tests/trace/gc.lua > @@ -1,18 +1,18 @@ > +local jutil = require("jit.util") > > -if not jit or not jit.status or not jit.status() then return end > - > -collectgarbage() > -for j=1,100 do > - loadstring("for i=1,100 do end")() > +do --- Collect dead traces. > + jit.flush() > + collectgarbage() > + for _ = 1, 100 do > + loadstring("for _ = 1, 100 do end")() > + end > + collectgarbage() > + assert(jutil.traceinfo(1) == nil) > + assert(jutil.traceinfo(2) == nil) > + assert(jutil.traceinfo(3) == nil) > end > -local jutil = require("jit.util") > -assert(jutil.traceinfo(90) == nil) > -collectgarbage() > -assert(jutil.traceinfo(1) == nil) > -assert(jutil.traceinfo(2) == nil) > -assert(jutil.traceinfo(3) == nil) > > -do > +do --- Check KGC marking. > local f > local function reccb(tr) > if f == nil then > @@ -24,7 +24,7 @@ do > end > end > jit.attach(reccb, "record") > - for i=1,200 do > + for i = 1, 200 do > if i % 5 == 0 then > f = function() end > elseif f then > @@ -34,4 +34,3 @@ do > end > jit.attach(reccb) > end > - > diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index > index ea7a22e0..46c8f5d2 100644 > --- a/test/LuaJIT-tests/trace/index > +++ b/test/LuaJIT-tests/trace/index > @@ -1,6 +1,7 @@ > exit_frame.lua > exit_growstack.lua > exit_jfuncf.lua > +gc.lua > gc64_slot_revival.lua > phi > snap.lua --------------TwIB0S0jeyAhLmblPnnS7gOa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey

thanks for the patch!

On 14.08.2024 16:55, Sergey Kaplun wrote:
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names subtests.
Please describe a reason.

The first test is adjusted to be runable in the test suite.

Part of tarantool/tarantool#9398
---
 .../{misc/gc_trace.lua => trace/gc.lua}       | 27 +++++++++----------
 test/LuaJIT-tests/trace/index                 |  1 +
 2 files changed, 14 insertions(+), 14 deletions(-)
 rename test/LuaJIT-tests/{misc/gc_trace.lua => trace/gc.lua} (60%)

diff --git a/test/LuaJIT-tests/misc/gc_trace.lua b/test/LuaJIT-tests/trace/gc.lua
similarity index 60%
rename from test/LuaJIT-tests/misc/gc_trace.lua
rename to test/LuaJIT-tests/trace/gc.lua
index bc38ce0c..4d984ed6 100644
--- a/test/LuaJIT-tests/misc/gc_trace.lua
+++ b/test/LuaJIT-tests/trace/gc.lua
@@ -1,18 +1,18 @@
+local jutil = require("jit.util")
 
-if not jit or not jit.status or not jit.status() then return end
-
-collectgarbage()
-for j=1,100 do
-  loadstring("for i=1,100 do end")()
+do --- Collect dead traces.
+  jit.flush()
+  collectgarbage()
+  for _ = 1, 100 do
+    loadstring("for _ = 1, 100 do end")()
+  end
+  collectgarbage()
+  assert(jutil.traceinfo(1) == nil)
+  assert(jutil.traceinfo(2) == nil)
+  assert(jutil.traceinfo(3) == nil)
 end
-local jutil = require("jit.util")
-assert(jutil.traceinfo(90) == nil)
-collectgarbage()
-assert(jutil.traceinfo(1) == nil)
-assert(jutil.traceinfo(2) == nil)
-assert(jutil.traceinfo(3) == nil)
 
-do
+do --- Check KGC marking.
   local f
   local function reccb(tr)
     if f == nil then
@@ -24,7 +24,7 @@ do
     end
   end
   jit.attach(reccb, "record")
-  for i=1,200 do
+  for i = 1, 200 do
     if i % 5 == 0 then
       f = function() end
     elseif f then
@@ -34,4 +34,3 @@ do
   end
   jit.attach(reccb)
 end
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index ea7a22e0..46c8f5d2 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -1,6 +1,7 @@
 exit_frame.lua
 exit_growstack.lua
 exit_jfuncf.lua
+gc.lua
 gc64_slot_revival.lua
 phi
 snap.lua
--------------TwIB0S0jeyAhLmblPnnS7gOa--