From: Sergey Kaplun <skaplun@tarantool.org> To: Alexander Turenko <alexander.turenko@tarantool.org>, Serge Petrenko <sergepetrenko@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top Date: Tue, 6 Oct 2020 21:59:42 +0300 [thread overview] Message-ID: <20201006185942.19266-1-skaplun@tarantool.org> (raw) 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
next reply other threads:[~2020-10-06 19:00 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-06 18:59 Sergey Kaplun [this message] 2020-10-07 8:28 ` Serge Petrenko 2020-10-07 9:08 ` Alexander Turenko 2020-10-07 13:33 ` Kirill Yukhin
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=20201006185942.19266-1-skaplun@tarantool.org \ --to=skaplun@tarantool.org \ --cc=alexander.turenko@tarantool.org \ --cc=sergepetrenko@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH] fiber: fix build for disabled fiber top' \ /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