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 36F7B6F3C7; Fri, 26 Mar 2021 23:34:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 36F7B6F3C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616790847; bh=4i0/bf45FfDmOcxXi+UHVo3wGUQXYnarc8lTKP5rNoo=; 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=s9OKFczgohPX5nRT2s/1CaBnw3rjbM6BfKAKm6qogQ31ZrWFpuMDGfjVWvXC+V9vi 6RC3OdF8FYpbSL/S0M4WLXBmdM7g9EwXRt/KV5Ux1lJFLzm+nh220S2jMs4f3BLB/P rqoxqYKKc92H124GH3KvTCDTLPEblFIdfVrHMtaU= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 EA74B6F3C7 for ; Fri, 26 Mar 2021 23:34:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EA74B6F3C7 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lPt9g-00006D-Us; Fri, 26 Mar 2021 23:34:05 +0300 Date: Fri, 26 Mar 2021 23:33:56 +0300 To: Sergey Kaplun Message-ID: <20210326203356.GJ29703@tarantool.org> References: <20210326164855.30242-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210326164855.30242-1-skaplun@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD9ED7173E37F4E32941B7C4A78AC10F96A7797F60C25BD4B06182A05F5380850408F8195E41BBA2D7CFED903A43FA3AE47D177AC4BBA1EC52CE015CEBFBFF42A62 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE752E71F0C64B7C834EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E1D2769089B3DFB28638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C5DD32608FC869F5DFC5A428BE52B436069982990A1E02458A471835C12D1D9774AD6D5ED66289B5259CC434672EE6371117882F4460429724CE54428C33FAD30A8DF7F3B2552694AC26CFBAC0749D213D2E47CDBA5A9658359CC434672EE6371117882F4460429728AD0CFFFB425014E868A13BD56FB6657E2021AF6380DFAD1A18204E546F3947C0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E73528A6D463EDFD0DBBC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5650E32F25A15098E55F9BA4D0C28E12C1B6132A3957C6281D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7502E6951B79FF9A3F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34E20F2278F74481A16F5B4865A680BFD239B93AF81E0F33485A4675A3B6D2EC9F0DB8E7CF6D3B54711D7E09C32AA3244C6E1A8070E91897622743705F0D9B4CD0B018FE5BB746DCD1927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojapPp7P/VpAg8TKvQ5TCijA== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822C61ECEF87A03E25604E26D0302D1C6DDA7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] tools: make memprof parser output user-friendly 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" Sergey, Thanks for the patch! LGTM, except the couple of nits below. On 26.03.21, Sergey Kaplun wrote: > Profiler parser output looks like the following: > | ALLOCATIONS > | @true_memleak.lua:6, line 9: 3 144 0 > | @true_memleak.lua:6, line 8: 2 41 0 > > Line of function definition is confusing for users and looks redundant. Typo: s/is confusing for/confuses/. > Also, these "magic numbers" may shock users. Minor: Are you still talking about the line of function definition or about the events/bytes here? It's a bit unclear from the wording. > > This patch removes lines of function definitions from the output. > Info about the line function definition is saved inside symbol info > table by field `defined` (it can be used later for a user's custom > parser). Moreover, explanatory words and signs are added to numbers > for more verbose output. > > After the patch, profiler parser output looks like the following: > | ALLOCATIONS > | @true_memleak.lua:9: 3 events +144 bytes -0 bytes > | @true_memleak.lua:8: 2 events +41 bytes -0 bytes > > Resolves tarantool/tarantool#5811 > Part of tarantool/tarantool#5657 > --- > Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-5811-user-friendly-memprof > Tarantool branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-5811-user-friendly-memprof > Issues: > * https://github.com/tarantool/tarantool/issues/5811 > * https://github.com/tarantool/tarantool/issues/5657 > > test/tarantool-tests/misclib-memprof-lapi.test.lua | 4 +++- > tools/memprof/humanize.lua | 2 +- > tools/utils/symtab.lua | 5 +++-- > 3 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/tools/memprof/humanize.lua b/tools/memprof/humanize.lua > index 109a39db..2d5814c6 100644 > --- a/tools/memprof/humanize.lua > +++ b/tools/memprof/humanize.lua > @@ -20,7 +20,7 @@ function M.render(events, symbols) > > for i = 1, #ids do > local event = events[ids[i]] > - print(string.format("%s: %d\t%d\t%d", > + print(string.format("%s: %d events\t+%d bytes\t-%d bytes", Minor: Heh, "events" is still plural even if is 1. Feel free to ignore (the current implementation might ease the postprocessing). > symtab.demangle(symbols, event.loc), > event.num, > event.alloc, > diff --git a/tools/utils/symtab.lua b/tools/utils/symtab.lua > index 03aadbd5..6cfa1065 100644 > --- a/tools/utils/symtab.lua > +++ b/tools/utils/symtab.lua > @@ -25,7 +25,8 @@ local function parse_sym_lfunc(reader, symtab) > local sym_line = reader:read_uleb128() > > symtab[sym_addr] = { > - name = string_format("%s:%d", sym_chunk, sym_line), > + name = sym_chunk, > + defined = sym_line, Minor: Since you split "name" into two components -- file name and line the function is defined -- it looks natural to me to use the same names as does: source + linedefined. Anyway, feel free to ignore, since the naming you chose is also fine. > } > end > > -- > 2.31.0 > -- Best regards, IM