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 401B46EC55; Tue, 27 Jul 2021 09:09:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 401B46EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627366140; bh=VhOf/J3vBkPdkE1L5vimmK6k+F/K6pSXAZgrsPblkmY=; 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=qEVZ9RxspJFNtxkGnsHH9UItEWM21AIorpQt8NLFLSPF+ilglAh1nxIOtriOR7vBD s4SCfoAFURcMRUmtHBOl5vd8512LNyDavLO0EiCcnc+vd0yfg3v7VLtFaf6D3qcfbK 0H8Om+/FYhknkOyO6Z4MBeb0JGDI/GXfm9V6IHHI= Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (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 A22396EC55 for ; Tue, 27 Jul 2021 09:08:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A22396EC55 Received: by smtp29.i.mail.ru with esmtpa (envelope-from ) id 1m8GGv-0000Jk-Lb; Tue, 27 Jul 2021 09:08:58 +0300 Date: Tue, 27 Jul 2021 09:07:46 +0300 To: Mikhail Shishatskiy Message-ID: References: <20210721094428.1382809-1-m.shishatskiy@tarantool.org> <1627026889.437497509@f405.i.mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1627026889.437497509@f405.i.mail.ru> X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD941C43E597735A9C34755E0A9F196FCB739C645213AB7C8E0182A05F538085040E2361820A89FD851D0B5D27E8DFDCCFDE562A301640278AA461B357B5502F940 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE746D93DAA4671895CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637367CCE42412B8BE38638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D865CBD88C57BCDC33632C82016E9053A1117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3A703B70628EAD7BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B613439FA09F3DCB32089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5AE32D0BE1FE37F76933913433AF62FE6511AF49179DB03B8D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7536C62C4FBC402878410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348F1757F8DFBC5C33176008B98870B60560392C87E678538EC1FE102F2CAB1CE03657C5231382E4861D7E09C32AA3244CCFDA65229428161F400647A3D992D4275A1673A01BA68E40FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMEANdStWW594QxirBLk9Hw== X-Mailru-Sender: 3B9A0136629DC91206CBC582EFEF4CB4E8D446807CD831A83BE243C3D475C5EB6C3CEE1967E24D4DF2400F607609286E924004A7DEC283833C7120B22964430C52B393F8C72A41A89437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit v1] memprof: group allocations on traces by trace number 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: Mikhail Shishatskiy via Tarantool-patches Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Mikhail! On 23.07.21, Mikhail Shishatskiy wrote: > > Hi! I have one more question: > > How should we properly test the behavior of profiler recording allocations from traces? > Now I can write test which roughly estimates number of allocations in loop: >   > | local function payload() > |   -- Preallocate table to avoid table array part reallocations. > |   local _ = table_new(100, 0) > |   -- Want too see 100 objects here. > |   for i = 1, 100 do > |     -- Try to avoid crossing with "test" module objects. > |     _[i] = "memprof-str-"..i > |   end > |   _ = nil > |   -- VMSTATE == GC, reported as INTERNAL. > |   collectgarbage() > | end >   | jit.on()  > | symbols, events = `run_payload_under_memprof_and_parse`() > | alloc = `get_all_alloc_events`(symbols, events) > | test:ok(alloc[`line_where_loop_starts`].num > `some_guaranteed_number`) > > But I think it will be great if we could replace > sign with ==. The problem is we cannot guarantee > constant number of allocations in the loop: on the most of platforms with `jit.opt.start(‘’hotloop=1’’, ‘’-sink’’)` > I get 97 allocations in 100-iteration loop, as we spend some iterations to compile the trace. But on freebsd, > for example, I get 24 allocations. ​​​​ It's OK due to [1]. You can add the following skip condition for the test on FreeBSD: | -- Disabled on *BSD due to #4819. | utils.skipcond(jit.os == 'BSD', 'Disabled due to #4819') >   > -- > Best regards, > Mikhail Shishatskiy >   >   > >Среда, 21 июля 2021, 14:48 +03:00 от Sergey Kaplun : > >  > >Hi! Thanks for the patch! > >Please consider my comments below. >   > >   > >-- > >Best regards, > >Sergey Kaplun >   [1]: https://github.com/tarantool/tarantool/issues/4819 -- Best regards, Sergey Kaplun