From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <estetus@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit 3/3] sysprof: fix a message with stop without run
Date: Wed, 5 Mar 2025 17:52:53 +0300 [thread overview]
Message-ID: <Z8hlRRm2n2m3r8m3@root> (raw)
In-Reply-To: <ff864572c8acae3a58379fd3175acc4dadecbc41.1740468394.git.sergeyb@tarantool.org>
Hi, Sergey!
Thanks for the patch!
LGTM, with a few nits regarding the commit message and 1 ignorable
comment to the code style.
On 25.02.25, Sergey Bronnikov wrote:
> The function `misc.sysprof.stop()` reports that profiler is
Typo: s/profiler/the profiler/
> already running:
>
> | $ ./src/luajit -e 'print(misc.sysprof.stop())'
> | nil profiler is running already 22
>
> both in `sysprof_error()` and fixes aforementioned problem.
Don't get this sentence.
Typo: s/aforementioned/the aforementioned/
>
> Follows up tarantool/tarantool#781
> ---
> src/lib_misc.c | 6 ++++++
> .../tarantool-tests/profilers/misclib-sysprof-lapi.test.lua | 5 +++--
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/lib_misc.c b/src/lib_misc.c
> index c4b40996..74888d20 100644
> --- a/src/lib_misc.c
> +++ b/src/lib_misc.c
> @@ -335,6 +335,12 @@ LJLIB_CF(misc_sysprof_stop)
> return prof_error(L, PROFILE_ERRUSE, err_details);
> #else
> int status = luaM_sysprof_stop(L);
> + if (LJ_UNLIKELY(status == PROFILE_ERRRUN)) {
> + lua_pushnil(L);
> + lua_pushstring(L, err2msg(LJ_ERR_PROF_NOTRUNNING));
> + lua_pushinteger(L, EINVAL);
> + return 3;
> + }
> if (LJ_UNLIKELY(status != PROFILE_SUCCESS))
It looks like more natural now to use else if here now.
> return prof_error(L, status, NULL);
>
> diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
> index ebd80cf6..770b5736 100644
> --- a/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
> +++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi.test.lua
<snipped>
> --
> 2.43.0
>
--
Best regards,
Sergey Kaplun
next prev parent reply other threads:[~2025-03-05 14:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 7:32 [Tarantool-patches] [PATCH luajit 0/3] Fix sysprof error on stop not started sysprof Sergey Bronnikov via Tarantool-patches
2025-02-25 7:32 ` [Tarantool-patches] [PATCH luajit 1/3] sysprof: rename sysprof_error to prof_error Sergey Bronnikov via Tarantool-patches
2025-03-05 14:28 ` Sergey Kaplun via Tarantool-patches
2025-02-25 7:32 ` [Tarantool-patches] [PATCH luajit 2/3] misc: use prof_error for handling errors Sergey Bronnikov via Tarantool-patches
2025-03-05 14:49 ` Sergey Kaplun via Tarantool-patches
2025-03-06 16:04 ` Sergey Bronnikov via Tarantool-patches
2025-02-25 7:32 ` [Tarantool-patches] [PATCH luajit 3/3] sysprof: fix a message with stop without run Sergey Bronnikov via Tarantool-patches
2025-03-05 14:52 ` Sergey Kaplun via Tarantool-patches [this message]
2025-03-06 15:18 ` Sergey Bronnikov via Tarantool-patches
2025-03-12 11:11 ` [Tarantool-patches] [PATCH luajit 0/3] Fix sysprof error on stop not started sysprof Sergey Kaplun via Tarantool-patches
2025-03-06 16:18 Sergey Bronnikov via Tarantool-patches
2025-03-06 16:19 ` [Tarantool-patches] [PATCH luajit 3/3] sysprof: fix a message with stop without run Sergey Bronnikov via Tarantool-patches
2025-03-07 7:21 ` Sergey Kaplun via Tarantool-patches
2025-03-07 10:44 ` Sergey Bronnikov 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=Z8hlRRm2n2m3r8m3@root \
--to=tarantool-patches@dev.tarantool.org \
--cc=estetus@gmail.com \
--cc=skaplun@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH luajit 3/3] sysprof: fix a message with stop without run' \
/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