<!DOCTYPE html>
<html data-lt-installed="true">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body style="padding-bottom: 1px;">
    <p>Hi, Sergey!</p>
    <p>Thanks for the patch!<br>
    </p>
    <div class="moz-cite-prefix">On 14.08.2024 16:55, Sergey Kaplun
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:2b6a33d6518c6e441051469a800103a4111bfb75.1723638851.git.skaplun@tarantool.org">
      <pre class="moz-quote-pre" wrap="">This patch moves the aforementioned test from the <misc> to the <trace/>
directory, includes it in <index>, and names the subtest.</pre>
    </blockquote>
    +formatting changes<br>
    <blockquote type="cite"
cite="mid:2b6a33d6518c6e441051469a800103a4111bfb75.1723638851.git.skaplun@tarantool.org">
      <pre class="moz-quote-pre" wrap="">

The test is adjusted to be runable in the test suite by adding the
`jit.flush()` to avoid collisions of traces. Also, the number of
iterations for the compiled loop inside the hook is increased to avoid
hotcount collisions.

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

diff --git a/test/LuaJIT-tests/misc/hook_record.lua b/test/LuaJIT-tests/misc/hook_record.lua
deleted file mode 100644
index 6f1646de..00000000
--- a/test/LuaJIT-tests/misc/hook_record.lua
+++ /dev/null
@@ -1,8 +0,0 @@
-
-if not jit or not jit.status or not jit.status() then return end
-
-debug.sethook(function() for i=1,100 do end end, "", 10)
-for i=1,10 do end
-debug.sethook()
-assert((require("jit.util").traceinfo(1)))
-
diff --git a/test/LuaJIT-tests/trace/hook_record.lua b/test/LuaJIT-tests/trace/hook_record.lua
new file mode 100644
index 00000000..684e1139
--- /dev/null
+++ b/test/LuaJIT-tests/trace/hook_record.lua
@@ -0,0 +1,7 @@
+do --- Recording traces inside the hook.
+  jit.flush()
+  debug.sethook(function() for _ = 1, 1000 do end end, "", 10)
+  for _ = 1, 10 do end
+  debug.sethook()
+  assert((require("jit.util").traceinfo(1)))
+end
diff --git a/test/LuaJIT-tests/trace/index b/test/LuaJIT-tests/trace/index
index 595a71d2..63af7870 100644
--- a/test/LuaJIT-tests/trace/index
+++ b/test/LuaJIT-tests/trace/index
@@ -4,6 +4,7 @@ exit_jfuncf.lua
 gc.lua
 gc64_slot_revival.lua
 hook_norecord.lua
+hook_record.lua
 phi
 snap.lua
 stitch.lua
</pre>
    </blockquote>
  </body>
  <lt-container></lt-container>
</html>