Tarantool development patches archive
 help / color / mirror / Atom feed
From: Egor Elchinov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 5/7] fiber: add dynamic option for parent backtrace
Date: Fri, 9 Jul 2021 12:50:40 +0300	[thread overview]
Message-ID: <39ad0898-6d05-227c-adda-dcb50e6ec573@tarantool.org> (raw)
In-Reply-To: <YOLVk7FDEYduEzUm@grain>

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.

  reply	other threads:[~2021-07-09  9:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 20:24 [Tarantool-patches] [PATCH 0/7] fiber: introduce creation backtrace Egor Elchinov via Tarantool-patches
2021-07-01 20:24 ` [Tarantool-patches] [PATCH 1/7] fiber: add PoC for fiber " Egor Elchinov via Tarantool-patches
2021-07-01 20:44   ` Egor Elchinov via Tarantool-patches
2021-07-02  7:00   ` Egor Elchinov via Tarantool-patches
2021-07-02  7:11   ` [Tarantool-patches] [PATCH v2 " Egor Elchinov via Tarantool-patches
2021-07-01 20:24 ` [Tarantool-patches] [PATCH 2/7] fiber: fix DARWIN build Egor Elchinov via Tarantool-patches
2021-07-01 20:24 ` [Tarantool-patches] [PATCH 3/7] fiber: apply fix patch Egor Elchinov via Tarantool-patches
2021-07-05  9:42   ` Cyrill Gorcunov via Tarantool-patches
2021-07-09  9:32     ` Egor Elchinov via Tarantool-patches
2021-07-01 20:24 ` [Tarantool-patches] [PATCH 4/7] fiber: add PoC for Lua parent backtrace Egor Elchinov via Tarantool-patches
2021-07-01 20:24 ` [Tarantool-patches] [PATCH 5/7] fiber: add dynamic option for " Egor Elchinov via Tarantool-patches
2021-07-05  9:49   ` Cyrill Gorcunov via Tarantool-patches
2021-07-09  9:50     ` Egor Elchinov via Tarantool-patches [this message]
2021-07-09 10:10       ` Cyrill Gorcunov via Tarantool-patches
2021-07-01 20:24 ` [Tarantool-patches] [PATCH 6/7] fiber: refactor lua backtrace routine Egor Elchinov via Tarantool-patches
2021-07-01 20:24 ` [Tarantool-patches] [PATCH 7/7] fiber: refactor C backtrace and add changelog Egor Elchinov via Tarantool-patches
  -- strict thread matches above, loose matches on Subject: below --
2021-07-01 15:54 [Tarantool-patches] [PATCH 0/7] fiber: introduce creation backtrace Egor Elchinov via Tarantool-patches
2021-07-01 15:54 ` [Tarantool-patches] [PATCH 5/7] fiber: add dynamic option for parent backtrace Egor Elchinov via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39ad0898-6d05-227c-adda-dcb50e6ec573@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=eelchinov@tarantool.org \
    --cc=gorcunov@gmail.com \
    --subject='Re: [Tarantool-patches] [PATCH 5/7] fiber: add dynamic option for parent backtrace' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox