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 9D9FC13E37BE; Wed, 4 Jun 2025 16:31:16 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9D9FC13E37BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1749043876; bh=/8jbs2iWVpunw/Hj9ylXBoKnzRWl1O754soYPtdVmlQ=; 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=XiVpoJIRHyinn0D1OqPxHbLkIzg/HSe8vVBDjQ6lWxObjR2faJJk19SYHR3DF66l1 klGmUR4uPklB70E4GaDqk6Sg15U+PYZz7DAd8FpDCJFW3MnScQCHgYpLUqTtmuKIH5 27sRA+K3hr43KHRDUrjm3a9lb6O+zJY/G0b8sjS0= 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 F00BD13E37BE for ; Wed, 4 Jun 2025 16:31:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F00BD13E37BE Received: by exim-smtp-75656d46d5-5qhtk with esmtpa (envelope-from ) id 1uMoD4-000000006R0-3fSQ; Wed, 04 Jun 2025 16:31:15 +0300 Content-Type: multipart/alternative; boundary="------------1cF2cU7W28bjsVTcKmFojnHN" Message-ID: <80c1d4a5-c987-470d-a088-a57ebcfe1033@tarantool.org> Date: Wed, 4 Jun 2025 16:31:14 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Sergey Kaplun Cc: Sergey Bronnikov , tarantool-patches@dev.tarantool.org References: <6aefeed4eee55e77e7c79ac9b31c284b014d2c7a.1747399055.git.sergeyb@tarantool.org> Content-Language: en-US In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9851146C857904EAB6AAF53D673F40B43EDF29C2403E20A1F182A05F5380850404CBFBCE8CF11DBCF3DE06ABAFEAF6705C3ECEE0DB9A84A252E8253CE9128B91643DCCEE5F6362163 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C4A7E4C0BFE8628DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375662BC6C8E92A5ED8231AC95C02D9BAD6D1976A7E2428F287031A8EF5BAE59B0A26389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B636DA1BED736F9328CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224958C1606C78F2434E76E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8B6A4E49BB0F3BA1413AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735C8D5298E42E60C1FC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5461DDB4C8A2AEB5E5002B1117B3ED696365CCA8828AEEE93B74D9144D44E4FCF823CB91A9FED034534781492E4B8EEAD528DE7AA5F2BD788BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D34A246DFF68F0EE19EC2D6E512A733EE87FDB4F0EB463356C934D32F236060161DA7F4930ED2EF90521D7E09C32AA3244CDD4AF27B6FCA7ACA77DD89D51EBB77423480FA3A346D76C4EA455F16B58544A2557BDE0DD54B3590A5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVSykAyseJQ6/soyzLklzwIQ= X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D614036F84AE50AFBE53E2EB5D77EF37489D1EA6D87E9E9516F410152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------1cF2cU7W28bjsVTcKmFojnHN Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, Sergey, On 6/4/25 16:13, Sergey Kaplun wrote: >>>> + 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. >>> >> last two checks were removed andtest:is() replaced with assert() > I would rather use > | assert(misc.sysprof.start({...}) > and > | assert(misc.sysprof.stop()) > instead, for simplicity and to avoid the irrelevant local variables. > > Feel free to ignore. Fixed. >>>> + >>>> +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. >> Updated. > Side note: Checking the non-0 samples for default payload instead. > >>>> +misc.sysprof.stop() >>>> + >>> >>> >>>> 2.43.0 >>>> --------------1cF2cU7W28bjsVTcKmFojnHN Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hello, Sergey,

On 6/4/25 16:13, Sergey Kaplun wrote:


<snipped>


          
+    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.

last two checks were removed and test:is() replaced with assert()
I would rather use
| assert(misc.sysprof.start({...})
and
| assert(misc.sysprof.stop())
instead, for simplicity and to avoid the irrelevant local variables.

Feel free to ignore.
Fixed.

      
+
+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.
Updated.
Side note: Checking the non-0 samples for default payload instead.

+misc.sysprof.stop()
+
<snipped>

2.43.0


    
--------------1cF2cU7W28bjsVTcKmFojnHN--