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 D9BC36EFDC; Thu, 24 Sep 2026 01:55:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D9BC36EFDC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1790204142; bh=vF8kPV1uVDFtZXo5TDiDZdXQWBiFYAMTQtTv93aOKsk=; 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=kBb498QGXnDatcB4Qgu5G+ut+B/0bwCQTxK0nsprKcP683BVerYvQ0sSkCf5kwIXG iV2mltOKCEXP17zalcoA5xpct4/ADLLPZNs7yj/efXBan/1pjvgIcksmJzclSDKvGh ERCSquO1bo2A9jJj5RG5zfkUU5V4HV5782pi5UhU= Received: from send58.i.mail.ru (send58.i.mail.ru [89.221.237.153]) (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 07D276EFDC for ; Thu, 24 Sep 2026 01:55:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 07D276EFDC Received: by exim-smtp-7cfc745659-js795 with esmtpa (envelope-from ) id 1x9VsJ-00000000GXc-24IE; Thu, 24 Sep 2026 01:55:40 +0300 Message-ID: <1adb09a7-8708-47cd-8230-0b2b3f90a8f6@vk.team> Date: Thu, 24 Sep 2026 01:55:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun References: <20260909130730.362946-1-m.elhimov@vk.team> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-618D5548: 8E11AC27F7197068479CDAE959BF64247953AE431F6F38371C0CB56AFB7A78ACC25E9B19C4F63579 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9F6609298D81718F4ACC94E586C0A2509EA8D7611D6806767182A05F538085040BF6E29E356BE61403DE06ABAFEAF67057A8F7AA1115751930D339E851FC17A5F77B46462DFFF61CB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE728A881FD0F09D355EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566D216EB99429A6A60E83D85E758A839D650192D5FB78C9D4B2FC298BE34B7CF1F8EEF46B7454FC60B9742502CCDD46D0DF254576263B31EA9BA3038C0950A5D36D5E8D9A59859A8B6E3A028A264FFF66376E601842F6C81A1F004C906525384303E02D724532EE2C3F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C7202BF4A0E62ADA443847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5DAA374A25425C8975002B1117B3ED696DEF1BE216D633BBCE772F934B9BCD185823CB91A9FED034534781492E4B8EEAD8D8BB953E4894305BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0AD73CAD6646DEDE191716CD42B3DD1D34C77DD89D51EBB774225B6776AC983F447FC0B9F89525902EE6F57B2FD27647F25E66C117BDB76D659873F54D43D14314FC4D724E0704EAA58184D8DA7BC2AB4874E2729EC5C1F0C68B2DDAE08895C5F99B8341EE9D5BE9A0AE33B8976124D1849B16DA5D7457C3F08A73B501731DB9735C7CEAA0681F5848F4C41F94D744909CE9D6718F459EE2962AE54DA86D399E591103B389C0A9E82E8 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXOcIETfglQORZ0zpDET4Zrk3igikrdHlWD3CIbi/ddRzsl0Q2O/NArY= X-Mailru-Sender: 49D287FBCBBF3A5C3B2EFE8832C895B5837C92D5BD991CF63DE06ABAFEAF67057A8F7AA111575193A165F1893FAC5C751036CFC832F975CE5A92E71CC7C3152D493CB54E9A9D11381B6B970E2AF9E88A510CA7867B031959FEAC74B6516BD3BDB4A721A3011E896F 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: Mikhail Elhimov via Tarantool-patches Reply-To: Mikhail Elhimov Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the review! See my comments below On 22.09.2026 12:16, Sergey Kaplun wrote: > 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 Then what about these and similar ones (they have 3 underscores in a row): ffi_meta___index io_method___gc ? May be replace only first underscore? > Minor: I would rather placed it somewhere into the section: > | # LuaJIT macro implementations and structure access. Done >> + >> # 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. Done >> >> >> 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. Done >> >> >> # 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 (#) Done >> * 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 (#) Done >> + : 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. No problem, but first we need to agree on how to handle underscores (see above comment about multiple undescores) > >> ing 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, Mikhail Elhimov