[Tarantool-patches] [PATCH luajit 3/3] sysprof: fix a message with stop without run
Sergey Kaplun
skaplun at tarantool.org
Fri Mar 7 10:21:44 MSK 2025
Hi, Sergey!
Thanks for the fixes!
LGTM, with 2 minor comments below.
On 06.03.25, Sergey Bronnikov wrote:
> When sysprof is not started the function `misc.sysprof.stop()`
Typo: s/started/started,/
> reports that the profiler is already running:
>
> | $ ./src/luajit -e 'print(misc.sysprof.stop())'
> | nil profiler is running already 22
>
> The patch fixes that:
>
> | $ ./src/luajit -e 'print(misc.sysprof.stop())'
> | nil profiler is not running 22
>
> Follows up tarantool/tarantool#781
> ---
<snipped>
> + 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 91ea461b..f316c390 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
More information about the Tarantool-patches
mailing list