Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit] Actually implement maxirconst trace limit.
Date: Sat, 29 Jan 2022 04:17:44 +0300	[thread overview]
Message-ID: <YfSVuM4KWdk9J1Od@root> (raw)
In-Reply-To: <YfRj6YwyEnFlgIu/@tarantool.org>

Igor,

On 29.01.22, Igor Munkin wrote:
> Sergey,
> 
> Bad things happen... I was much concerned about using <misc> module in
> the test, but I failed to understand why exactly. Now I finally got it
> (the hard way): <misc> is missing in 1.10 which is one of the target
> branches for this patch. Could you please adjust the test using
> <jit.util.traceinfo> helper or via any other way to check that only the
> first trace is compiled?

Fixed, see the iterative patch below:
Branch is force-pushed.

===================================================================
diff --git a/test/tarantool-tests/lj-430-maxirconst.test.lua b/test/tarantool-tests/lj-430-maxirconst.test.lua
index 10de2520..45f0bb1d 100644
--- a/test/tarantool-tests/lj-430-maxirconst.test.lua
+++ b/test/tarantool-tests/lj-430-maxirconst.test.lua
@@ -7,6 +7,7 @@ jit.flush()
 require('utils').skipcond(jit.os == 'BSD', 'Disabled due to #4819')
 
 local tap = require('tap')
+local traceinfo = require('jit.util').traceinfo
 
 local test = tap.test('lj-430-maxirconst')
 test:plan(2)
@@ -24,20 +25,17 @@ local function irconst4()
   local _ = 42
 end
 
-local ntrace_old = misc.getmetrics().jit_trace_num
+assert(not traceinfo(1), 'no any traces')
 jit.on()
 irconst3()
 irconst3()
 jit.off()
-test:ok(ntrace_old + 1 == misc.getmetrics().jit_trace_num,
-        'trace number increases')
+test:ok(traceinfo(1), 'new trace created')
 
-ntrace_old = misc.getmetrics().jit_trace_num
 jit.on()
 irconst4()
 irconst4()
 jit.off()
-test:ok(ntrace_old == misc.getmetrics().jit_trace_num,
-        'trace should not appear due to maxirconst limit')
+test:ok(not traceinfo(2), 'trace should not appear due to maxirconst limit')
 
 os.exit(test:check() and 0 or 1)
===================================================================

> 
> P.S. many thanks to luacheck:
> | $ make -j test
> | Consolidate compiler generated dependencies of target minilua
> | Consolidate compiler generated dependencies of target libmixcframe
> | Consolidate compiler generated dependencies of target libsandwich
> | Consolidate compiler generated dependencies of target lib1
> | Consolidate compiler generated dependencies of target lib2
> | Consolidate compiler generated dependencies of target lib21
> | Consolidate compiler generated dependencies of target lib11
> | Consolidate compiler generated dependencies of target libflush
> | [  3%] Built target libsandwich
> | [  3%] Built target libmixcframe
> | Running luacheck static analysis
> | [  8%] Built target lib1
> | [ 11%] Built target lib21
> | [  6%] Built target minilua
> | [  6%] Built target lib2
> | [ 13%] Built target lib11
> | [ 15%] Built target libflush
> | [ 16%] Generating buildvm_arch.h
> | Create directory for PUC-Rio Lua 5.1 tests
> | [ 16%] Built target PUC-Rio-Lua-5.1-tests-prepare
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/luajit-test-init.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/gh-3196-incorrect-string-length.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/gh-4427-ffi-sandwich.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/gh-4476-fix-string-find-recording.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/gh-4773-tonumber-fail-on-NUL-char.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/gh-6227-bytecode-allocator-for-comparisons.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/gh-6371-string-char-no-arg.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-375-ir-bufput-signed-char.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-430-maxirconst.test.lua 4 warnings
> | 
> |     /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-430-maxirconst.test.lua:27:20: (W113) accessing undefined variable misc
> |     /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-430-maxirconst.test.lua:32:27: (W113) accessing undefined variable misc
> |     /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-430-maxirconst.test.lua:35:14: (W113) accessing undefined variable misc
> |     /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-430-maxirconst.test.lua:40:23: (W113) accessing undefined variable misc
> | 
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-494-table-chain-infinite-loop.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-505-fold-no-strref-for-ptrdiff.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-524-fold-conv-respect-src-irt.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-584-bad-renames-for-sunk-values.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-601-fix-gc-finderrfunc.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/lj-flush-on-trace.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/or-232-unsink-64-kptr.test.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/tap.lua OK
> | Checking /home/imun/projects/tarantool-luajit-maintain/test/tarantool-tests/utils.lua OK
> | 
> | Total: 4 warnings / 0 errors in 18 files
> | make[3]: *** [test/CMakeFiles/LuaJIT-luacheck.dir/build.make:331: LuaJIT-luacheck] Error 1
> | make[2]: *** [CMakeFiles/Makefile2:731: test/CMakeFiles/LuaJIT-luacheck.dir/all] Error 2
> | make[2]: *** Waiting for unfinished jobs....
> | [ 20%] Building C object src/host/CMakeFiles/buildvm.dir/buildvm_fold.c.o
> | [ 20%] Building C object src/host/CMakeFiles/buildvm.dir/buildvm_lib.c.o
> | [ 20%] Building C object src/host/CMakeFiles/buildvm.dir/buildvm_asm.c.o
> | [ 20%] Building C object src/host/CMakeFiles/buildvm.dir/buildvm.c.o
> | [ 22%] Building C object src/host/CMakeFiles/buildvm.dir/buildvm_peobj.c.o
> | [ 22%] Linking C executable buildvm
> | [ 22%] Built target buildvm
> | make[1]: *** [CMakeFiles/Makefile2:683: test/CMakeFiles/test.dir/rule] Error 2
> | make: *** [Makefile:351: test] Error 2
> 
> -- 
> Best regards,
> IM

-- 
Best regards,
Sergey Kaplun

  reply	other threads:[~2022-01-29  1:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-29 12:27 Sergey Kaplun via Tarantool-patches
2022-01-27 23:18 ` Igor Munkin via Tarantool-patches
2022-01-28  8:42   ` Sergey Kaplun via Tarantool-patches
2022-01-28 11:55     ` Igor Munkin via Tarantool-patches
2022-01-28 12:35       ` Sergey Kaplun via Tarantool-patches
2022-01-28 14:16         ` sergos via Tarantool-patches
2022-01-28 15:09           ` Sergey Kaplun via Tarantool-patches
2022-01-28 21:28             ` Sergey Ostanevich via Tarantool-patches
2022-01-28 21:45 ` Igor Munkin via Tarantool-patches
2022-01-29  1:17   ` Sergey Kaplun via Tarantool-patches [this message]
2022-02-11 19:09 ` Igor Munkin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YfSVuM4KWdk9J1Od@root \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit] Actually implement maxirconst trace limit.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox