Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org,
	Sergey Kaplun <skaplun@tarantool.org>
Subject: [Tarantool-patches] [PATCH luajit 1/3] sysprof: rename sysprof_error to prof_error
Date: Tue, 25 Feb 2025 10:32:46 +0300	[thread overview]
Message-ID: <5bdd6ea7b4f943a8e05731f78e1a5d8f359e3251.1740468394.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1740468394.git.sergeyb@tarantool.org>

Rename a function `sysprof_error()` to `prof_error()` to make
it profiler-independent.

Needed for the following commit.
---
 src/lib_misc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/lib_misc.c b/src/lib_misc.c
index 94ec6564..b4b58509 100644
--- a/src/lib_misc.c
+++ b/src/lib_misc.c
@@ -275,7 +275,7 @@ static int parse_sysprof_opts(lua_State *L, struct luam_Sysprof_Options *opt,
   return PROFILE_SUCCESS;
 }
 
-static int sysprof_error(lua_State *L, int status, const char *err_details)
+static int prof_error(lua_State *L, int status, const char *err_details)
 {
   switch (status) {
     case PROFILE_ERRUSE:
@@ -306,7 +306,7 @@ LJLIB_CF(misc_sysprof_start)
 {
 #if !LJ_HASSYSPROF
   const char *err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
-  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+  return prof_error(L, PROFILE_ERRUSE, err_details);
 #else
   int status = PROFILE_SUCCESS;
 
@@ -315,12 +315,12 @@ LJLIB_CF(misc_sysprof_start)
 
   status = parse_sysprof_opts(L, &opt, &err_details);
   if (LJ_UNLIKELY(status != PROFILE_SUCCESS))
-    return sysprof_error(L, status, err_details);
+    return prof_error(L, status, err_details);
 
   status = luaM_sysprof_start(L, &opt);
   if (LJ_UNLIKELY(status != PROFILE_SUCCESS))
     /* Allocated memory will be freed in on_stop callback. */
-    return sysprof_error(L, status, err_details);
+    return prof_error(L, status, err_details);
 
   lua_pushboolean(L, 1);
   return 1;
@@ -332,11 +332,11 @@ LJLIB_CF(misc_sysprof_stop)
 {
 #if !LJ_HASSYSPROF
   const char *err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
-  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+  return prof_error(L, PROFILE_ERRUSE, err_details);
 #else
   int status = luaM_sysprof_stop(L);
   if (LJ_UNLIKELY(status != PROFILE_SUCCESS))
-    return sysprof_error(L, status, NULL);
+    return prof_error(L, status, NULL);
 
   lua_pushboolean(L, 1);
   return 1;
@@ -348,14 +348,14 @@ LJLIB_CF(misc_sysprof_report)
 {
 #if !LJ_HASSYSPROF
   const char *err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
-  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+  return prof_error(L, PROFILE_ERRUSE, err_details);
 #else
   struct luam_Sysprof_Counters counters = {};
   GCtab *data_tab = NULL;
   GCtab *count_tab = NULL;
   int status = luaM_sysprof_report(&counters);
   if (status != PROFILE_SUCCESS)
-    return sysprof_error(L, status, NULL);
+    return prof_error(L, status, NULL);
 
   lua_createtable(L, 0, 3);
   data_tab = tabV(L->top - 1);
@@ -393,7 +393,7 @@ LJLIB_CF(misc_memprof_start)
 {
 #if !LJ_HASMEMPROF
   const char *err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
-  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+  return prof_error(L, PROFILE_ERRUSE, err_details);
 #else
   struct lj_memprof_options opt = {0};
   GCstr *s = lj_lib_optstr(L, 1);
@@ -453,7 +453,7 @@ LJLIB_CF(misc_memprof_stop)
 {
 #if !LJ_HASMEMPROF
   const char *err_details = err2msg(LJ_ERR_PROF_DETAILS_DISABLED);
-  return sysprof_error(L, PROFILE_ERRUSE, err_details);
+  return prof_error(L, PROFILE_ERRUSE, err_details);
 #else
   int status = lj_memprof_stop(L);
   if (status != PROFILE_SUCCESS) {
-- 
2.43.0


  reply	other threads:[~2025-02-25  7:33 UTC|newest]

Thread overview: 11+ 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 ` Sergey Bronnikov via Tarantool-patches [this message]
2025-03-05 14:28   ` [Tarantool-patches] [PATCH luajit 1/3] sysprof: rename sysprof_error to prof_error 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
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:18 ` [Tarantool-patches] [PATCH luajit 1/3] sysprof: rename sysprof_error to prof_error 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=5bdd6ea7b4f943a8e05731f78e1a5d8f359e3251.1740468394.git.sergeyb@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=estetus@gmail.com \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 1/3] sysprof: rename sysprof_error to prof_error' \
    /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