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 D5F5113D1990; Thu, 5 Jun 2025 10:40:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D5F5113D1990 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1749109201; bh=45BbNM0oAGz0hzuq/SikFS9io1ZdR2A7x+OJP5NLHBc=; 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=sRu0AsJgu5Gk1u+dAVbDDm8e8RINGSt89JV19haJmq7jw7nTHbX4/PXzhoUbe1JRy 55Dk8mfHkuc3pwRjbGAasl996KPZnARSACqfBFUoF9No+tQZarvCtBW+fZy0U4iYEy 59ecV9h0OwvEWo98mjFVSurtMzjiFDC4uk8dsvOQ= Received: from send265.i.mail.ru (send265.i.mail.ru [95.163.59.104]) (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 5C581461F00 for ; Thu, 5 Jun 2025 10:40:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5C581461F00 Received: by exim-smtp-75656d46d5-kb4cr with esmtpa (envelope-from ) id 1uN5Ch-00000000Kva-29LM; Thu, 05 Jun 2025 10:39:59 +0300 Date: Thu, 5 Jun 2025 10:40:05 +0300 To: Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org Message-ID: References: <20250603173559.24591-1-skaplun@tarantool.org> <59b25b0e-7cfc-4e67-8716-403b2ca2713a@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59b25b0e-7cfc-4e67-8716-403b2ca2713a@tarantool.org> X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9851146C857904EAB613FDB37BFD686714F253024B8AAB5A3182A05F538085040861E4ED7958DC07A3DE06ABAFEAF6705CED3C7BC346D408F3A792B294C7B04A07C6799903D76029A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE727FD6E7FC3A8F857EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB5533756680FD86C7FE90CFE5867633929AB189C17469E50C11F284C53784C21E930097C0389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0DEC8C2C8BCD2534D8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6F459A8243F1D1D44CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB86D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE7D151390FFDBF6399731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5155579D03223CA735002B1117B3ED69607874174D50D43731BDDAE3D1EA49BEA823CB91A9FED034534781492E4B8EEADA3A806F356AF31D6 X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D3455049D7B43D89D64F762AA77A7D6CDD8549AA843EAB9927115D7441B5B6CA9F5D6C9ED7CA554A96B1D7E09C32AA3244C4ED59ACB8AE358CC77DD89D51EBB7742290E695EDF7DC5ADEA455F16B58544A2E30DDF7C44BCB90DA5AE236DF995FB59829709634694AABAED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVSykAyseJQ6/SOFfeWb9Zv4= X-DA7885C5: 0C58EACBBC631801F255D290C0D534F9844CA677DAAAEC142B736A8EADC7B031BDF129755D1BF2AA5B1A4C17EAA7BC4BEF2421ABFA55128DAF83EF9164C44C7E X-Mailru-Sender: 689FA8AB762F7393FE9E42A757851DB6FF1662AD2F0E37CE8C1B04CD53DF2CCDDF5F7635D427E5B0E49D44BB4BD9522A059A1ED8796F048DB274557F927329BE89D5A3BC2B10C37545BD1C3CC395C826B4A721A3011E896F X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] build: provide LUAJIT_USE_PERFTOOLS option 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 review! See my answers below. Fixed your comments regarding the commit message and force-pushed the branch. On 04.06.25, Sergey Bronnikov wrote: > Hi, Sergey, > > thanks for the patch! > > On 6/3/25 20:35, Sergey Kaplun wrote: > > This patch provides the LUAJIT_USE_PERFTOOLS flag via the CMake build > > system. It allows you to avoid the definition of the cognominal macro > > it's better to write impersonally: It allows avoiding the definition of ... > > Feel free to ignore. Rephrased as has been suggested. > > > > definition via CMAKE_C_FLAGS to use integration with the Linux perf > > tools interface [1] to resolve symbols for traces generated by a JIT. > > > > It may be used like the following: > > > > | perf record script -f luajit test.lua > > seems command is incorrect, because it does not work for me: Ooops. I forget that the `--force` flag has been removed [1]. Fixed. The resulting commit message is the following: | build: provide LUAJIT_USE_PERFTOOLS option | | This patch provides the LUAJIT_USE_PERFTOOLS flag via the CMake build | system. It allows avoiding the definition of the cognominal macro | definition via CMAKE_C_FLAGS to use integration with the Linux perf | tools interface [1] to resolve symbols for traces generated by a JIT. | | It may be used like the following: | | | perf record script luajit test.lua | | perf report -s symbol | | [1]: https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt | | Resolves tarantool/tarantool#11300 > > > > script: unexpected number of arguments > Try 'script --help' for more information. > > > I've used instead: > > $ sudo perf record -F 2000 ./build/src/luajit fib.lua > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.024 MB perf.data (8 samples) ] > > > | perf report -s symbol > > > and "perf report /tmp/perf-1699839.map" to check that luajit report > symbols in map file. Don't get this part. > > Branch:https://github.com/tarantool/luajit/tree/skaplun/gh-11300-use-perftools-flag > > Issue:https://github.com/tarantool/tarantool/issues/11300 > > > > CMakeLists.txt | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/CMakeLists.txt b/CMakeLists.txt > > index 854b3613..c0da4362 100644 > > --- a/CMakeLists.txt > > +++ b/CMakeLists.txt > > @@ -259,6 +259,14 @@ if(LUAJIT_USE_VALGRIND) > > AppendFlags(TARGET_C_FLAGS -DLUAJIT_USE_VALGRIND) > > endif() > > > > +# This creates a symbol table of the JIT-compiled code in > > +# a (%d = pid of process) file. It should be > > +# used with Linux perf tools. See for details. > > +option(LUAJIT_USE_PERFTOOLS "Linux perf JIT support" OFF) > > +if(LUAJIT_USE_PERFTOOLS) > > + AppendFlags(TARGET_C_FLAGS -DLUAJIT_USE_PERFTOOLS) > > +endif() > > Adding a CMake flag means that we support it in our fork (users will > rely on this functionality). > > Do want a regression test for this option? I've honestly don't see a way to conveniently check for it, and it looks like overkill for now (since its functionality is rather frugal). Moreover, perf annotate is not working as expected with that. I'm glad to hear any ideas of yours about it. > > > + > > # This is the client for the GDB JIT API. GDB 7.0 or higher is > > # required to make use of it. See lj_gdbjit.c for details. > > # Enabling this causes a non-negligible overhead, even when not [1]: http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=4a4d371a4dfbd3b84a7eab8d535d4c7c3647b09e -- Best regards, Sergey Kaplun