From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp16.mail.ru (smtp16.mail.ru [94.100.176.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 003EF469719 for ; Wed, 7 Oct 2020 11:28:27 +0300 (MSK) References: <20201006185942.19266-1-skaplun@tarantool.org> From: Serge Petrenko Message-ID: Date: Wed, 7 Oct 2020 11:28:26 +0300 MIME-Version: 1.0 In-Reply-To: <20201006185942.19266-1-skaplun@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sergey Kaplun , Alexander Turenko Cc: tarantool-patches@dev.tarantool.org 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