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 2A3D16F3E5; Wed, 10 Nov 2021 18:38:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 2A3D16F3E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1636558690; bh=KD1RfRqsdpjBjbxqxb76MSO52EjCcwZMdyBKvPMScLc=; 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=nYFJFmWsyJppo1VQFxew7YeFhhy/wE2ngzeEjVumt0/YnlnZmCBmLsKvNLOzbNpiA VL5Sa08W0pAN3BHa0DHYpa3CDZoSW2+7j30ycPpbADwx/8cwSIMI0GGAbr+SYkfGE5 ndG2G3DambXprl4nFQVRLjgjaN8OUTAogrh4IX3c= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 276AF6F3E5 for ; Wed, 10 Nov 2021 18:38:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 276AF6F3E5 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mkpfs-0000HD-5W; Wed, 10 Nov 2021 18:38:08 +0300 Date: Wed, 10 Nov 2021 18:38:01 +0300 To: Mikhail Shishatskiy Message-ID: <20211110153801.GH8831@tarantool.org> References: <20210929200758.149446-1-m.shishatskiy@tarantool.org> <20210929200758.149446-3-m.shishatskiy@tarantool.org> <20211027135627.GC8831@tarantool.org> <20211104130010.mcvnra6e4yl5moo2@surf.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211104130010.mcvnra6e4yl5moo2@surf.localdomain> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD99F396AC0BA8E3B134DFB5A250369D09E1F23EFFC513B9AF0182A05F53808504039D7C331F6F27EC0A42B185CCFD9909D0ED08A247CBD9A544094EDD0B6C888D9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE70186A8DAAA7CBDB1EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372E9841F416E2DCCD8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8CA6B364766332120CBD6F79CDFC0E34D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC8C7ADC89C2F0B2A5A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18CB629EEF1311BF91D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B642416645EBD45DC2089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5847616586BF254331DF39ADFFED95E9E3D17DB48B27D3F1ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753753CEE10E4ED4A7410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3472E5ECC12A9739C10BF8363A0FB8D5B35410FEA9AF08851AC8C33A328CE02777E0E7D69CB39FFA041D7E09C32AA3244CD9A12C8F588A829C48CDA6CC8FB911E5E646F07CC2D4F3D8927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojukdrygDmQ+xqVRFreevrBQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D2DB59F0AF3B3E3D7877C27EF07326611A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v4 2/4] memprof: refactor location parsing 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Misha, Thanks for the fixes! LGTM, except a tiny nit below. On 04.11.21, Mikhail Shishatskiy wrote: > Hi, Igor! > Thank you for the review! > > New commit message: > ============================================================ > memprof: refactor location parsing > > As it is hard to keep function `id_location` easily usable in the > function `parse_location` with a growing number of fields in the > table, the code is refactored to make it more understandable. > > The API of module changed with adding a public > function `id(loc)` returning the same id-string, as `id_location` > did. This function is needed to be used in other modules to > "stringify" the location and use it as a key in the key/value > storage. > > Part of tarantool/tarantool#5814 > ============================================================ > > Diff: > ============================================================ > diff --git a/tools/memprof/parse.lua b/tools/memprof/parse.lua > index 34ff8aef..75f5cb39 100644 > --- a/tools/memprof/parse.lua > +++ b/tools/memprof/parse.lua > @@ -8,10 +8,10 @@ local bit = require "bit" > local band = bit.band > local lshift = bit.lshift > > -local symtab = require "utils.symtab" > - > local string_format = string.format > > +local symtab = require "utils.symtab" > + > local LJM_MAGIC = "ljm" > local LJM_CURRENT_VERSION = 1 > > @@ -66,12 +66,15 @@ local function parse_location(reader, asource) > addr = 0, > line = 0, > } > - if asource == ASOURCE_CFUNC then > + -- luacheck: ignore > + if asource == ASOURCE_INT then > + -- Do nothing. I believe adding only luacheck suppression is enough here. | ... | if asource == ASOURCE_INT then -- luacheck: ignore | else asource == ASOURCE_CFUNC then | ... > + elseif asource == ASOURCE_CFUNC then > loc.addr = reader:read_uleb128() > elseif asource == ASOURCE_LFUNC then > loc.addr = reader:read_uleb128() > loc.line = reader:read_uleb128() > - elseif asource ~= ASOURCE_INT then > + else > error("Unknown asource "..asource) > end > return symtab.id(loc), loc > ============================================================ > > Issue: https://github.com/tarantool/tarantool/issues/5814 > Branch: https://github.com/tarantool/luajit/tree/shishqa/gh-5814-group-allocations-on-trace-by-trace-number > CI: https://github.com/tarantool/tarantool/tree/shishqa/gh-5814-group-allocations-on-trace-by-trace-number > > -- > Best regards, > Mikhail Shishatskiy -- Best regards, IM