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 7B8696EC40; Sat, 14 Aug 2021 11:02:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7B8696EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628928130; bh=PFeC/KCVJVCqNLqbCHnCMaTbYYadoJvj3nscUsHiNy0=; 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=ACNWCVPLs5Hyvc/eRjz3Z4rUeXK9hBu0IepCBOfYdnaISRDpY20XRmT/a4fIsGROO vTzuTd4FkHS2osIAIrqHPmb3W2k8hTnycEMfXY9/E3sOpQWR+sUiJqogmzkIxkz0uk Z5h4EfChdFZ/q1F2VQ1b0OIX8SyBTdoT3XXLO/Yg= Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (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 88DA76EC40 for ; Sat, 14 Aug 2021 11:02:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 88DA76EC40 Received: by smtp39.i.mail.ru with esmtpa (envelope-from ) id 1mEocJ-0006BA-Hk; Sat, 14 Aug 2021 11:02:07 +0300 Date: Sat, 14 Aug 2021 11:00:51 +0300 To: Mikhail Shishatskiy Message-ID: References: <20210728134259.1113235-1-m.shishatskiy@tarantool.org> <20210728134259.1113235-2-m.shishatskiy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210728134259.1113235-2-m.shishatskiy@tarantool.org> X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F53808504036D74D0C2E109A285F52027F4080448C4FD0629ABD404900E12C8AAE7DCF8BF5 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71EAE3A63419E5AEDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063743447F216C7C64BDEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F27EA431100D4750A8C437763BBDBF8960CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F924B32C592EA89F389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8B861051D4BA689FCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B08F9A42B2210255C75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-C1DE0DAB: 0D63561A33F958A56199B660D3BED7591CEF36F8F2FCCF5C00B4697AD8F846B8D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752DA3D96DA0CEF5C48E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3474B2583E51315984850E73570F690E62F076233AF740A641F5598413FB8BBED979E46CB03FA522DF1D7E09C32AA3244C43F3F6D85CEBB000E4AD3501153ADE87259227199D06760AFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj57i8v0hCSFLTvbda0NdOkw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4877C4BC88588F6CC138DA060A305FC2C93919BC5FB8A4F5AF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2 1/2] memprof: dump traceno if allocate from trace 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! Thanks for the fixes! LGTM, except a few nits regarding the commit message and comment in the code. On 28.07.21, Mikhail Shishatskiy wrote: > When LuaJIT executes a trace, the trace number is stored in > the virtual machine state. So, we can treat this number as > an allocation event source in memprof and report allocation events > from traces as well. > > Previously, all the allocations from traces were marked as INTERNAL. > > This patch introduces the functionality described above by adding > a new allocation source type named ASOURCE_TRACE. If at the moment > when allocation event occurs VM state indicates that trace executed, > trace number streamed to a binary file: > > | loc-trace := trace-no > | trace-no := > > Also, the memory profiler parser was adjusted to recognize this Typo: s/was/is/ > source type by extending structure: field , > representing trace number, was added. Typo: s/trace number/a trace number/ Typo: s/was/is/ > > Part of tarantool/tarantool#5814 > --- > > 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 > > src/lj_memprof.c | 14 ++++++++++++-- > src/lj_memprof.h | 13 ++++++++----- > tools/memprof/parse.lua | 22 ++++++++++++++-------- > 3 files changed, 34 insertions(+), 15 deletions(-) > > diff --git a/src/lj_memprof.c b/src/lj_memprof.c > index 2c1ef3b8..0c7e9e89 100644 > --- a/src/lj_memprof.c > +++ b/src/lj_memprof.c > @@ -168,9 +176,11 @@ static const memprof_writer memprof_writers[] = { > ** But since traces must follow the semantics of the original code, > ** behaviour of Lua and JITted code must match 1:1 in terms of allocations, > ** which makes using memprof with enabled JIT virtually redundant. > - ** Hence use the stub below. > + ** But if one wants to investigate allocations with JIT enabled, > + ** memprof_write_trace() dumps trace number to the binary output. Typo: trailing whitespace here ---------------------------------------^ > + ** It can be useful to compare with with jit.v or jit.dump outputs. > */ > - memprof_write_hvmstate /* LJ_VMST_TRACE */ > + memprof_write_trace /* LJ_VMST_TRACE */ > }; > > static void memprof_write_caller(struct memprof *mp, uint8_t aevent) > diff --git a/src/lj_memprof.h b/src/lj_memprof.h > index 3417475d..e3f55433 100644 > --- a/src/lj_memprof.h > +++ b/src/lj_memprof.h > diff --git a/tools/memprof/parse.lua b/tools/memprof/parse.lua > index 12e2758f..2d3c71f0 100644 > --- a/tools/memprof/parse.lua > +++ b/tools/memprof/parse.lua > -- > 2.32.0 > -- Best regards, Sergey Kaplun