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 944176ECCE; Wed, 7 Oct 2026 19:27:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 944176ECCE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1791390472; bh=bP7+t1WA2OoWyN9xABQGSAqvrWOQnhqqCaEIE71wzaY=; 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=hHkP1/ICsDQBA7xs8SnNyf0ftyIaQDfIZnvmrbcPRf5Bmne/sY6MHI9X9nI7sQbF7 o4aR1nXvA9YrUTGZMBqDHJpoRO9EO2UmvHvOinc6vvJ6dNamAfbpHPjF0hfQlgpZCD g8za+pdyjT9mbRgFQoDWDpbLVJEjq6KnL1Fvct4o= Received: from send60.i.mail.ru (send60.i.mail.ru [89.221.237.155]) (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 5C4726ECCE for ; Wed, 7 Oct 2026 19:27:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5C4726ECCE Received: by exim-smtp-84d6fb566c-j9mqx with esmtpa (envelope-from ) id 1xEUUf-00000000H9K-1Itw; Wed, 07 Oct 2026 19:27:49 +0300 Message-ID: <5be43ac9-2e2b-4c33-aa84-f7ef500898a2@vk.team> Date: Wed, 7 Oct 2026 19:27:48 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Bronnikov , Sergey Kaplun , Evgeniy Temirgaleev Cc: tarantool-patches@dev.tarantool.org References: <20260924164821.188162-1-m.elhimov@vk.team> <20260924201412.194073-1-m.elhimov@vk.team> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-618D5548: 05DFC498AA386CB089CEA9C911D0999571888DA5A63C9A02F863BE75107A52E7DE1C8B7F88CEEA41 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD96B8C5372348BE4E332FDC157443EA7726004F5D307BD7A1D182A05F5380850404C228DA9ACA6FE2771C475F2250563CB3DE06ABAFEAF67056BE5D6D7473160E104F832934A048B107A43E2483F2A4E25 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73870E1FF9A049D91EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375667A7F1054949754028E6F6CE93946018DF0D8532A8DB485655EAA113DD5524F048EEF46B7454FC60B9742502CCDD46D0D21E93C0F2A571C7BBA3038C0950A5D36D5E8D9A59859A8B6F657401E1635F1D73AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE49385C08DA1A1AB276A5E97997F8902A7B9C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A58729B704E6D760D45002B1117B3ED696E102A75D3EA00BF730E4A65F242F58983610D81D389A125CDE35189EBF2DEA28FEA14CD2CD220BB99C5DF10A05D560A9880EC71AF561E0AAD9143641EC25BB3959A1632917A27442 X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34C77DD89D51EBB774225B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D65912772C0EF07FF199272A429E2E4050D47A975B6C4FD471E0E00785F5C7C6716CA96AB8F9911AB449B8341EE9D5BE9A0AFB20E7E795BA981246544B9C49D514EB1D91AAF161E36908C7CEAA0681F5848F4C41F94D744909CE9D6718F459EE2962AE54DA86D399E591103B389C0A9E82E8 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXOcIETfglQORZ0zpDET4Zrk3igikrdHlWJcIsUbVTe64OphDQ8QPJMA= X-Mailru-Sender: 9404297511D70F1A7B5E4BE232D4685F543E5A2444FFD8023DE06ABAFEAF67056BE5D6D7473160E1A165F1893FAC5C751036CFC832F975CE5A92E71CC7C3152D493CB54E9A9D11381B6B970E2AF9E88A510CA7867B031959FEAC74B6516BD3BDB4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v3] dbg: display fast function name along with ffid 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: Mikhail Elhimov via Tarantool-patches Reply-To: Mikhail Elhimov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! Updated according to your comments. On 28.09.2026 16:02, Sergey Bronnikov wrote: > Hi, Mikhail, > > thanks for the patch! LGTM with minor comments below. > > Sergey > > On 9/24/26 23:14, Mikhail Elhimov wrote: >> Part of tarantool/tarantool#4808 >> --- >> Changes in v3: >>    - Fixed fast function regexp in tests >> >> Changes in v2: >>    - Format is changed to 'ffname (#ffid)' >>    - Replaced single '_' with '.' in ffname >>    - Adjusted tests to check mapping >> >> This patch is to be applied after >> https://lists.tarantool.org/pipermail/tarantool-patches/2026-September/030791.html. >> >> Branch: >> https://github.com/tarantool/luajit/tree/elhimov/gh-4808-display-fast-function-name >> Related issue: https://github.com/tarantool/tarantool/issues/4808 >> >>   src/luajit_dbg.py                             | 19 +++++++++++++------ >>   .../debug-extension-tests.py                  |  6 ++++-- >>   2 files changed, 17 insertions(+), 8 deletions(-) >> >> diff --git a/src/luajit_dbg.py b/src/luajit_dbg.py >> index 5cd23a88..a564801b 100644 >> --- a/src/luajit_dbg.py >> +++ b/src/luajit_dbg.py >> @@ -1121,6 +1121,11 @@ def frames(L): >>   # LuaJIT macro implementations and structure access. >>     +# Get FastFunc enum members and replace any single '_' with '.'. >> +FF_NAMES = EnumBasedList('FastFunc', 'FF__MAX', lambda x: >> +                         re.sub('(?> 'FF_'))) >> + >> + >>   def mref(typename, obj): >>       return dbg.cast(typename, obj['ptr64'] if LJ_GC64 else >> obj['ptr32']) >>   @@ -1716,7 +1721,7 @@ def dump_lj_gco_proto(gcobj): >>     def dump_lj_gco_func(gcobj): >>       func = dbg.cast('struct GCfuncC *', gcobj) >> -    ffid = func['ffid'] >> +    ffid = int(func['ffid']) >>         if ffid == 0: >>           pt = funcproto(func) >> @@ -1729,7 +1734,8 @@ def dump_lj_gco_func(gcobj): >>       elif ffid == 1: >>           return 'C function @ {}'.format(strx64(func['f'])) >>       else: >> -        return 'fast function #{}'.format(int(ffid)) >> +        ffname = FF_NAMES[ffid] if ffid < len(FF_NAMES) else "unknown" > use single quotes Done >> +        return 'fast function {} (#{})'.format(ffname, ffid) >>       def dump_lj_gco_trace(gcobj): >> @@ -2079,7 +2085,7 @@ def dump_proto(proto): >>       def dump_func(func): >> -    ffid = func['ffid'] >> +    ffid = int(func['ffid']) >>         if ffid == 0: >>           pt = funcproto(func) >> @@ -2087,7 +2093,8 @@ def dump_func(func): >>       elif ffid == 1: >>           return 'C function @ {}\n'.format(strx64(func['f'])) >>       else: >> -        return 'fast function #{}\n'.format(int(ffid)) >> +        ffname = FF_NAMES[ffid] if ffid < len(FF_NAMES) else "unknown" > the same is used in dump_lj_gco_func(), I would create a helper for this Done >> +        return 'fast function {} (#{})\n'.format(ffname, ffid) >>       # FFI dumpers. >> @@ -2713,7 +2720,7 @@ the type and some info related to it. >>   * LJ_TFUNC: >>     : Lua function @ , upvalues, >>     : C function >> -  : fast function # >> +  : fast function (#) >>   * LJ_TTRACE: trace @ >>   * LJ_TCDATA: cdata @ >>   * LJ_TTAB: table @ (asize: , hmask: ) >> @@ -2932,7 +2939,7 @@ the type and some info related to it. >>   * LJ_TFUNC: >>     : Lua function @ , upvalues, >>     : C function >> -  : fast function # >> +  : fast function (#) >>   * LJ_TTRACE: trace @ >>   * LJ_TCDATA: cdata @ >>   * LJ_TTAB: table @ (asize: , hmask: ) >> diff --git a/test/tarantool-debugger-tests/debug-extension-tests.py >> b/test/tarantool-debugger-tests/debug-extension-tests.py >> index 5e369f00..fe5e34f5 100644 >> --- a/test/tarantool-debugger-tests/debug-extension-tests.py >> +++ b/test/tarantool-debugger-tests/debug-extension-tests.py > fallback "unknown" is not covered Added the requested tests (both for 'lj-func' and 'lj-gco') >> @@ -326,7 +326,7 @@ GCO_ARGS = ( >>       'coroutine.create(function() end),\n' >>       'function() end,\n' >>       'require,\n' >> -    'print,\n' >> +    'math.min,\n' >>       'ffi.new("int*"),\n' >>       '{1},\n' >>       'newproxy(),\n' > added also tests for: getmetatable(io.stdout).__gc and > getmetatable(io.stdout).__tostring to cover regexp Done >> @@ -338,7 +338,7 @@ GCO_RX = ( >>       r'thread @ ' + RX_ADDR + r'\n' >>       r'Lua function @ ' + RX_ADDR + r', [0-9]+ upvalues, .+:[0-9]+\n' >>       r'C function @ ' + RX_ADDR + r'\n' >> -    r'fast function #[0-9]+\n' >> +    r'fast function math.min \(#[0-9]+\)\n' >>       r'cdata @ ' + RX_ADDR + r' \[\d+\] 0x0\n' >>       r'table @ ' + RX_ADDR + r' \(asize: \d+, hmask: ' + RX_HASH + >> r'\)\n' >>       r'userdata @ ' + RX_ADDR + r'\n' >> @@ -367,6 +367,7 @@ class TestLJTV(TestCaseBase): >>       # Sorted in LJT order. >>       lua_script = ( >>           'local ffi = require("ffi")\n' >> +        'local math = require("math")\n' >>           'print(\n' >>           '  nil,\n' >>           '  false,\n' >> @@ -435,6 +436,7 @@ class TestLJGCo(TestCaseBase): >>         lua_script = ( >>           'local ffi = require("ffi")\n' >> +        'local math = require("math")\n' >>           'print(\n' + >>           GCO_ARGS + >>           '  1\n'  # Stub for the pattern. > add also a test with "lj-func" for any ffunc Done -- Best regards, Mikhail Elhimov