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 56C21F3116C; Mon, 24 Feb 2025 14:14:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 56C21F3116C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1740395697; bh=sznB3BbM9POvspX3SpjG0J3c4JtVzOVJWFGfBm3dub8=; 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=Gd6WtgRGSGmju2TSpUnI0GgDVsEGxZSQbO0NnlCmzOAM0h2Qag55LrwLkChppijUE owBuVs+pcodXKyU4sQ6LAl8XcHfJk2DJ2cve9lQkw7PiADJPXfizkFHEPt20Y7fpfF fJ+u0nOwW44myHOfL8/2MehzB7ix2FwopXr9UM7A= Received: from send34.i.mail.ru (send34.i.mail.ru [89.221.237.129]) (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 A2B5FF31141 for ; Mon, 24 Feb 2025 14:14:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org A2B5FF31141 Received: by exim-smtp-5556bfdb98-6h675 with esmtpa (envelope-from ) id 1tmWQJ-00000000Tcx-2Psg; Mon, 24 Feb 2025 14:14:56 +0300 Date: Mon, 24 Feb 2025 14:14:14 +0300 To: Sergey Bronnikov Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD916C41472748AFA0453D9C7FE68DF4451D80261D9949172CF00894C459B0CD1B9C11182D8B28CBDF4A421357250EF31AD8BA31F1D6A2CB11DBFD9585CF2E34AA40C43EDF95CA0F6DD X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75B37E0A1C175363BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637416EC277BB71E4518638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8774622B74AF4B81F90DE7E44ACC335834D91CD6CD5736DB4CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F924B32C592EA89F389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC80CABCCA60F52D7EBF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CF8BD4E506CFA3D88C0837EA9F3D197644AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3D8561A2FEC730ACEBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7E1BCFB2C0BE3F189731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5E5FDC0E109BC36175002B1117B3ED696BF12B5DBA3016AB4466072E6821086B3823CB91A9FED034534781492E4B8EEADB73CFAAED92B6E13BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34B3611847B8BC2D0BCED0A07D028057F56FF22AB8182A0AD83009307E7E1427FC0B0952C97B38A68B1D7E09C32AA3244C6BEC4BF8729843A677DD89D51EBB7742E35800DBED48198EEA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVQQG/FugD0/CpmNrQigjP00= X-Mailru-Sender: 520A125C2F17F0B1A9638AD358559B59BF78E8D7932BC8483DE06ABAFEAF6705A4C75137206C2157B7CBEF92542CD7C88B0A2698F12F5C9EC77752E0C033A69E86920BD37369036789A8C6A0E60D2BB63A5DB60FBEB33A8A0DA7A0AF5A3A8387 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 Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi, Sergey! Thanks for the fixes! LGTM, with a few small nits below. On 20.02.25, Sergey Bronnikov wrote: > sysprof has an optional parameter `path`, that sets a path to > the profiling output file. By default the path is `sysprof.bin`. Typo: s/default/default,/ > `misc.memprof.start()` requires to set a path to profiling output Typo: s/to set/setting/ Typo: s/profiling/the profiling/ > file. The patch fixes this inconsistency by introducing a default > path to the memprof profiling output file - `memprof.bin`. > --- > src/lib_misc.c | 5 ++- > ...misclib-memprof-lapi-default-file.test.lua | 37 +++++++++++++++++++ > 2 files changed, 41 insertions(+), 1 deletion(-) > create mode 100644 test/tarantool-tests/profilers/misclib-memprof-lapi-default-file.test.lua > > diff --git a/src/lib_misc.c b/src/lib_misc.c > index d98cf3f0..92dc6e2a 100644 > --- a/src/lib_misc.c > +++ b/src/lib_misc.c > diff --git a/test/tarantool-tests/profilers/misclib-memprof-lapi-default-file.test.lua b/test/tarantool-tests/profilers/misclib-memprof-lapi-default-file.test.lua > new file mode 100644 > index 00000000..ae8a73c9 > --- /dev/null > +++ b/test/tarantool-tests/profilers/misclib-memprof-lapi-default-file.test.lua > @@ -0,0 +1,37 @@ > +local tap = require('tap') > +local test = tap.test('misc-memprof-lapi-default-file'):skipcond({ > + ['Memprof is implemented for x86_64 only'] = jit.arch ~= 'x86' and > + jit.arch ~= 'x64', > + ['Memprof is disabled'] = os.getenv('LUAJIT_DISABLE_MEMPROF'), > +}) > + > +test:plan(1) > + > +local tools = require('utils.tools') > + > +test:test('default-output-file', function(subtest) > + > + subtest:plan(1) > + > + 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 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 > + > + local profile_buf = tools.read_file(default_output_file) > + subtest:ok(profile_buf ~= nil and #profile_buf ~= 0, > + 'default output file is not empty') > + > + -- We don't need it any more. > + os.remove(default_output_file) > +end) > + > +test:done(true) > -- > 2.43.0 > -- Best regards, Sergey Kaplun