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 A5392C5969B; Fri, 23 Aug 2024 18:30:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A5392C5969B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1724427005; bh=UOq6qTk8NBjCqnJ8COSkJkyzmJPxBdrsAhqTupbxdGc=; 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=Ujoxke1WCxv1pI/ThGwrWw6mN5Gc8BDhyMivGnYwW4vqq6McKoZg2otklAcql5ec2 Q+wUIltyryA6QWTG++jVmvhdU278SUzIxFPeMblRgZ7yybVckoRPYQEBSH736+TAXn o2+k82Fhe8HslnvBk1/aOVYljNXQs1obpwwi8L3o= Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [95.163.41.94]) (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 11378C5968D for ; Fri, 23 Aug 2024 18:30:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 11378C5968D Received: by smtp56.i.mail.ru with esmtpa (envelope-from ) id 1shWEk-00000002QgZ-1gRi; Fri, 23 Aug 2024 18:30:03 +0300 Content-Type: multipart/alternative; boundary="------------VdKxfygYg2X4Knl1Vg2v05qr" Message-ID: Date: Fri, 23 Aug 2024 18:30:02 +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: <3ed1e158692a9773e3122cfdb134107cd0415354.1724228998.git.skaplun@tarantool.org> In-Reply-To: <3ed1e158692a9773e3122cfdb134107cd0415354.1724228998.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9A67092BE052B1D9E31015FC5902C0B2438B46547866FC5B0182A05F5380850405F5B182ECD5C0021F378A8CA21F699D635778DEF1EC8213B02F1026AD89F940D471E6F0AD5863D70 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE757AEC41D7AA04458EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CD693CC314794D958638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D80AC925B2A596BFE335B3D24904BCA06DCC6B65C153BE835ECC7F00164DA146DAFE8445B8C89999728AA50765F7900637F6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637F3E38EE449E3E2AE389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637E9607FC0835BE824D81D268191BDAD3DBD4B6F7A4D31EC0BE2F48590F00D11D6D81D268191BDAD3D78DA827A17800CE77DEE906CCC83F049EC76A7562686271ED91E3A1F190DE8FD2E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3CD42BCEBB57B85E635872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A5B2EEA56C59E213035002B1117B3ED69691D37EE056295F8DB2920F75BA9A967F823CB91A9FED034534781492E4B8EEAD2B25D9E4C92BC8ACBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF37FF08638AB69F2B7C4C835C956D9AE5F912C5BD9560184F068906F54DD2DA5D12B9ACBE231CC78A2FB0CAD32ADFBF849D7DB871D00BCBD9D6E5FBCB9CB7375A08EC58A1996D5B4A5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojPqZSx9J9Ex3t6uWGUhtRHA== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140FF1D34F576E76FFB39EC8856DD3BEBDADEE47B33A64EA67D0152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 21/45] 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. --------------VdKxfygYg2X4Knl1Vg2v05qr Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sergey, On 21.08.2024 11:58, Sergey Kaplun wrote: > This patch moves the aforementioned test from the to the > directory, includes it in , and names subtests. > > Part of tarantool/tarantool#9398 > --- thanks for the patch! LGTM with a minor comment > test/LuaJIT-tests/misc/jit_flush.lua | 50 -------------------- > test/LuaJIT-tests/trace/index | 1 + > test/LuaJIT-tests/trace/jit_flush.lua | 66 +++++++++++++++++++++++++++ > 3 files changed, 67 insertions(+), 50 deletions(-) > delete mode 100644 test/LuaJIT-tests/misc/jit_flush.lua > create mode 100644 test/LuaJIT-tests/trace/jit_flush.lua > > diff --git a/test/LuaJIT-tests/misc/jit_flush.lua b/test/LuaJIT-tests/misc/jit_flush.lua > deleted file mode 100644 > index ead1e4e9..00000000 > --- a/test/LuaJIT-tests/misc/jit_flush.lua > +++ /dev/null > @@ -1,50 +0,0 @@ > - > -if not jit or not jit.status or not jit.status() then return end > - > -for i=1,100 do > - if i==50 then jit.flush(2) end > - for j=1,100 do end > - for j=1,100 do end > -end > - > -jit.flush() > - > -local function f() for i=1,100 do end end > -for i=1,100 do local x = gcinfo(); f() end > - > -jit.flush() > - > -local function fib(n) > - if n < 2 then return 1 end > - return fib(n-2) + fib(n-1) > -end > - > -fib(11) > - > -jit.flush() > - > -local names = {} > -for i=1,100 do names[i] = i end > - > -function f() > - for k,v in ipairs(names) do end > -end > - > -f() > - > -for i=1,2 do > - f() > - f() > - jit.flush() > -end > - > -jit.flush() > - > -jit.flush(1) -- ignored > -jit.flush(2) -- ignored > -for i=1,1e7 do end -- causes trace #1 > - > -jit.flush(2) -- ignored > -jit.flush(1) -- ok > -jit.flush(1) -- crashes > - > diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index > index 63af7870..3ab095a7 100644 > --- a/test/LuaJIT-tests/trace/index > +++ b/test/LuaJIT-tests/trace/index > @@ -5,6 +5,7 @@ gc.lua > gc64_slot_revival.lua > hook_norecord.lua > hook_record.lua > +jit_flush.lua > phi > snap.lua > stitch.lua > diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua > new file mode 100644 > index 00000000..a995921e > --- /dev/null > +++ b/test/LuaJIT-tests/trace/jit_flush.lua > @@ -0,0 +1,66 @@ > +do --- Flushing a trace that is a link for another trace. > + -- TRACE 3 stop -> 2 > + jit.flush() > + for i = 1, 100 do > + if i == 50 then jit.flush(2) end > + for _ = 1, 100 do end > + for _ = 1, 100 do end > + end > + > + jit.flush() > +end > + > +do --- Flushing stitched trace. > + jit.flush() > + local function f() for _ = 1, 100 do end end > + for _ = 1, 100 do local x = gcinfo(); f() end > + > + jit.flush() > +end > + > +do --- Flushing trace with up-recursion. > + jit.flush() > + > + local function fib(n) > + if n < 2 then return 1 end > + return fib(n - 2) + fib(n - 1) > + end > + > + fib(11) > + > + jit.flush() > +end > + > +do --- Flush in the loop. > + jit.flush() > + > + local names = {} > + for i = 1, 100 do names[i] = i end > + > + local function f() > + for k, v in ipairs(names) do end > + end > + > + f() > + > + for _ = 1, 2 do > + f() > + f() > + jit.flush() > + end > + > + jit.flush() > +end > + > + please remove excess newline > +do --- Flushes of not existed traces. > + jit.flush() > + > + jit.flush(1) -- ignored > + jit.flush(2) -- ignored > + for _ = 1, 1e7 do end -- causes trace #1 > + > + jit.flush(2) -- ignored > + jit.flush(1) -- ok > + jit.flush(1) -- crashes > +end --------------VdKxfygYg2X4Knl1Vg2v05qr Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Sergey,


