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 6870A6EC55; Fri, 9 Jul 2021 12:50:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6870A6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625824242; bh=72BMwFtNTjM9QBOG/NnXfbD56g5KjVmbTirR+qDrMIo=; h=To:References:Cc:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=F+r+zb+Wlc1gYC5Xq8BokNAoEOzwt11I0rlQl3padMgf7B4nNABNBbOnk+DvxEaZz aM2DZdXxBeR27ZQ/Sr1gEgGrVvz24ghrhvMb7Yytzw7xeGMtJsmyPbc0sdOpzPBbAZ 49tegRgHcyTOApnqurJj5VF5L7374RnDtpr+yg5U= Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 492096EC55 for ; Fri, 9 Jul 2021 12:50:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 492096EC55 Received: by smtp29.i.mail.ru with esmtpa (envelope-from ) id 1m1n9c-0006ZW-PZ; Fri, 09 Jul 2021 12:50:41 +0300 To: Cyrill Gorcunov References: <202247f05706af029e37cff627542cc4d6dda4f7.1625170992.git.elchinov.es@gmail.com> Cc: tarantool-patches@dev.tarantool.org Message-ID: <39ad0898-6d05-227c-adda-dcb50e6ec573@tarantool.org> Date: Fri, 9 Jul 2021 12:50:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FBE6FDDB4BD448567E879352FD8EC4AF74182A05F538085040F253D3F1E0446A73AB1B7F29E9FF56D8F60FC4A2E8FFC78E8D97D05E6C40B32F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE782A779A89F7D69B2C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE76C0A440987CA342D8F08D7030A58E5AD1A62830130A00468AEEEE3FBA3A834EE7353EFBB5533756644FE9905A23AFB609653B3A4A628092759ECA5664225AFE1A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE71AE4D56B06699BBC9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C34964A708C60C975A117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CFE2AA67B9FE6907BDBA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B6C2DE32F7C1AA431B76E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7C747589E6AAA3516243847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5981D0F18EF57459AB7D1AE605C16754CCE0536095E142EE8D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753753CEE10E4ED4A7410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34BC3EEE75EF3BACCFD03C78FCB99BCC2E3B6F1CD6FB882D2A5D3EE68111B2B6CFA0163706FBCF0F0F1D7E09C32AA3244CBEF03304B601C47B0F7DDEE87022FBA763871F383B54D9B3729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojR+u4utVEKRz+lseTIgdG3g== X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76995EC722606F0323EAB1B7F29E9FF56D86ECF975C7BB2667F58570E9BDA2331C06F53C80213D1719C2C26F88BABE1618CA23003C376F5F1387402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 5/7] fiber: add dynamic option for parent backtrace 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: Egor Elchinov via Tarantool-patches Reply-To: Egor Elchinov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for the review! On 05.07.2021 12:49, Cyrill Gorcunov via Tarantool-patches wrote: > On Thu, Jul 01, 2021 at 11:24:43PM +0300, Egor Elchinov via Tarantool-patches wrote: >> diff --git a/src/lua/fiber.c b/src/lua/fiber.c >> index 026e30bc6..fe01ae23b 100644 >> --- a/src/lua/fiber.c >> +++ b/src/lua/fiber.c >> @@ -205,7 +205,7 @@ struct lua_parent_tb_ctx { >> int tb_frame; >> }; >> >> -#ifdef ENABLE_BACKTRACE >> +#if ENABLE_BACKTRACE > > Please don't squash unrelated changes into the patch. If you prefer > to shange #ifdef to #if better make it as a separate commit (though > I don't understand yet what is wrong with existing code) Changes rebased into refactoring commit. I believe this is more conventional way to check the ENABLE_BACKTRACE option because it is defined as #cmakedefine ENABLE_BACKTRACE 1 but not #cmakedefine ENABLE_BACKTRACE > >> @@ -446,15 +446,18 @@ lbox_fiber_statof_map(struct fiber *f, void *cb_ctx, bool backtrace) >> f != fiber() ? &f->ctx : NULL, &tb_ctx); >> lua_settable(L, -3); >> >> - parent_tb_ctx.L = L; >> - parent_tb_ctx.bt = f->storage.lua.parent_bt; >> - parent_tb_ctx.tb_frame = 0; >> - lua_pushstring(L, "backtrace_parent"); >> - lua_newtable(L); >> - backtrace_foreach_ip(fiber_parent_backtrace_cb, >> - f->parent_bt_ip_buf, >> - FIBER_PARENT_BT_MAX, &parent_tb_ctx); >> - lua_settable(L, -3); >> + if (fiber_parent_bt_is_enabled()) { >> + parent_tb_ctx.L = L; >> + parent_tb_ctx.bt = f->storage.lua.parent_bt; >> + parent_tb_ctx.tb_frame = 0; >> + lua_pushstring(L, "backtrace_parent"); >> + lua_newtable(L); >> + backtrace_foreach_ip(fiber_parent_backtrace_cb, >> + f->parent_bt_ip_buf, >> + FIBER_PARENT_BT_MAX, >> + &parent_tb_ctx); >> + lua_settable(L, -3); >> + } > > Maybe it would worth to merge fiber_parent_bt_is_enabled option immediately > into previous patch? > Merged.