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 BE3B26ECDB; Tue, 22 Sep 2026 12:16:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BE3B26ECDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1790068587; bh=aVyilpG9vpz2xLQdN0RSCbcRL50z07xx5dmkk/Jo2CM=; 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=k5CrXC6IaVaby25OR/vwrSwDI8D+38aN+UjKzQlZ8yfLowE4Lu7zuCtlm0BtBudAy PUu+k5YZxFP7pJJJLIz/xp9DsypXhVP4C5yQa4OmrB7pvDBLd3qK/nTY1z/kRL/f+T ytVyUvge06NHcY1fs4c6N7YaMyoKmndDDxnx3QO4= Received: from send151.i.mail.ru (send151.i.mail.ru [89.221.237.246]) (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 051066ECDB for ; Tue, 22 Sep 2026 12:16:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 051066ECDB Received: by exim-smtp-7cfc745659-s7mfd with esmtpa (envelope-from ) id 1x8wbw-00000000N3B-3gRr; Tue, 22 Sep 2026 12:16:25 +0300 Date: Tue, 22 Sep 2026 12:16:04 +0300 To: Mikhail Elhimov Message-ID: References: <20260909130730.362946-1-m.elhimov@vk.team> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260909130730.362946-1-m.elhimov@vk.team> X-Mailru-Src: smtp X-4EC0790: 10 X-618D5548: DF1829BCED3A60C066FA44935DFD412480C6906DCB2D25F6F835360A6CC2EDA94A46B9F31574007C X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD98DB65506D2E90760552BF3BFC0AA04ED2FF99E2B8294CDF41313CFAB8367EF908E2BE116634AD74DDF1829BCED3A60C066FA44935DFD4124713F249908728509F835360A6CC2EDA9E8A5C135F8BDED31 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C579B1C3ABE6C709C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6759CC434672EE6371C2A783ECEC0211ADC4224003CC836476D5A39DEEDB180909611E41BBFE2FEB2B8F3187F799D2A8B86D3D070630688EB47DE06F4E3477CF0F099DC7CBB771504A9FA2833FD35BB23D9E625A9149C048EE33AC447995A7AD18C26CFBAC0749D213D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B974A882099E279BDA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C741622C43FECC0DC43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A50FD6632FA050D5095002B1117B3ED696E24FC59A1B5F2EE46E5F408120975D333610D81D389A125CDE35189EBF2DEA28FEA14CD2CD220BB99C5DF10A05D560A9880EC71AF561E0AAD9143641EC25BB39C9DC896FBFA37178 X-C8649E89: 1C3962B70DF3F0ADB58128AB1E6D661A716CD42B3DD1D34CAB70F9BE574AE9C625B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D65978C6801B096BA6F9E6A9FB5F6BB2104B5774D7676EC9F50FFE613604DF78F3A6881641FCE5701679B8341EE9D5BE9A0A5CE5429258383F167497E6BF069D97FC376D0DBF67D10F03C7CEAA0681F5848F4C41F94D744909CECFA6C6B0C050A61A8CAF69B82BA93681CD72808BE417F3B9E0E7457915DAA85F X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXOcIETfglQORZ0zpDET4Zrk3igikrdHlWGajMHXyW6gOm5/lFOSIJYM= X-Mailru-Sender: 689FA8AB762F73937C9FA53A4753B3133ADD9D5A7A96DA7C62B7B308E98E4C5B14E7C4771B5356DAE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Mikhail! Thanks for the patch! Generally, LGTM, with minor suggestions below. On 09.09.26, Mikhail Elhimov wrote: > Part of tarantool/tarantool#4808 > --- > This patch is to be applied after the 'avoid hardcoded enums' patch. > > 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 | 17 +++++++++++------ > .../debug-extension-tests.py | 2 +- > 2 files changed, 12 insertions(+), 7 deletions(-) > > diff --git a/src/luajit_dbg.py b/src/luajit_dbg.py > index 1ac1d275..262fdad1 100644 > --- a/src/luajit_dbg.py > +++ b/src/luajit_dbg.py > @@ -1682,8 +1682,11 @@ def ir_kint64(ir): > > # Dumpers. > > +FF_NAMES = EnumBasedList('FastFunc', 'FF__MAX', cut_prefix, 'FF_') It would be nice to replace `_` in functions names to `.`. Resulting: math_min -> math.min Minor: I would rather placed it somewhere into the section: | # LuaJIT macro implementations and structure access. > + > # GCobj dumpers. > > + > def dump_lj_gco_str(gcobj): > return 'string {body} @ {address}'.format( > body=strdata(gcobj), > @@ -1705,7 +1708,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) > @@ -1718,7 +1721,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" > + return 'fast function #{}({})'.format(ffid, ffname) I suggest the following format insted: | 'fast function {} (#{})'.format(ffname, ffid) Generally we needed ffid less then the function name. > > > def dump_lj_gco_trace(gcobj): > @@ -2068,7 +2072,7 @@ def dump_proto(proto): > > > def dump_func(func): > - ffid = func['ffid'] > + ffid = int(func['ffid']) > > if ffid == 0: > pt = funcproto(func) > @@ -2076,7 +2080,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" > + return 'fast function #{}({})\n'.format(ffid, ffname) I suggest the following format insted: | 'fast function {} (#{})\n'.format(ffname, ffid) Generally we needed ffid less then the function name. > > > # FFI dumpers. > @@ -2702,7 +2707,7 @@ the type and some info related to it. > * LJ_TFUNC: > : Lua function @ , upvalues, > : C function > - : fast function # > + : fast function #() I suggest the following format instead: | : fast function (#) > * LJ_TTRACE: trace @ > * LJ_TCDATA: cdata @ > * LJ_TTAB: table @ (asize: , hmask: ) > @@ -2921,7 +2926,7 @@ the type and some info related to it. > * LJ_TFUNC: > : Lua function @ , upvalues, > : C function > - : fast function # I suggest the following format instead: | : 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 9989032b..40a27c3a 100644 > --- a/test/tarantool-debugger-tests/debug-extension-tests.py > +++ b/test/tarantool-debugger-tests/debug-extension-tests.py > @@ -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 #[0-9]+\(\w+\)\n' Lets check the specific name here. I suggest `math.min` to check the _ -> . mapping. > 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' > -- > 2.43.0 > -- Best regards, Sergey Kaplun