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 338E46EC40; Mon, 5 Jul 2021 12:49:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 338E46EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1625478552; bh=kyNYJSY7XwKSZfkQfLoacAxCRmwqq9Zf+llkmBdeDkQ=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=zCAt4efNla0DsztJRQQ4rPvwNP0g10/3LDG4pR1AJWBwk2VOOyYEwSaWoKmuaROFW DIjLqI9GD/K0uMi0rAel0wBkALU1QkvRPGLwIo/0o5rAVWakurDjZAySMXD5jA1uKO PgyrzEH7G17KWPUTekx2nGi0WhTiLjC+XZgEPXzQ= Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 F2AD26EC40 for ; Mon, 5 Jul 2021 12:49:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org F2AD26EC40 Received: by mail-lj1-f170.google.com with SMTP id t30so3899752ljo.5 for ; Mon, 05 Jul 2021 02:49:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rhHfzDYAyUZ5ISCvpwY8x2o8mOYu3Q8U/CgVkYP1JWM=; b=WahQEsixFcUVJZakGf21C6zr3TDOLXVmeRj8Eyj5qgKo1FR63ShGwMWwsQ34BjdwDl XmR+/LXCmFONDQhg5RfsJUh3+XZrPKgDN3xvgateKxQdcQHq8JVcovH3Sk7BcyGS4OJm PXrlfSsizLzezeBIVbzKcpYdIz3Tul2FCrZfF3xx5MSja+nr3eqem7A0Zl2GlPP+Y4J8 vp6kExqrc8/Hss3F2dEvlBVEYx0hr3AWx8j8/6g6AMgrHlzLmtKaqjsSeDRKP22Zvsc2 3eaUlQ+EPdHfmcWT01dwN2qcfqsdGEZCDJTMPgVHALfWmtDLy/cN4nuGBxYy34nWXm90 VHDw== X-Gm-Message-State: AOAM532Hq2SKexNtkv+ULLDHt2XqTbpLCeqqi8umgEEO8qe0GVzexuQw 6/rMAXGKM0W0CHsC2BrQGQ+5vB/vzP4= X-Google-Smtp-Source: ABdhPJzyZZQlY+uzlYtHDy92s+XIZhkAN5T/79lVsPAb6slVlLrplCXNZoQcA2eAlMLYVXr0Q5FdZA== X-Received: by 2002:a05:651c:c7:: with SMTP id 7mr10538196ljr.101.1625478549889; Mon, 05 Jul 2021 02:49:09 -0700 (PDT) Received: from grain.localdomain ([5.18.199.94]) by smtp.gmail.com with ESMTPSA id d24sm1032067lfa.243.2021.07.05.02.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 02:49:08 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 064C15A001F; Mon, 5 Jul 2021 12:49:07 +0300 (MSK) Date: Mon, 5 Jul 2021 12:49:07 +0300 To: Egor Elchinov via Tarantool-patches Message-ID: References: <202247f05706af029e37cff627542cc4d6dda4f7.1625170992.git.elchinov.es@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202247f05706af029e37cff627542cc4d6dda4f7.1625170992.git.elchinov.es@gmail.com> User-Agent: Mutt/2.0.7 (2021-05-04) 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: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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). > @@ -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?