Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top
@ 2020-10-06 18:59 Sergey Kaplun
  2020-10-07  8:28 ` Serge Petrenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sergey Kaplun @ 2020-10-06 18:59 UTC (permalink / raw)
  To: Alexander Turenko, Serge Petrenko; +Cc: tarantool-patches

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top
  2020-10-06 18:59 [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top Sergey Kaplun
@ 2020-10-07  8:28 ` Serge Petrenko
  2020-10-07  9:08 ` Alexander Turenko
  2020-10-07 13:33 ` Kirill Yukhin
  2 siblings, 0 replies; 4+ messages in thread
From: Serge Petrenko @ 2020-10-07  8:28 UTC (permalink / raw)
  To: Sergey Kaplun, Alexander Turenko; +Cc: tarantool-patches


06.10.2020 21:59, Sergey Kaplun пишет:
> 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 */


Hi! Thanks for the patch!
LGTM.

>   
>   	lua_pushliteral(L, "memory");
>   	lua_newtable(L);

-- 
Serge Petrenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top
  2020-10-06 18:59 [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top Sergey Kaplun
  2020-10-07  8:28 ` Serge Petrenko
@ 2020-10-07  9:08 ` Alexander Turenko
  2020-10-07 13:33 ` Kirill Yukhin
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Turenko @ 2020-10-07  9:08 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: tarantool-patches

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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top
  2020-10-06 18:59 [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top Sergey Kaplun
  2020-10-07  8:28 ` Serge Petrenko
  2020-10-07  9:08 ` Alexander Turenko
@ 2020-10-07 13:33 ` Kirill Yukhin
  2 siblings, 0 replies; 4+ messages in thread
From: Kirill Yukhin @ 2020-10-07 13:33 UTC (permalink / raw)
  To: Sergey Kaplun; +Cc: tarantool-patches, Alexander Turenko

Hello,

On 06 окт 21:59, 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

I've checked your patch into 2.4, 2.5 and master.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-07 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 18:59 [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top Sergey Kaplun
2020-10-07  8:28 ` Serge Petrenko
2020-10-07  9:08 ` Alexander Turenko
2020-10-07 13:33 ` Kirill Yukhin

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