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 EF159B03484; Sun, 5 May 2024 15:55:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EF159B03484 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1714913717; bh=xx0sWmHLkE/bC7qMAA6XCJswZyhkaSuo8cTHKqFvsBw=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=BQqn0WjCy5UOZKxtD44HTchzYZNFhNmwbPWHhdey28mdhF6zxz3irUWegF9GhOrdJ SIYFK0BkQUnaPkvhS7dZya5irPqfH8grq+6th84pmlJDAwq3X7muqF61Q/1jsDcKUb 07mTVo647nuZOX+mDGGov2/WX4Rdjs/vCWOkrF9g= Received: from smtp3.i.mail.ru (smtp3.i.mail.ru [95.163.41.67]) (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 DAA0BB03481 for ; Sun, 5 May 2024 15:55:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DAA0BB03481 Received: by smtp3.i.mail.ru with esmtpa (envelope-from ) id 1s3bOc-00000005Kat-3thp; Sun, 05 May 2024 15:55:15 +0300 Date: Sun, 5 May 2024 15:55:14 +0300 To: Sergey Kaplun Message-ID: <27ej4kuqyymxku5bezfm4e3ooj22iy7vxjng5mq6odg2m44ct6@ntzy3uf677hk> References: <7c0a7be30070d085d6ddd3b56c4338686e1c2baa.1713773432.git.skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c0a7be30070d085d6ddd3b56c4338686e1c2baa.1713773432.git.skaplun@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9C1015E4FDF537780DFDCE44B03D90A4295A4593ED33AC928182A05F538085040D9889C0DB8D07F96D27678DDAA806314B342EB3BB500BE78D6105DA6E1097774F92BFEA5F0ACBE40 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7196003627DEC9496EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063745B6F93C788775E78638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84A6B429BED672024A12EB2351304A2D12861B1561B884275CC7F00164DA146DAFE8445B8C89999728AA50765F790063793270F7220657A0A389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8989FD0BDF65E50FBF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CDA7BFA4571439BB2C0837EA9F3D197644AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3E43D663FACA9F152BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7AEA1580DED4E70E3731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5108471BCD1148A8C5002B1117B3ED69691788864FBB28AB68D59E407A97E9958823CB91A9FED034534781492E4B8EEADA91A6E18C88C5E2F X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF46C8B1AEE2FF9A2E36931E57720B45D2B5A6D007E04ED6D1E370299713C425C066971B16C155F0C9643425263F8C9A4EEDB656B045C913C57AB729A31A10FDAB010F47A3E55044D45F4332CA8FE04980913E6812662D5F2A54F6898A6FDCBDC72A617DFBE5FEC2C6383653B6C8D9AE0FD16FCAA6493B703A X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj3Gch4W13RDFsAxoNUaGMsA== X-Mailru-Sender: 00097D31F91C944BAED0411CFB052B98BD6B7ACE78A0F4AFB951B70A5BD4BD8EDBA47693611FB2A18D2B58C568460B7304C9FB44FCBCE9EE92D99EB8CC7091A7ECEABDC5717908DEF544888E8238EB4872D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v1 3/5] test: allow `jit.parse` to return aborted traces 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the patch! LGTM, except for a single nit below. On Mon, Apr 22, 2024 at 11:49:56AM UTC, Sergey Kaplun wrote: > Now information about the abort of the trace is saved in the > `abort_reason` field of the corresponding structure. The > `jit.parse.finish()` returns now the second table containing aborted > traces. Each table key is a trace number containing an array of > potentially traces with this number, which was aborted. > > Needed for tarantool/tarantool#9924 > --- > .../unit-jit-parse-abort.test.lua | 38 +++++++++++++++++++ > test/tarantool-tests/utils/jit/parse.lua | 22 ++++++++--- > 2 files changed, 55 insertions(+), 5 deletions(-) > create mode 100644 test/tarantool-tests/unit-jit-parse-abort.test.lua > > diff --git a/test/tarantool-tests/unit-jit-parse-abort.test.lua b/test/tarantool-tests/unit-jit-parse-abort.test.lua > new file mode 100644 > index 00000000..91af5a56 > --- /dev/null > +++ b/test/tarantool-tests/unit-jit-parse-abort.test.lua > > diff --git a/test/tarantool-tests/utils/jit/parse.lua b/test/tarantool-tests/utils/jit/parse.lua > index bcef5b35..0ce7f7c8 100644 > --- a/test/tarantool-tests/utils/jit/parse.lua > +++ b/test/tarantool-tests/utils/jit/parse.lua > @@ -22,6 +22,7 @@ local function trace_new(n) > parent = nil, > parent_exitno = nil, > is_stitched = false, > + abort_reason = nil, > start_loc = nil, > bc = {}, > ir = {}, > @@ -87,9 +88,17 @@ local header_handlers = { > ctx.parsing_trace = nil > ctx.parsing = nil > end, > - abort = function(ctx, trace_num) > + abort = function(ctx, trace_num, line) > local traces = ctx.traces > assert(ctx.parsing_trace == trace_num) > + > + local aborted_traces = ctx.aborted_traces > + if not aborted_traces[trace_num] then > + aborted_traces[trace_num] = {} > + end > + traces[trace_num].abort_reason = line:match('-- (.+)$') Please drop a comment explaining the regexp. > + table.insert(aborted_traces[trace_num], traces[trace_num]) > + > ctx.parsing_trace = nil > ctx.parsing = nil > traces[trace_num] = nil > @@ -137,11 +146,14 @@ end > local JDUMP_FILE > > local function parse_jit_dump() > - local ctx = {traces = {}} > + local ctx = { > + aborted_traces = {}, > + traces = {}, > + } > for line in io.lines(JDUMP_FILE) do > parse_line(ctx, line) > end > - return ctx.traces > + return ctx.traces, ctx.aborted_traces > end > > -- Start `jit.dump()` utility with the given flags, saving the > @@ -167,10 +179,10 @@ M.finish = function() > -- Enable traces compilation for `jit.dump` back. > jit.on(jdump.on, true) > jit.on(jdump.off, true) > - local traces = parse_jit_dump() > + local traces, aborted_traces = parse_jit_dump() > os.remove(JDUMP_FILE) > JDUMP_FILE = nil > - return traces > + return traces, aborted_traces > end > > -- Turn off compilation for the module to avoid side effects. > -- > 2.44.0 >