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: Thu, 6 Mar 2025 19:18:56 +0300 [thread overview] Message-ID: <4fcb9e5102d73a19ddce611d7f477bdbdb088483.1741277815.git.sergeyb@tarantool.org> (raw) In-Reply-To: <cover.1741277815.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 83669268..9c827157 100644 --- a/src/lib_misc.c +++ b/src/lib_misc.c @@ -276,7 +276,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: @@ -307,7 +307,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; @@ -316,12 +316,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; @@ -333,11 +333,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; @@ -349,14 +349,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); @@ -394,7 +394,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); @@ -454,7 +454,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
next prev parent reply other threads:[~2025-03-06 16:20 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-03-06 16:18 [Tarantool-patches] [PATCH luajit 0/3] Fix sysprof error on stop not started sysprof Sergey Bronnikov via Tarantool-patches 2025-03-06 16:18 ` Sergey Bronnikov via Tarantool-patches [this message] 2025-03-06 16:18 ` [Tarantool-patches] [PATCH luajit 2/3] misc: use prof_error for handling errors Sergey Bronnikov via Tarantool-patches 2025-03-07 7:18 ` Sergey Kaplun 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 -- strict thread matches above, loose matches on Subject: below -- 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
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=4fcb9e5102d73a19ddce611d7f477bdbdb088483.1741277815.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