[Tarantool-patches] [PATCH luajit 1/2] memprof: refactor symbol resolution

Sergey Bronnikov sergeyb at tarantool.org
Tue Sep 5 14:47:15 MSK 2023


Hi, Max


thanks for the patch! LGTM with a two minor comments.


It is not related to submitted patches, but anyway - there is a typo:

--- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
+++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua
@@ -36,7 +36,7 @@ local function default_payload()
    -- Preallocate table to avoid table array part reallocations.
    local _ = table_new(20, 0)

-  -- Want too see 20 objects here.
+  -- Want to see 20 objects here.
    for i = 1, 20 do
      -- Try to avoid crossing with "test" module objects.
      _[i] = "memprof-str-"..i


On 8/28/23 18:23, Maxim Kokryashkin wrote:
> This patch refactors symbol resolution in memprof, so
> now they are resolved during the process of parsing.
> This makes the generation mechanism excessive since
> symtab updates are no longer affecting the previous events.
>
> Follows up tarantool/tarantool#8700
> ---
>   .../misclib-memprof-lapi.test.lua             | 73 +++++--------------
>   tools/memprof/humanize.lua                    | 16 ++--
>   tools/memprof/parse.lua                       |  2 +-
>   tools/memprof/process.lua                     |  8 +-
>   4 files changed, 31 insertions(+), 68 deletions(-)
>
> diff --git a/test/tarantool-tests/misclib-memprof-lapi.test.lua b/test/tarantool-tests/misclib-memprof-lapi.test.lua
> index 3cb5c8be..0eee4e21 100644
> --- a/test/tarantool-tests/misclib-memprof-lapi.test.lua
> +++ b/test/tarantool-tests/misclib-memprof-lapi.test.lua
> @@ -78,7 +78,7 @@ local function generate_parsed_output(payload)
>     -- We don't need it any more.
>     os.remove(TMP_BINFILE)
>   
> -  return symbols, events
> +  return events
>   end
>   
>   local function form_source_line(line, source)
> @@ -86,44 +86,13 @@ local function form_source_line(line, source)
>   end
>   
>   local function form_trace_line(traceno, line, source)
> -  return ("TRACE [%d] %s:%d"):format(traceno, source or SRC_PATH, line)
> +  return ("TRACE [%d] started at %s:%d"):format(traceno, source or SRC_PATH, line)
>   end

Nit: this change is not relevant. In the branch hunk is different:

@@ -86,44 +86,17 @@ local function form_source_line(line, source)
  end

  local function form_trace_line(traceno, line, source)
-  return ("TRACE [%d] %s:%d"):format(traceno, source or SRC_PATH, line)
+  return ("TRACE [%d] started at %s:%d"):format(
+    traceno,
+    source or SRC_PATH,
+    line
+  )
  end

>   
<snipped>


More information about the Tarantool-patches mailing list