From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 610B2A4C300; Wed, 19 Feb 2025 15:53:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 610B2A4C300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1739969587; bh=vRvqtWluyaK0f6UDQybYSueq8WK4m/SOc3SFo3HOrzY=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=BfOhFbXBdnpJ3+h3N+ixdZ1swKxGKmSv42Xk3iXKgjfd9XYK8WWKWYOX+Hq5cdH6R S4folLsJcKV6fIxs1oXF6JgtMQJH5zQIw2T5GW7uaEwD0t+oIiPTIsA8rtFvaq7QmC D8vVnHsUrxUExK8S8DbuID6xqQn+ZBBbEZbedfxQ= Received: from send264.i.mail.ru (send264.i.mail.ru [95.163.59.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7E055A4C300 for ; Wed, 19 Feb 2025 15:53:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7E055A4C300 Received: by exim-smtp-5f589487f8-zl59h with esmtpa (envelope-from ) id 1tkjZZ-00000000SZu-0ssH; Wed, 19 Feb 2025 15:53:05 +0300 Content-Type: multipart/alternative; boundary="------------vPU7aSze5QtGsu1OplknNfnN" Message-ID: <73448ddd-5b78-4e89-a45b-0407fca1396f@tarantool.org> Date: Wed, 19 Feb 2025 15:53:05 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Sergey Bronnikov Cc: tarantool-patches@dev.tarantool.org References: <7f83ca101b76bba7b5789a6c5a7e9acb8044fed1.1739444510.git.sergeyb@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD916C41472748AFA04BC6EC4D9B4475EA3A2EBA8C4D08F9F5A00894C459B0CD1B9FB69ED056A1EA161EDF1CDDB2C83CE5645ABCA7BFDA2308B47BE3AD88F63F712E8A5C135F8BDED31 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C6068CE86C2B75F5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637F63E14183F8C6AF98638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8C0664D2C86861350F86C4B9BF76994549265E0C60A11A5DFCC7F00164DA146DAFE8445B8C89999728AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC821E93C0F2A571C7BF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C2D01283D1ACF37BA302FCEF25BFAB3454AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C31DD302B0B79430F8BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE77DCDFB3399A2F72843847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5228A92D0089F47C15002B1117B3ED696379C668246C9494BC638DF663A625AFA823CB91A9FED034534781492E4B8EEAD2B25D9E4C92BC8ACBDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFD46C9ECB300560854B164B01F44DB79CC8F5ED43CCBB4D84B846D09EF013BED7C6BFA615E6C3782A0526A8B1FD8BF66B16FFBB86A4AD9B7779F80882071F73994EE6C3B96FC1738A5F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVWiyXSWEEqdrVFKWegnC24E= X-Mailru-Sender: 520A125C2F17F0B1E52FEF5D219D6140FB69ED056A1EA161EDF1CDDB2C83CE564B9CDE84E2C511770152A3D17938EB451EB5A0BCEC6A560B3DDE9B364B0DF289BE2DA36745F2EEB5CEBA01FB949A1F1EEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 6/7] misc: specific message for disabled profilers X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------vPU7aSze5QtGsu1OplknNfnN Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi, Sergey, thanks for review! On 19.02.2025 11:06, Sergey Kaplun via Tarantool-patches wrote: > Hi, Sergey! > Thanks for the patch! > LGTM, after fixing minor nits below. > > On 13.02.25, Sergey Bronnikov wrote: >> sysprof and memprof Lua API functions returns an error message > Typo: s/returns/return/ Fixed. > >> "profiler misuse", when appropriate profiler is disabled in build. > Typo: s/appropriate/the corresponding/ > Typo: s/build/the build/ Fixed. > >> It is not possible to easily distinquish whether it is really > Typo: s/distinquish/distinguish/ Fixed. > >> misuse or profiler was not enabled in build. The patch changes > Typo: s/profiler/or if the profiler/ > Typo: s/build/the build/ Fixed. > >> errors messages, so when profiler was not enabled in build message > Typo: s/errors/error/ > Typo: s/profiler/a profiler/ > Typo: s/was/is/ > Typo: s/in build message/in the build, the message/ Fixed. > >> is the following: "profiler misuse: profiler is disabled". >> --- >> src/lib_misc.c | 27 ++++++++++++++++- >> src/lj_errmsg.h | 1 + >> .../misclib-memprof-lapi-disabled.test.lua | 22 ++++++++++++++ >> .../misclib-sysprof-lapi-disabled.test.lua | 29 +++++++++++++++++++ >> 4 files changed, 78 insertions(+), 1 deletion(-) >> create mode 100644 test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua >> create mode 100644 test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua >> >> diff --git a/src/lib_misc.c b/src/lib_misc.c >> index d71904e4..7666d85f 100644 >> --- a/src/lib_misc.c >> +++ b/src/lib_misc.c >> @@ -315,10 +315,15 @@ static int sysprof_error(lua_State *L, int status, const char *err_details) >> /* local res, err, errno = sysprof.start(options) */ >> LJLIB_CF(misc_sysprof_start) >> { >> + const char *err_details = NULL; >> +#if !LJ_HASSYSPROF > It's more LuaJIT-way to use something like the following: > | if (!LJ_HASSYSPROF) { > | /* ... */ > | } > > This helps to avoid strange early return. Fixed. > Also, please be avaired to declare all variables (stataus, opt, > err_details) in the beginning of the block.  It is a requirement for the code that strictly follows c89, when you must declare all of your variables at the beginning of a scope block. AFAIK, we have no such requirement, and also there is no option "-std=c89" in CI and no any mentions in the contribution guide. > > Here and below. > >> + err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED); >> + return sysprof_error(L, PROFILE_ERRUSE, err_details); >> +#endif /* !LJ_HASSYSPROF */ >> + >> int status = PROFILE_SUCCESS; >> >> struct luam_Sysprof_Options opt = {}; >> - const char *err_details = NULL; >> >> status = parse_sysprof_opts(L, &opt, &err_details); >> if (LJ_UNLIKELY(status != PROFILE_SUCCESS)) >> @@ -336,6 +341,11 @@ LJLIB_CF(misc_sysprof_start) >> /* local res, err, errno = profile.sysprof_stop() */ >> LJLIB_CF(misc_sysprof_stop) >> { >> +#if !LJ_HASSYSPROF >> + const char *err_details = NULL; >> + err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED); > Looks like we just can do the following for this block: > > | const char *err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED); > > Here and below. Fixed. > >> + return sysprof_error(L, PROFILE_ERRUSE, err_details); >> +#endif /* !LJ_HASSYSPROF */ >> int status = luaM_sysprof_stop(L); >> if (LJ_UNLIKELY(status != PROFILE_SUCCESS)) >> return sysprof_error(L, status, NULL); >> @@ -347,6 +357,11 @@ LJLIB_CF(misc_sysprof_stop) >> /* local counters, err, errno = sysprof.report() */ >> LJLIB_CF(misc_sysprof_report) >> { >> +#if !LJ_HASSYSPROF >> + const char *err_details = NULL; >> + err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED); >> + return sysprof_error(L, PROFILE_ERRUSE, err_details); >> +#endif /* !LJ_HASSYSPROF */ >> struct luam_Sysprof_Counters counters = {}; >> GCtab *data_tab = NULL; >> GCtab *count_tab = NULL; >> @@ -386,6 +401,11 @@ LJLIB_CF(misc_sysprof_report) >> /* local started, err, errno = misc.memprof.start(fname) */ >> LJLIB_CF(misc_memprof_start) >> { >> +#if !LJ_HASMEMPROF >> + const char *err_details = NULL; >> + err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED); >> + return sysprof_error(L, PROFILE_ERRUSE, err_details); >> +#endif /* !LJ_HASMEMPROF */ >> struct lj_memprof_options opt = {0}; >> const char *fname = strdata(lj_lib_checkstr(L, 1)); >> struct profile_ctx *ctx; >> @@ -440,6 +460,11 @@ LJLIB_CF(misc_memprof_start) >> /* local stopped, err, errno = misc.memprof.stop() */ >> LJLIB_CF(misc_memprof_stop) >> { >> +#if !LJ_HASMEMPROF >> + const char *err_details = NULL; >> + err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED); >> + return sysprof_error(L, PROFILE_ERRUSE, err_details); >> +#endif /* !LJ_HASMEMPROF */ >> int status = lj_memprof_stop(L); >> if (status != PROFILE_SUCCESS) { >> switch (status) { >> diff --git a/src/lj_errmsg.h b/src/lj_errmsg.h >> index b5c3a275..e26f5e38 100644 >> --- a/src/lj_errmsg.h >> +++ b/src/lj_errmsg.h >> @@ -193,6 +193,7 @@ ERRDEF(PROF_DETAILS_BADINTERVAL, "profiler interval must be greater than 1") >> ERRDEF(PROF_DETAILS_BADPATH, "profiler path does not exist") >> ERRDEF(PROF_DETAILS_BADTABLE, "profiler expects a table with parameters") >> >> +ERRDEF(PROF_DETAILS_DISABLED, "profiler is disabled") > I suppose this should be declared under `#else` directive (i.e. if we > have at least one profiler disabled). err message is required by code for checking disabled profilers (see above) > >> #undef ERRDEF >> >> /* Detecting unused error messages: >> diff --git a/test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua b/test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua >> new file mode 100644 >> index 00000000..a0669cc6 >> --- /dev/null >> +++ b/test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua >> @@ -0,0 +1,22 @@ >> +local tap = require("tap") > Please use single quotes everywhere across this file for the > consistency. Fixed. >> +local test = tap.test("misclib-memprof-lapi-disabled"):skipcond({ >> + ["Memprof is enabled"] = not os.getenv('LUAJIT_DISABLE_MEMPROF'), >> +}) >> + >> +test:plan(6) >> + >> +-- Attempt to start memprof when memprof is disabled. > Minor: s/start memprof when memprof/start memprof when it/ > Fixed. >> +local res, err, errno = misc.memprof.start() >> +test:is(res, nil, "result status on start when memprof is disabled") >> +test:ok(err:match("profiler is disabled"), >> + "error on start when memprof is disabled") >> +test:ok(type(errno) == "number", "errno on start when memprof is disabled") >> + >> +-- Attempt to stop memprof when memprof is disabled. > Minor: s/stop memprof when memprof/stop memprof when it/ Fixed. > >> +res, err, errno = misc.memprof.stop() >> +test:is(res, nil, "result status on stop when memprof is disabled") >> +test:ok(err:match("profiler is disabled"), >> + "error on stop when memprof is disabled") >> +test:ok(type(errno) == "number", "errno on start when memprof is disabled") >> + >> +test:done(true) >> diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua >> new file mode 100644 >> index 00000000..79707434 >> --- /dev/null >> +++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua >> @@ -0,0 +1,29 @@ >> +local tap = require("tap") > Please use single quotes everywhere across this file for the > consistency. Fixed. >> +local test = tap.test("misclib-sysprof-lapi-disabled"):skipcond({ >> + ["Sysprof is enabled"] = not os.getenv('LUAJIT_DISABLE_SYSPROF'), >> +}) >> + >> +test:plan(9) >> + >> +-- Attempt to start sysprof when sysprof is disabled. >> +local res, err, errno = misc.sysprof.start() >> +test:is(res, nil, "result status on start when sysprof is disabled") >> +test:ok(err:match("profiler is disabled"), >> + "error on start when sysprof is disabled") >> +test:ok(type(errno) == "number", "errno on start when sysprof is disabled") >> + >> +-- Attempt to stop sysprof when sysprof is disabled. >> +res, err, errno = misc.sysprof.stop() >> +test:is(res, nil, "result status on stop when sysprof is disabled") >> +test:ok(err:match("profiler is disabled"), >> + "error on stop when sysprof is disabled") >> +test:ok(type(errno) == "number", "errno on start when sysprof is disabled") >> + >> +-- Attempt to report when sysprof is disabled. >> +res, err, errno = misc.sysprof.report() >> +test:is(res, nil, "result status on report when sysprof is disabled") >> +test:ok(err:match("profiler is disabled"), >> + "error on stop when sysprof is disabled") >> +test:ok(type(errno) == "number", "errno on start when sysprof is disabled") >> + >> +test:done(true) >> -- >> 2.34.1 >> --------------vPU7aSze5QtGsu1OplknNfnN Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi, Sergey,

thanks for review!

On 19.02.2025 11:06, Sergey Kaplun via Tarantool-patches wrote:
Hi, Sergey!
Thanks for the patch!
LGTM, after fixing minor nits below.

On 13.02.25, Sergey Bronnikov wrote:
sysprof and memprof Lua API functions returns an error message
Typo: s/returns/return/
Fixed.

"profiler misuse", when appropriate profiler is disabled in build.
Typo: s/appropriate/the corresponding/
Typo: s/build/the build/
Fixed.

It is not possible to easily distinquish whether it is really
Typo: s/distinquish/distinguish/
Fixed.

misuse or profiler was not enabled in build. The patch changes
Typo: s/profiler/or if the profiler/
Typo: s/build/the build/
Fixed.

errors messages, so when profiler was not enabled in build message
Typo: s/errors/error/
Typo: s/profiler/a profiler/
Typo: s/was/is/
Typo: s/in build message/in the build, the message/
Fixed.

is the following: "profiler misuse: profiler is disabled".
---
 src/lib_misc.c                                | 27 ++++++++++++++++-
 src/lj_errmsg.h                               |  1 +
 .../misclib-memprof-lapi-disabled.test.lua    | 22 ++++++++++++++
 .../misclib-sysprof-lapi-disabled.test.lua    | 29 +++++++++++++++++++
 4 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua
 create mode 100644 test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua

diff --git a/src/lib_misc.c b/src/lib_misc.c
index d71904e4..7666d85f 100644
--- a/src/lib_misc.c
+++ b/src/lib_misc.c
@@ -315,10 +315,15 @@ static int sysprof_error(lua_State *L, int status, const char *err_details)
 /* local res, err, errno = sysprof.start(options) */
 LJLIB_CF(misc_sysprof_start)
 {
+  const char *err_details = NULL;
+#if !LJ_HASSYSPROF
It's more LuaJIT-way to use something like the following:
| if (!LJ_HASSYSPROF) {
|   /* ... */
| }

This helps to avoid strange early return.
Fixed.
Also, please be avaired to declare all variables (stataus, opt,
err_details) in the beginning of the block.

 It is a requirement for the code that strictly follows c89, when you must declare all of your variables at the beginning of a scope block.

AFAIK, we have no such requirement, and also there is no option "-std=c89" in CI and no any mentions in the contribution guide.


Here and below.


+  err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
+  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+#endif /* !LJ_HASSYSPROF */
+
   int status = PROFILE_SUCCESS;
 
   struct luam_Sysprof_Options opt = {};
-  const char *err_details = NULL;
 
   status = parse_sysprof_opts(L, &opt, &err_details);
   if (LJ_UNLIKELY(status != PROFILE_SUCCESS))
@@ -336,6 +341,11 @@ LJLIB_CF(misc_sysprof_start)
 /* local res, err, errno = profile.sysprof_stop() */
 LJLIB_CF(misc_sysprof_stop)
 {
+#if !LJ_HASSYSPROF
+  const char *err_details = NULL;
+  err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
Looks like we just can do the following for this block:

| const char *err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);

Here and below.
Fixed.

+  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+#endif /* !LJ_HASSYSPROF */
   int status = luaM_sysprof_stop(L);
   if (LJ_UNLIKELY(status != PROFILE_SUCCESS))
     return sysprof_error(L, status, NULL);
@@ -347,6 +357,11 @@ LJLIB_CF(misc_sysprof_stop)
 /* local counters, err, errno = sysprof.report() */
 LJLIB_CF(misc_sysprof_report)
 {
+#if !LJ_HASSYSPROF
+  const char *err_details = NULL;
+  err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
+  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+#endif /* !LJ_HASSYSPROF */
   struct luam_Sysprof_Counters counters = {};
   GCtab *data_tab = NULL;
   GCtab *count_tab = NULL;
@@ -386,6 +401,11 @@ LJLIB_CF(misc_sysprof_report)
 /* local started, err, errno = misc.memprof.start(fname) */
 LJLIB_CF(misc_memprof_start)
 {
+#if !LJ_HASMEMPROF
+  const char *err_details = NULL;
+  err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
+  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+#endif /* !LJ_HASMEMPROF */
   struct lj_memprof_options opt = {0};
   const char *fname = strdata(lj_lib_checkstr(L, 1));
   struct profile_ctx *ctx;
@@ -440,6 +460,11 @@ LJLIB_CF(misc_memprof_start)
 /* local stopped, err, errno = misc.memprof.stop() */
 LJLIB_CF(misc_memprof_stop)
 {
+#if !LJ_HASMEMPROF
+  const char *err_details = NULL;
+  err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
+  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+#endif /* !LJ_HASMEMPROF */
   int status = lj_memprof_stop(L);
   if (status != PROFILE_SUCCESS) {
     switch (status) {
diff --git a/src/lj_errmsg.h b/src/lj_errmsg.h
index b5c3a275..e26f5e38 100644
--- a/src/lj_errmsg.h
+++ b/src/lj_errmsg.h
@@ -193,6 +193,7 @@ ERRDEF(PROF_DETAILS_BADINTERVAL, "profiler interval must be greater than 1")
 ERRDEF(PROF_DETAILS_BADPATH, "profiler path does not exist")
 ERRDEF(PROF_DETAILS_BADTABLE, "profiler expects a table with parameters")
 
+ERRDEF(PROF_DETAILS_DISABLED, "profiler is disabled")
I suppose this should be declared under `#else` directive (i.e. if we
have at least one profiler disabled).

err message is required by code for checking disabled profilers (see above)


 #undef ERRDEF
 
 /* Detecting unused error messages:
diff --git a/test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua b/test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua
new file mode 100644
index 00000000..a0669cc6
--- /dev/null
+++ b/test/tarantool-tests/profilers/misclib-memprof-lapi-disabled.test.lua
@@ -0,0 +1,22 @@
+local tap = require("tap")
Please use single quotes everywhere across this file for the
consistency.

Fixed.



      
+local test = tap.test("misclib-memprof-lapi-disabled"):skipcond({
+  ["Memprof is enabled"] = not os.getenv('LUAJIT_DISABLE_MEMPROF'),
+})
+
+test:plan(6)
+
+-- Attempt to start memprof when memprof is disabled.
Minor: s/start memprof when memprof/start memprof when it/

Fixed.
+local res, err, errno = misc.memprof.start()
+test:is(res, nil, "result status on start when memprof is disabled")
+test:ok(err:match("profiler is disabled"),
+        "error on start when memprof is disabled")
+test:ok(type(errno) == "number", "errno on start when memprof is disabled")
+
+-- Attempt to stop memprof when memprof is disabled.
Minor: s/stop memprof when memprof/stop memprof when it/
Fixed.

+res, err, errno = misc.memprof.stop()
+test:is(res, nil, "result status on stop when memprof is disabled")
+test:ok(err:match("profiler is disabled"),
+        "error on stop when memprof is disabled")
+test:ok(type(errno) == "number", "errno on start when memprof is disabled")
+
+test:done(true)
diff --git a/test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua b/test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua
new file mode 100644
index 00000000..79707434
--- /dev/null
+++ b/test/tarantool-tests/profilers/misclib-sysprof-lapi-disabled.test.lua
@@ -0,0 +1,29 @@
+local tap = require("tap")
Please use single quotes everywhere across this file for the
consistency.
Fixed.

      
+local test = tap.test("misclib-sysprof-lapi-disabled"):skipcond({
+  ["Sysprof is enabled"] = not os.getenv('LUAJIT_DISABLE_SYSPROF'),
+})
+
+test:plan(9)
+
+-- Attempt to start sysprof when sysprof is disabled.
+local res, err, errno = misc.sysprof.start()
+test:is(res, nil, "result status on start when sysprof is disabled")
+test:ok(err:match("profiler is disabled"),
+        "error on start when sysprof is disabled")
+test:ok(type(errno) == "number", "errno on start when sysprof is disabled")
+
+-- Attempt to stop sysprof when sysprof is disabled.
+res, err, errno = misc.sysprof.stop()
+test:is(res, nil, "result status on stop when sysprof is disabled")
+test:ok(err:match("profiler is disabled"),
+        "error on stop when sysprof is disabled")
+test:ok(type(errno) == "number", "errno on start when sysprof is disabled")
+
+-- Attempt to report when sysprof is disabled.
+res, err, errno = misc.sysprof.report()
+test:is(res, nil, "result status on report when sysprof is disabled")
+test:ok(err:match("profiler is disabled"),
+        "error on stop when sysprof is disabled")
+test:ok(type(errno) == "number", "errno on start when sysprof is disabled")
+
+test:done(true)
-- 
2.34.1


    
--------------vPU7aSze5QtGsu1OplknNfnN--