[Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top

Alexander Turenko alexander.turenko at tarantool.org
Wed Oct 7 12:08:19 MSK 2020


LGTM.

WBR, Alexander Turenko.

On Tue, Oct 06, 2020 at 09:59:42PM +0300, Sergey Kaplun wrote:
> In case when we build without `ENABLE_FIBER_TOP` neither
> `struct fiber` contains `clock_stat` field nor `FIBER_TIME_RES`
> constant is defined.
> This patch adds corresponding ifdef directive to avoid compilation
> errors.
> ---
> 
> Branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-noticket-lua-fiber-fix-build-for-disabled-fiber-top
> 
>  src/lua/fiber.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/lua/fiber.c b/src/lua/fiber.c
> index efb0a4921..edbd06ebc 100644
> --- a/src/lua/fiber.c
> +++ b/src/lua/fiber.c
> @@ -282,9 +282,11 @@ lbox_fiber_statof(struct fiber *f, void *cb_ctx, bool backtrace)
>  	lua_pushnumber(L, f->csw);
>  	lua_settable(L, -3);
>  
> +#if ENABLE_FIBER_TOP
>  	lua_pushliteral(L, "time");
>  	lua_pushnumber(L, f->clock_stat.cputime / (double) FIBER_TIME_RES);
>  	lua_settable(L, -3);
> +#endif /* ENABLE_FIBER_TOP */
>  
>  	lua_pushliteral(L, "memory");
>  	lua_newtable(L);
> -- 
> 2.28.0
> 


More information about the Tarantool-patches mailing list