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 693856EC40; Sat, 14 Aug 2021 14:25:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 693856EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628940331; bh=oSNU+XWaTtZWulxwhtzvrpUyRpXjZ0JyTBDrpiTvZC4=; 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=aPclaikukkTFmfpDMMNE+htwCfh3E9d2nh6JucPbiHgNeYM3/1w8nohs1bhDo8uSP FqmZOT0QFQ9ecuTiqQoLBDe3lbrUGmj29dETK7ZiSv2hCkZFh13hctNrNF1frH4Sun 2nVGqi9DrVh4CF2qN7tMkIKil7M9g8v+9IVRDT7M= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (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 EF90E6EC40 for ; Sat, 14 Aug 2021 14:25:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EF90E6EC40 Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1mErn8-0000z5-2a; Sat, 14 Aug 2021 14:25:30 +0300 Date: Sat, 14 Aug 2021 14:24:13 +0300 To: Mikhail Shishatskiy Message-ID: References: <20210729093425.179158-1-m.shishatskiy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210729093425.179158-1-m.shishatskiy@tarantool.org> X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9D5AC6413C25DCF08CC98B8FCC5CD86F3182A05F53808504098734A0FDAACB64C604FF90FC8E8A4C0E5F338A2A21D1C16F4FE4D2B179FB0E4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77F3E0A4828C8B68EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006373D332FFE8BBF4EB58638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8C945BE5700CEE6BAED82FFC0429DC875117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC2EE5AD8F952D28FBA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C468D16C903838CAB43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A52687A18690C3A6FEF0204F8284B1B476D25B5A363DE9FD9ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA752DA3D96DA0CEF5C48E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F1ADD4D8CD3C81CE65EE01DD4A2747B461560AAE7AAC9F63058513574F670A3DBA0CA7822C2D8F021D7E09C32AA3244CB9D76D331B7C0A1694A09BD73353EDC1E3D93501275E802FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj57i8v0hCSFIopxP3PdMfRQ== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB46B1CA1A4BA5EFCF3E560DA6E054E27E50A2EFD50A1F25EA8F2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v2] memprof: report JIT-side allocations as internal 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! Please, move test adjustment mentioned below to the patch for the symtab with group allocations by trace's number. Otherwise, LGTM. On 29.07.21, Mikhail Shishatskiy wrote: > There are cases when the memory profiler attempts to attribute > allocations triggered by the JIT engine recording phase > with a Lua function to be recorded. In this case, > lj_debug_frameline() may return BC_NOPOS (i.e. a negative value). > > Previously, these situations were ignored and the profiler > reported, that the source line was equal to zero. > > This patch adjusts profiler behavior to treat allocations > described above as internal by dumping ASOURCE_INT if > lj_debug_frameline() returns a negative value. > > Resolves tarantool/tarantool#5679 > --- > > Issue: https://github.com/tarantool/tarantool/issues/5679 > Branch: https://github.com/tarantool/luajit/tree/shishqa/gh-5679-report-jit-allocations-as-internal > CI: https://github.com/tarantool/tarantool/tree/shishqa/gh-5679-report-jit-allocations-as-internal > > Changes in v2: > - Fixed commit title to fit in width of 50 symbols; > - Rebased to the branch [1]; > - Reused default_payload() as a payload to test patch behavior. > > [1]: https://github.com/tarantool/luajit/tree/shishqa/gh-5814-group-allocations-on-trace-by-trace-number > > src/lj_memprof.c | 28 ++++++++++++------- > .../misclib-memprof-lapi.test.lua | 16 ++++++++--- > 2 files changed, 30 insertions(+), 14 deletions(-) > > diff --git a/src/lj_memprof.c b/src/lj_memprof.c > index 87512c3a..e4d819a0 100644 > --- a/src/lj_memprof.c > +++ b/src/lj_memprof.c > diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua > index b7e456e1..96864c6a 100644 > --- a/test/tarantool-tests/misclib-memprof-lapi.test.lua > +++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua > @@ -12,7 +12,7 @@ utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') > local tap = require("tap") > > local test = tap.test("misc-memprof-lapi") > -test:plan(16) > +test:plan(17) > > jit.off() > jit.flush() > @@ -81,7 +81,7 @@ local function fill_ev_type(events, symbols, event_type) > for _, event in pairs(events[event_type]) do > local addr = event.loc.addr > local traceno = event.loc.traceno > - if traceno ~= 0 then > + if traceno ~= 0 and symbols.trace[traceno] then This should be moved to the commit, that changes symtab, this change looks unrelated to this patch, but relates to previous one [1]. > local trace_loc = symbols.trace[traceno] > addr = trace_loc.addr > ev_type[trace_loc.line] = { > @@ -214,9 +214,17 @@ misc.memprof.stop() > -- > 2.32.0 > [1]: https://lists.tarantool.org/pipermail/tarantool-patches/2021-July/024944.html -- Best regards, Sergey Kaplun