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 BB6C913DAB30; Wed, 4 Jun 2025 11:35:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BB6C913DAB30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1749026114; bh=hmjYD80aQsy3zMclPzldj/MAcUCt5oEKF7pu5etH86o=; 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=aZPQ11oQZ6VAHfh8uUxt6FJA85hx7Dr0Ltw3yQovD+gC+Vek3sCMr0dH/Unc9eimS tgYPcB93m8zufylAm9iJZ/1Z+39RW00Zt7/z8eA8sMao2IfElWXIicC9twhyNZ9E+4 NJz4zWsAbubITdCDdmkRR6qNyW1jj/3ABLjjb6w4= Received: from send80.i.mail.ru (send80.i.mail.ru [89.221.237.175]) (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 B85495CB586 for ; Wed, 4 Jun 2025 11:35:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B85495CB586 Received: by exim-smtp-75656d46d5-7cn68 with esmtpa (envelope-from ) id 1uMjaZ-00000000W6f-279t; Wed, 04 Jun 2025 11:35:11 +0300 Date: Wed, 4 Jun 2025 11:35:17 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <6aefeed4eee55e77e7c79ac9b31c284b014d2c7a.1747399055.git.sergeyb@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6aefeed4eee55e77e7c79ac9b31c284b014d2c7a.1747399055.git.sergeyb@tarantool.org> X-Mailru-Src: smtp X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9851146C857904EAB613FDB37BFD686714F253024B8AAB5A3182A05F53808504033D0A6D6EBC846463DE06ABAFEAF6705218B8C07290CA1F764D29123B1398864B9E10611ADFA1AB1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F4E79F226F99D4DDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375662BC6C8E92A5ED823555C8820F0B7F67469959B17AB5B60845826D97529D1A404389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE76515C59FC18CEA6D731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A58EA9750A7EB26B9D5002B1117B3ED6966A84A2808D56A6F619AC5B239BAD4335823CB91A9FED034534781492E4B8EEADA3FB0D9844EF8EC5BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742DC8270968E61249B1004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D347798CB24D8990473FF724A3875C6E5810192D3197ED13BA2C126FDD020E9BDB175970E1BC0A331481D7E09C32AA3244CECF77A711E85518577DD89D51EBB77427F97DC2220F87A41EA455F16B58544A2E30DDF7C44BCB90DA5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVSykAyseJQ6/gChzURnqTBs= X-DA7885C5: 41FFE730D8390A8CF255D290C0D534F93F7E6BCA177F5ED245A37AD53DD56F2BF8DD1C4AFED41AC15B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393FE9E42A757851DB6410733D52E36CBD4D687C7B913F8206C5A48AAD90BBAFFDAE49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit][v1] sysprof: allow calling sysprof.report before stopping 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! Thanks for the patch! LGTM, with minor comments below. On 16.05.25, Sergey Bronnikov wrote: > It is not allowed to call a function `sysprof.report()` without > stopping profiler. However, sometimes it may be useful to analyze Typo: s/profiler/the profiler/ > numbers provided by the report without stopping the profiler. The > patch removes the appropriate condition and allows reporting > without stopping. > > Resolves tarantool/tarantool#11229 > --- > Branch: https://github.com/tarantool/luajit/tree/ligurio/gh-11229-misc.sysprof.report > Issue: https://github.com/tarantool/tarantool/issues/11229 > > src/lj_sysprof.c | 2 -- > .../profilers/misclib-sysprof-lapi.test.lua | 18 ++++++++++++++++-- > 2 files changed, 16 insertions(+), 4 deletions(-) > > diff --git a/src/lj_sysprof.c b/src/lj_sysprof.c > index 88c7a41b..cf6161a5 100644 > --- a/src/lj_sysprof.c > +++ b/src/lj_sysprof.c > diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua > index f316c390..3e774a53 100644 > --- a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua > +++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua > @@ -166,13 +166,27 @@ test:is(err, nil, "no error with good interval 1") > test:is(errno, nil, "no errno with good interval 1") > misc.sysprof.stop() > > +-- Intermediate sysprof.report(). > +res, err, errno = misc.sysprof.start{ > + mode = "C", I suppose we don't need to run the profiler in "C" mode. Let's use "D" here. > + interval = 1, > + path = "/dev/null", > +} > +test:is(res, true, "res is correct") > +test:is(err, nil, "no error") > +test:is(errno, nil, "no errno") I suppose that 2 last checks are excess. The first one is enough to be sure that the profiler is started. Also, we may use `assert()` here instead of `test:is()` check, since we don't want to _test_ the starting of the profiler only to _assert_ that the sysprof has been started. > + > +local report = misc.sysprof.report() > +test:ok(report.samples == 0, "total number of samples is non-zero") I'm not sure that this will always be true (for example, in coverage workflow). I suggest increasing the interval dramatically to avoid false positives here. > +misc.sysprof.stop() > + > 2.43.0 > -- Best regards, Sergey Kaplun