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 1D9D3C5B446; Thu, 15 Aug 2024 16:56:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1D9D3C5B446 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1723730201; bh=PiAV7VaikgJatE/uq/btR+7P6FPQzixDHfUQTF2Sd+Y=; 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=MIh49BLk8062YEAFFeyq6jLL1ugwPsNLK3r6Tmh7KH/400PL6+3iIMUlJG6n+6gDV TTg/a/6w0hIQZ9KRqmdXRXZBGCUw44/am68s/lx/Rzgp/RpFjKPMhlQ4+n+kH0F1tP FuO5CwI4zjDFOpo1WWCev/LsyiskxaAMggOeY+k8= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [95.163.41.93]) (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 9AB95C5B44D for ; Thu, 15 Aug 2024 16:56:39 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9AB95C5B44D Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1seaxy-000000074Cr-1hDT; Thu, 15 Aug 2024 16:56:38 +0300 Content-Type: multipart/alternative; boundary="------------GcsqyEE41MQGFEfOmolptm9K" Message-ID: <729f0cd0-c7c4-4ed4-9ff3-a5572fbc0ef0@tarantool.org> Date: Thu, 15 Aug 2024 16:56:37 +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: 4F1203BC0FB41BD9F97E3C14763C38E21D034174EA8ECC476D3C65BCD9935719182A05F538085040EBBDB676E1E38E6491417EB218679B829401E46E7D61FFB43BA737C44E88F16737AD88C62730AFDD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7364F8074C6DFACE2C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7C6A43EB42C8B28B9EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38B043BF0FB74779F367D9BC9305C3541D1D053FFFCC9013A84E9CDE79C27BCB7D3A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658378DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23DF004C90652538430302FCEF25BFAB3454AD6D5ED66289B5278DA827A17800CE7D36F53DD076E3CB7D32BA5DBAC0009BE395957E7521B51C2330BD67F2E7D9AF1090A508E0FED6299176DF2183F8FC7C0E3E3FB6EC827F0A0CD04E86FAF290E2DB606B96278B59C421DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6B67FC62909E22F84089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A50D9EA2C89BFFEE845002B1117B3ED69607631BE96E108006484B8D70797403F6823CB91A9FED034534781492E4B8EEAD05E80F4396618BB2BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFCCC4750BA04EE384C394C79C4A1F470B8D1983CB6FE9E761911474DE185201CF248F49047001ACAA470327EB0AC8E6934F945B609924278A3FCC15220884EBDFCF5FBBB18DB0F20D5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojD5rM0r3KxnHIZpP53HreSA== X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D614095A9875AED882A9D167EFE77B6BE4F58392AA0E10173325F0152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 14/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. --------------GcsqyEE41MQGFEfOmolptm9K Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey thanks for the patch! LGTM 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 the subtest. > > The test is adjusted to be runable in the test suite by adding the > `jit.flush()` to avoid collisions of traces. > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/misc/hook_norecord.lua | 12 ------------ > test/LuaJIT-tests/trace/hook_norecord.lua | 12 ++++++++++++ > test/LuaJIT-tests/trace/index | 1 + > 3 files changed, 13 insertions(+), 12 deletions(-) > delete mode 100644 test/LuaJIT-tests/misc/hook_norecord.lua > create mode 100644 test/LuaJIT-tests/trace/hook_norecord.lua > > diff --git a/test/LuaJIT-tests/misc/hook_norecord.lua b/test/LuaJIT-tests/misc/hook_norecord.lua > deleted file mode 100644 > index 8e7cba05..00000000 > --- a/test/LuaJIT-tests/misc/hook_norecord.lua > +++ /dev/null > @@ -1,12 +0,0 @@ > - > -if not jit or not jit.status or not jit.status() then return end > - > -local called = false > -local function f() local x = "wrong"; called = true end > -jit.off(f) > -debug.sethook(f, "", 5) > -for i=1,1000 do local a,b,c,d,e,f=1,2,3,4,5,6 end > -assert(called) > --- Check that no trace was generated. > -assert(require("jit.util").traceinfo(1) == nil) > - > diff --git a/test/LuaJIT-tests/trace/hook_norecord.lua b/test/LuaJIT-tests/trace/hook_norecord.lua > new file mode 100644 > index 00000000..4c39bade > --- /dev/null > +++ b/test/LuaJIT-tests/trace/hook_norecord.lua > @@ -0,0 +1,12 @@ > +do --- Abort trace recording on any hook call. > + local called = false > + local function f() local x = "wrong"; called = true end > + jit.off(f) > + jit.flush() > + debug.sethook(f, "", 5) > + for _ = 1, 1000 do local a, b, c, d, e, f = 1, 2, 3, 4, 5, 6 end > + assert(called) > + -- Check that no trace was generated. > + assert(require("jit.util").traceinfo(1) == nil) > + debug.sethook() > +end > diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index > index 46c8f5d2..595a71d2 100644 > --- a/test/LuaJIT-tests/trace/index > +++ b/test/LuaJIT-tests/trace/index > @@ -3,6 +3,7 @@ exit_growstack.lua > exit_jfuncf.lua > gc.lua > gc64_slot_revival.lua > +hook_norecord.lua > phi > snap.lua > stitch.lua --------------GcsqyEE41MQGFEfOmolptm9K Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey

thanks for the patch! LGTM


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 the subtest.

The test is adjusted to be runable in the test suite by adding the
`jit.flush()` to avoid collisions of traces.

Part of tarantool/tarantool#9398
---
 test/LuaJIT-tests/misc/hook_norecord.lua  | 12 ------------
 test/LuaJIT-tests/trace/hook_norecord.lua | 12 ++++++++++++
 test/LuaJIT-tests/trace/index             |  1 +
 3 files changed, 13 insertions(+), 12 deletions(-)
 delete mode 100644 test/LuaJIT-tests/misc/hook_norecord.lua
 create mode 100644 test/LuaJIT-tests/trace/hook_norecord.lua

diff --git a/test/LuaJIT-tests/misc/hook_norecord.lua b/test/LuaJIT-tests/misc/hook_norecord.lua
deleted file mode 100644
index 8e7cba05..00000000
--- a/test/LuaJIT-tests/misc/hook_norecord.lua
+++ /dev/null
@@ -1,12 +0,0 @@
-
-if not jit or not jit.status or not jit.status() then return end
-
-local called = false
-local function f() local x = "wrong"; called = true end
-jit.off(f)
-debug.sethook(f, "", 5)
-for i=1,1000 do local a,b,c,d,e,f=1,2,3,4,5,6 end
-assert(called)
--- Check that no trace was generated.
-assert(require("jit.util").traceinfo(1) == nil)
-
diff --git a/test/LuaJIT-tests/trace/hook_norecord.lua b/test/LuaJIT-tests/trace/hook_norecord.lua
new file mode 100644
index 00000000..4c39bade
--- /dev/null
+++ b/test/LuaJIT-tests/trace/hook_norecord.lua
@@ -0,0 +1,12 @@
+do --- Abort trace recording on any hook call.
+  local called = false
+  local function f() local x = "wrong"; called = true end
+  jit.off(f)
+  jit.flush()
+  debug.sethook(f, "", 5)
+  for _ = 1, 1000 do local a, b, c, d, e, f = 1, 2, 3, 4, 5, 6 end
+  assert(called)
+  -- Check that no trace was generated.
+  assert(require("jit.util").traceinfo(1) == nil)
+  debug.sethook()
+end
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 46c8f5d2..595a71d2 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -3,6 +3,7 @@ exit_growstack.lua
 exit_jfuncf.lua
 gc.lua
 gc64_slot_revival.lua
+hook_norecord.lua
 phi
 snap.lua
 stitch.lua
--------------GcsqyEE41MQGFEfOmolptm9K--