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 71B671CF646; Thu, 1 Dec 2022 23:43:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 71B671CF646 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1669927436; bh=4NkOggUghg4p/qMCYpCPTKTf6y7JqzxTF2/y3j9zSU4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Zp7G7rH1HjyW8mOHKXP/jja/+z7YBfXPrWaEYrThdgPDb7cJE4kDU+zspT0SUt+AV xzKO2dKyZku5yVEXGZChLKsibOnk13dVpQNuInutfkFyauSeBZVjw3VfQaHJO5Z7Vi RzkVK/iHa6EGrSw4MnS0KSixTr9q2gkRqdOP8wTo= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1F7AE1CF647 for ; Thu, 1 Dec 2022 23:42:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1F7AE1CF647 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1p0qOU-00058t-Cb; Thu, 01 Dec 2022 23:42:54 +0300 To: Sergey Kaplun , Maxim Kokryashkin Date: Thu, 1 Dec 2022 23:28:59 +0300 Message-Id: X-Mailer: git-send-email 2.34.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD908190A22B884CF141FBA3A6FBB18594359F79D12ABF91FD1182A05F538085040C045BEDB1EDF6319E759C5B31908CA7C9350200B1E8EB847634480B903D41B13 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7CD501AD3AF4FF0D5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AA32F0A5ADCF96E68638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8256E20C41A44217DB3F4B67ECE23E13E117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC974A882099E279BDA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352091ADC097FE2C3A08F04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B67393CE827C55B5F775ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A54B2FEF9EE64EBF8D69C26F58FD99A34857626AE99114B90E4EAF44D9B582CE87C8A4C02DF684249CC203C45FEA855C8F X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3480A9008907CB2FD0D4688149ECC3B4AEC183D6F789B9A1D83F7D64AE6C1646BD69DB1FCB4506BC0D1D7E09C32AA3244C6B88912DCD2A8AF4F8F4F6C86BD1A2B85A1673A01BA68E40927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojdH6LJGuFcapbnjUDoB2org== X-DA7885C5: 2933FA5BF27D8EAAF04B55BE425D9EB716CB404DE0D13A735F912361F054783C262E2D401490A4A0DB037EFA58388B346E8BC1A9835FDE71 X-Mailru-Sender: 689FA8AB762F73933AF1F914F131DBF51EEDB2B7E9FEE5DC4A6249C4AA1EB8B8A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 2/2] test: relax JIT setup in misc.getmetrics 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" To test whether metric is counted right for side exits JIT engine parameter is tighted to prevent side trace compilation (considering being used for the corresponding branch of execution, the side trace will try to compile with stitching). However, if test is run on the platform configured with the option LUAJIT_ENABLE_CHECKHOOK enabled, the resulting trace exceeds the hardcoded limit and the metric is miscounted due to this new trace. To resolve this issue limit is set to the maximum amount of IRRef in the trace, preventing trace compilation for any LuaJIT configuration. Relates to tarantool/tarantool#7762 Signed-off-by: Igor Munkin --- test/tarantool-tests/misclib-getmetrics-capi.test.lua | 7 +++++-- test/tarantool-tests/misclib-getmetrics-lapi.test.lua | 7 +++++-- test/tarantool-tests/utils.lua | 9 +++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/test/tarantool-tests/misclib-getmetrics-capi.test.lua b/test/tarantool-tests/misclib-getmetrics-capi.test.lua index 0cbc6cae..42a9adf9 100644 --- a/test/tarantool-tests/misclib-getmetrics-capi.test.lua +++ b/test/tarantool-tests/misclib-getmetrics-capi.test.lua @@ -1,5 +1,7 @@ +local utils = require('utils') + -- Disabled on *BSD due to #4819. -require('utils').skipcond(jit.os == 'BSD', 'Disabled due to #4819') +utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') local path = arg[0]:gsub('%.test%.lua', '') local suffix = package.cpath:match('?.(%a+);') @@ -94,7 +96,8 @@ end)) -- Compiled loop with a side exit which does not get compiled. test:ok(testgetmetrics.snap_restores(function() - jit.opt.start(0, "hotloop=1", "hotexit=2", "minstitch=15") + jit.opt.start(0, "hotloop=1", "hotexit=2", + ("minstitch=%d"):format(utils.const.maxnins)) local function foo(i) -- math.fmod is not yet compiled! diff --git a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua index 222e7d01..19dfd199 100644 --- a/test/tarantool-tests/misclib-getmetrics-lapi.test.lua +++ b/test/tarantool-tests/misclib-getmetrics-lapi.test.lua @@ -2,8 +2,10 @@ -- Major portions taken verbatim or adapted from the LuaVela testing suite. -- Copyright (C) 2015-2019 IPONWEB Ltd. +local utils = require('utils') + -- Disabled on *BSD due to #4819. -require('utils').skipcond(jit.os == 'BSD', 'Disabled due to #4819') +utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') local tap = require('tap') @@ -279,7 +281,8 @@ test:test("snap-restores-loop-side-exit-non-compiled", function(subtest) -- Compiled loop with a side exit which does not get compiled. subtest:plan(1) - jit.opt.start(0, "hotloop=1", "hotexit=2", "minstitch=15") + jit.opt.start(0, "hotloop=1", "hotexit=2", + ("minstitch=%d"):format(utils.const.maxnins)) local function foo(i) -- math.fmod is not yet compiled! diff --git a/test/tarantool-tests/utils.lua b/test/tarantool-tests/utils.lua index 87f7ff15..eb11d40d 100644 --- a/test/tarantool-tests/utils.lua +++ b/test/tarantool-tests/utils.lua @@ -135,4 +135,13 @@ function M.profilename(name) return (arg[0]:gsub('^(.+)/([^/]+)%.test%.lua$', replacepattern)) end +M.const = { + -- XXX: Max nins is limited by max IRRef, that equals to + -- REF_DROP - REF_BIAS. Unfortunately, these constants are not + -- provided to Lua space, so we ought to make some math: + -- * REF_DROP = 0xffff + -- * REF_BIAS = 0x8000 + maxnins = 0xffff - 0x8000, +} + return M -- 2.34.0