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 250D66EC79; Mon, 28 Sep 2026 16:02:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 250D66EC79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1790600579; bh=pFJsSqDP4hFPj19faX+TjFMnzSJpzfy/L0WiMA4t0Mo=; 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=dri5X8Ump1g8QpWSh8cEfc1mAkm8LhclmSFD0nBHax6LGHYOYraL/KotMuHEQs40/ cpesHBzG+F1j7oWmnH9y5yUCx1CEtuYOF5d8JG0hA7f+JgjGfVTpBbwStRxQh+c0mJ kLUOspK/D0WqXbtECSiePPq4iRDCK7hNI5pypr5k= Received: from send59.i.mail.ru (send59.i.mail.ru [89.221.237.154]) (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 B4DD86EC79 for ; Mon, 28 Sep 2026 16:02:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B4DD86EC79 Received: by exim-smtp-5c48578f7d-9dtds with esmtpa (envelope-from ) id 1xBB0S-0000000021R-3DAD; Mon, 28 Sep 2026 16:02:57 +0300 Message-ID: Date: Mon, 28 Sep 2026 16:02:56 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Mikhail Elhimov , 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: <20260924201412.194073-1-m.elhimov@vk.team> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-618D5548: FAB9417C5D494FD1F378A8CA21F699D6B28C39108D2B223B774E3971752B13E967C2636879257D09 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD974C1F97FFD322AB34C122DA82FF597EE131D42388D8E9912182A05F538085040E4C814773BE828B13DE06ABAFEAF6705F2E3E2DF551C5A2AC37C59ACF3CC6619984125FF27271FD8 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7492D3E4238663367EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB5533756689D67F2C7FEA51B5CC4179926EFA51B4FF79DED7B95A52C1346548CF26B3F7F5389733CBF5DBD5E9D5E8D9A59859A8B652D31B9D28593E51CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8090A508E0FED6299176DF2183F8FC7C008D3F1921598A17CCD04E86FAF290E2DB606B96278B59C421DD303D21008E29813377AFFFEAFD269176DF2183F8FC7C0D75EB778CE7D8A0C68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CCD798FA1FEA6F93543847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A55DD6A5DD541488E25002B1117B3ED696B882CB89152613833E67C18142C611B7823CB91A9FED034534781492E4B8EEAD27E9584FBD6BDD31BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADB58128AB1E6D661A716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659C7BDD91CF3148D8A85452C504406B1AA9C8DB5BEAC971B560603C98A931EF3C96E9965F547CCA081B8341EE9D5BE9A0A82D7D388E6E144A0B3BAE3CC2E673C7B45766F2671E98DF9C7CEAA0681F5848F4C41F94D744909CE2512F26BEC029E55448553D2254B8D95CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXOcIETfglQORZ0zpDET4Zrk3igikrdHlWN0masGArv8inNR0l9D9uPM= X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F258845860334F4084003FED00C2CDE4AB6CFA7BF799C128DCDB8E43E78908CACC3FD94F645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 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: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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('(? + > + > 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 > + 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 > + 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 > @@ -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 > @@ -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