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>,
	sergos@tarantool.org
Subject: [Tarantool-patches] [PATCH luajit 5/8][v3] test: introduce flag LUAJIT_DISABLE_MEMPROF
Date: Thu, 20 Feb 2025 14:21:50 +0300	[thread overview]
Message-ID: <6990a0f3b661498e2c4c7697f5da4cfe4e35ffe4.1740050074.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1740050074.git.sergeyb@tarantool.org>

The patch introduce an environment variable LUAJIT_DISABLE_MEMPROF
needed by tests in suite `tarantool-tests` for skip testcases when
memprof is disabled in build.

Needed for the following commit.
---
 test/tarantool-tests/CMakeLists.txt               |  4 ++++
 .../gh-5994-memprof-human-readable.test.lua       |  1 +
 .../profilers/misclib-memprof-lapi.test.lua       | 15 ++++++++-------
 3 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/test/tarantool-tests/CMakeLists.txt b/test/tarantool-tests/CMakeLists.txt
index 9bacac88..a6d09dc7 100644
--- a/test/tarantool-tests/CMakeLists.txt
+++ b/test/tarantool-tests/CMakeLists.txt
@@ -97,6 +97,10 @@ if(LUAJIT_DISABLE_SYSPROF)
   list(APPEND LUA_TEST_ENV_MORE LUAJIT_DISABLE_SYSPROF=1)
 endif()
 
+if(LUAJIT_DISABLE_MEMPROF)
+  list(APPEND LUA_TEST_ENV_MORE LUAJIT_DISABLE_MEMPROF=1)
+endif()
+
 # Needed to skip some long tests or tests using signals.
 # See also https://github.com/tarantool/tarantool/issues/10803.
 if(LUAJIT_USE_VALGRIND)
diff --git a/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua b/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
index f3041779..3dc0db6b 100644
--- a/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
+++ b/test/tarantool-tests/profilers/gh-5994-memprof-human-readable.test.lua
@@ -7,6 +7,7 @@ local test = tap.test('gh-5994-memprof-human-readable'):skipcond({
   ['No profile tools CLI option integration'] = _TARANTOOL,
   -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
   ['Disabled due to LuaJIT/LuaJIT#606'] = os.getenv('LUAJIT_TABLE_BUMP'),
+  ['Memprof is disabled'] = os.getenv('LUAJIT_DISABLE_MEMPROF'),
 })
 
 local utils = require('utils')
diff --git a/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua b/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
index 077a7e44..cd675864 100644
--- a/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
+++ b/test/tarantool-tests/profilers/misclib-memprof-lapi.test.lua
@@ -8,6 +8,7 @@ local test = tap.test("misclib-memprof-lapi"):skipcond({
                                                jit.arch ~= "x64",
   -- See also https://github.com/LuaJIT/LuaJIT/issues/606.
   ["Disabled due to LuaJIT/LuaJIT#606"] = os.getenv("LUAJIT_TABLE_BUMP"),
+  ["Memprof is disabled"] = os.getenv("LUAJIT_DISABLE_MEMPROF"),
 })
 
 test:plan(5)
@@ -164,9 +165,9 @@ test:test("output", function(subtest)
   -- one is the number of allocations. 1 event - allocation of
   -- table by itself + 1 allocation of array part as far it is
   -- bigger than LJ_MAX_COLOSIZE (16).
-  subtest:ok(check_alloc_report(alloc, { line = 39, linedefined = 37 }, 2))
+  subtest:ok(check_alloc_report(alloc, { line = 40, linedefined = 38 }, 2))
   -- 20 strings allocations.
-  subtest:ok(check_alloc_report(alloc, { line = 44, linedefined = 37 }, 20))
+  subtest:ok(check_alloc_report(alloc, { line = 45, linedefined = 38 }, 20))
 
   -- Collect all previous allocated objects.
   subtest:ok(free.INTERNAL == 22)
@@ -174,8 +175,8 @@ test:test("output", function(subtest)
   -- Tests for leak-only option.
   -- See also https://github.com/tarantool/tarantool/issues/5812.
   local heap_delta = process.form_heap_delta(events)
-  local tab_alloc_stats = heap_delta[form_source_line(39)]
-  local str_alloc_stats = heap_delta[form_source_line(44)]
+  local tab_alloc_stats = heap_delta[form_source_line(40)]
+  local str_alloc_stats = heap_delta[form_source_line(45)]
   subtest:ok(tab_alloc_stats.nalloc == tab_alloc_stats.nfree)
   subtest:ok(tab_alloc_stats.dbytes == 0)
   subtest:ok(str_alloc_stats.nalloc == str_alloc_stats.nfree)
@@ -260,10 +261,10 @@ test:test("jit-output", function(subtest)
   -- 10 allocations in interpreter mode, 1 allocation for a trace
   -- recording and assembling and next 9 allocations will happen
   -- while running the trace.
-  subtest:ok(check_alloc_report(alloc, { line = 44, linedefined = 37 }, 11))
-  subtest:ok(check_alloc_report(alloc, { traceno = 1, line = 42 }, 9))
+  subtest:ok(check_alloc_report(alloc, { line = 45, linedefined = 38 }, 11))
+  subtest:ok(check_alloc_report(alloc, { traceno = 1, line = 43 }, 9))
   -- See same checks with jit.off().
-  subtest:ok(check_alloc_report(alloc, { line = 39, linedefined = 37 }, 2))
+  subtest:ok(check_alloc_report(alloc, { line = 40, linedefined = 38 }, 2))
 
   -- Restore default JIT settings.
   jit.opt.start(unpack(jit_opt_default))
-- 
2.43.0


  parent reply	other threads:[~2025-02-20 11:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 11:21 [Tarantool-patches] [PATCH luajit 0/8][v3] Fix profilers issues Sergey Bronnikov via Tarantool-patches
2025-02-20 11:21 ` [Tarantool-patches] [PATCH luajit 1/8][v3] test: add descriptions to sysprof testcases Sergey Bronnikov via Tarantool-patches
2025-02-20 11:21 ` [Tarantool-patches] [PATCH luajit 2/8][v3] test: align test title with test filename Sergey Bronnikov via Tarantool-patches
2025-02-20 11:21 ` [Tarantool-patches] [PATCH luajit 3/8][v3] sysprof: fix typo in the comment Sergey Bronnikov via Tarantool-patches
2025-02-20 11:21 ` [Tarantool-patches] [PATCH luajit 4/8][v3] sysprof: introduce specific errors and default mode Sergey Bronnikov via Tarantool-patches
2025-02-20 11:21 ` Sergey Bronnikov via Tarantool-patches [this message]
2025-02-20 11:21 ` [Tarantool-patches] [PATCH luajit 6/8][v3] ci: add workflow with disabled profilers Sergey Bronnikov via Tarantool-patches
2025-02-20 11:21 ` [Tarantool-patches] [PATCH luajit 7/8][v3] misc: specific message for " Sergey Bronnikov via Tarantool-patches
2025-02-20 11:21 ` [Tarantool-patches] [PATCH luajit 8/8][v3] memprof: set default path to profiling output file 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=6990a0f3b661498e2c4c7697f5da4cfe4e35ffe4.1740050074.git.sergeyb@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=estetus@gmail.com \
    --cc=sergos@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 5/8][v3] test: introduce flag LUAJIT_DISABLE_MEMPROF' \
    /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