On 21.08.2024 11:58, Sergey Kaplun wrote:
This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names subtests.

Part of tarantool/tarantool#9398
---
thanks for the patch! LGTM with a minor comment
 test/LuaJIT-tests/misc/jit_flush.lua  | 50 --------------------
 test/LuaJIT-tests/trace/index         |  1 +
 test/LuaJIT-tests/trace/jit_flush.lua | 66 +++++++++++++++++++++++++++
 3 files changed, 67 insertions(+), 50 deletions(-)
 delete mode 100644 test/LuaJIT-tests/misc/jit_flush.lua
 create mode 100644 test/LuaJIT-tests/trace/jit_flush.lua

diff --git a/test/LuaJIT-tests/misc/jit_flush.lua b/test/LuaJIT-tests/misc/jit_flush.lua
deleted file mode 100644
index ead1e4e9..00000000
--- a/test/LuaJIT-tests/misc/jit_flush.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-
-if not jit or not jit.status or not jit.status() then return end
-
-for i=1,100 do
-  if i==50 then jit.flush(2) end
-  for j=1,100 do end
-  for j=1,100 do end
-end
-
-jit.flush()
-
-local function f() for i=1,100 do end end
-for i=1,100 do local x = gcinfo(); f() end
-
-jit.flush()
-
-local function fib(n)
-  if n < 2 then return 1 end
-  return fib(n-2) + fib(n-1)
-end
-
-fib(11)
-
-jit.flush()
-
-local names = {}
-for i=1,100 do names[i] = i end
-
-function f()
-  for k,v in ipairs(names) do end
-end
-
-f()
-
-for i=1,2 do
-  f()
-  f()
-  jit.flush()
-end
-
-jit.flush()
-
-jit.flush(1) -- ignored
-jit.flush(2) -- ignored
-for i=1,1e7 do end -- causes trace #1
-
-jit.flush(2) -- ignored
-jit.flush(1) -- ok
-jit.flush(1) -- crashes
-
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 63af7870..3ab095a7 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -5,6 +5,7 @@ gc.lua
 gc64_slot_revival.lua
 hook_norecord.lua
 hook_record.lua
+jit_flush.lua
 phi
 snap.lua
 stitch.lua
diff --git a/test/LuaJIT-tests/trace/jit_flush.lua b/test/LuaJIT-tests/trace/jit_flush.lua
new file mode 100644
index 00000000..a995921e
--- /dev/null
+++ b/test/LuaJIT-tests/trace/jit_flush.lua
@@ -0,0 +1,66 @@
+do --- Flushing a trace that is a link for another trace.
+  -- TRACE 3 stop -> 2
+  jit.flush()
+  for i = 1, 100 do
+    if i == 50 then jit.flush(2) end
+    for _ = 1, 100 do end
+    for _ = 1, 100 do end
+  end
+
+  jit.flush()
+end
+
+do --- Flushing stitched trace.
+  jit.flush()
+  local function f() for _ = 1, 100 do end end
+  for _ = 1, 100 do local x = gcinfo(); f() end
+
+  jit.flush()
+end
+
+do --- Flushing trace with up-recursion.
+  jit.flush()
+
+  local function fib(n)
+    if n < 2 then return 1 end
+    return fib(n - 2) + fib(n - 1)
+  end
+
+  fib(11)
+
+  jit.flush()
+end
+
+do --- Flush in the loop.
+  jit.flush()
+
+  local names = {}
+  for i = 1, 100 do names[i] = i end
+
+  local function f()
+    for k, v in ipairs(names) do end
+  end
+
+  f()
+
+  for _ = 1, 2 do
+    f()
+    f()
+    jit.flush()
+  end
+
+  jit.flush()
+end
+
+
please remove excess newline
+do --- Flushes of not existed traces.
+  jit.flush()
+
+  jit.flush(1) -- ignored
+  jit.flush(2) -- ignored
+  for _ = 1, 1e7 do end -- causes trace #1
+
+  jit.flush(2) -- ignored
+  jit.flush(1) -- ok
+  jit.flush(1) -- crashes
+end
--------------VdKxfygYg2X4Knl1Vg2v05qr--