Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Egor Elchinov via Tarantool-patches
	<tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 5/7] fiber: add dynamic option for parent backtrace
Date: Mon, 5 Jul 2021 12:49:07 +0300	[thread overview]
Message-ID: <YOLVk7FDEYduEzUm@grain> (raw)
In-Reply-To: <202247f05706af029e37cff627542cc4d6dda4f7.1625170992.git.elchinov.es@gmail.com>

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?

  reply	other threads:[~2021-07-05  9:49 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 [this message]
2021-07-09  9:50     ` Egor Elchinov via Tarantool-patches
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=YOLVk7FDEYduEzUm@grain \
    --to=tarantool-patches@dev.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