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 7ABAA129591F; Wed, 5 Mar 2025 13:57:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7ABAA129591F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1741172251; bh=mU/5jaRsU0jJyd30Udj+uQpWeX9kmhrRo4eqEMG3dlM=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=uk+Y6X3tWVRmoDHw1RuuxWc+SoitsMrAWBwga/PWzjJz5qNvWFKaNH2zOhX6nlTic Qd8ZgJRuYzwe1C5qFV8KWhz1ESZrppmQzHEhyZEieTZ1YyrKZL4EnpCwgq4ykl5bQS ug9d64TnSYbuv+L1CpdCPXY2YQuYjdsAvUtyo3qo= Received: from send127.i.mail.ru (send127.i.mail.ru [89.221.237.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5D2811295920 for ; Wed, 5 Mar 2025 13:57:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5D2811295920 Received: by exim-smtp-848fbd8fb5-swjdx with esmtpa (envelope-from ) id 1tpmRN-000000007VX-13eB; Wed, 05 Mar 2025 13:57:29 +0300 Date: Wed, 5 Mar 2025 13:57:29 +0300 To: Sergey Bronnikov Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org Message-ID: References: <6f39b239-083c-4508-a364-1ba02b3b5ed3@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f39b239-083c-4508-a364-1ba02b3b5ed3@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9A2A28D6C22EE44037DE62B64397255774A442287D81B979E182A05F5380850404266B28181EECA1F3DE06ABAFEAF6705BA0398948A4B7A105ACF2F673215F14E0E5F34248A8274CD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE745229D52CF30560CEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB55337566AE3F01DD33DDBDC84760214379C2EF9713DAF992E036D48FD50574FE1CF44641389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6D52CD31C43BF465FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249EDF998CB16CCEE6976E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8B7FE970921847EE7F3AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E7356C9A9530EBF72002C4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5056D62D38C6E6D225002B1117B3ED696DB45FFB250AF58C9406406D89DD9EB8A823CB91A9FED034534781492E4B8EEAD0AA277257C6A5E3DBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D344A2E3AE0A8792E69F1207356DCC5EC0CFB653D06538C229B2E60C5938F8EB67491746CE4B6E553A51D7E09C32AA3244C7D97EB972EB7DF9E77DD89D51EBB7742C730D597FD222700EA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVQiWK+2I7Y2swrq5EsclOQw= X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B593596D19CB193DD293DE06ABAFEAF6705BA0398948A4B7A10B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 8/8][v3] memprof: set default path to profiling output file 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! See my answer below. On 24.02.25, Sergey Bronnikov wrote: > Hi, Sergey, > > thanks for review! > >> --- > >> + > >> + local default_output_file = 'memprof.bin' > >> + os.remove(default_output_file) > >> + > >> + local _, _ = misc.memprof.start() > > Minor: Do we want to check that the profiler starts successfully? > > I suppose we should, since this is the expected behaviour for this > > feature. In case the profiler is not started (old behaviour) we would > > get an error from the branch below: profiler not running. This isn't a > > verbose definition of what goes wrong. > > I don't get why we should check that profiler is started in a test for > default output file. If the `memprof.start()` call will fail in the test (for any reason), the next call of `memprof.stop()` will return `false, "profiler is not running"`. So, when debugging the test, we have no clue about the reason for the not-started profiler, which is not very convenient. > > I suppose we may use `goto` here like the following: > > > > | local res, err = misc.memprof.start() > > | -- Should start successfully. > > | if not res then > > | goto err_handling > > | end > > | > > | res, err = misc.memprof.stop() > > | > > | ::err_handling:: > > | -- Want to cleanup carefully if something went wrong. > > | if not res then > > > >> + > >> + local res, err = misc.memprof.stop() > >> + > >> + -- Want to cleanup carefully if something went wrong. > >> + if not res then > >> + os.remove(default_output_file) > >> + error(err) > >> + end -- Best regards, Sergey Kaplun