Tarantool development patches archive
 help / color / mirror / Atom feed
From: Igor Munkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maksim Kokryashkin <max.kokryashkin@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit v4 3/3] sysprof: improve parser's memory footprint
Date: Mon, 21 Aug 2023 13:05:41 +0000	[thread overview]
Message-ID: <ZONhJfQd8wZAPaH/@tarantool.org> (raw)
In-Reply-To: <20230821100604.61363-4-max.kokryashkin@gmail.com>

Max,

Thanks for the patch! LGTM, except several nits below.

On 21.08.23, Maksim Kokryashkin wrote:
> From: Maxim Kokryashkin <m.kokryashkin@tarantool.org>
> 
> This patch reduces sysprof's parser memory footprint,
> by avoiding reading all callchains before collapsing them.
> Instead of it, parser merges stacks immediately after
> reading them atnd stores counts in a lua table.

Typo: s/atnd/and/.
Typo: s/lua/Lua/.

> 
> The `collapse.lua` module is purged as a result of the
> patch, but it is left as a stub to keep the integrational
> testing intact. This stub should be removed in the next
> series.
> 
> Resolves tarantool/tarantool#8700
> ---
> Note: the assertion, proposed by Igor wasn't added, since it breaks
> integrational testing.

OK, anyway, thanks for trying.

> 
>  tools/CMakeLists.txt       |   4 ++
>  tools/sysprof.lua          |  21 +------
>  tools/sysprof/collapse.lua | 123 +-----------------------------------
>  tools/sysprof/parse.lua    | 125 ++++++++++++++++++++++++++-----------
>  4 files changed, 100 insertions(+), 173 deletions(-)

<snipped>

> diff --git a/tools/sysprof/parse.lua b/tools/sysprof/parse.lua
> index 5b52f104..92e475a6 100755
> --- a/tools/sysprof/parse.lua
> +++ b/tools/sysprof/parse.lua

<snipped>

> @@ -143,18 +153,63 @@ local function parse_symtab(reader, symbols, vmstate)

<snipped>

> +local function insert_lua_callchain(chain, lua)
> +  local ins_cnt = 0
> +  local name_lua
> +  for _, fr in ipairs(lua.callchain) do
> +    ins_cnt = ins_cnt + 1
> +    if fr.type == FRAME.CFUNC then
> +      -- C function encountered, the next chunk
> +      -- of frames is located on the C stack.
> +      break
> +    end
> +    name_lua = fr.name
> +
> +    if fr.type == FRAME.LFUNC
> +      and lua.trace.traceno ~= nil
> +      and lua.trace.addr == fr.addr
> +      and lua.trace.line == fr.line
> +    then
> +            name_lua = lua.trace.name

Still misindented operator.

> +    end
> +
> +    table.insert(chain, name_lua)
> +  end
> +  table.remove(lua.callchain, ins_cnt)
> +end
> +

<snipped>

> --
> 2.39.2 (Apple Git-143)
> 

-- 
Best regards,
IM

  reply	other threads:[~2023-08-21 13:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21 10:06 [Tarantool-patches] [PATCH luajit v4 0/3] sysprof: parser refactoring Maksim Kokryashkin via Tarantool-patches
2023-08-21 10:06 ` [Tarantool-patches] [PATCH luajit v4 1/3] sysprof: remove `split by vmstate` option Maksim Kokryashkin via Tarantool-patches
2023-08-21 13:05   ` Igor Munkin via Tarantool-patches
2023-08-21 13:37     ` Maxim Kokryashkin via Tarantool-patches
2023-08-21 10:06 ` [Tarantool-patches] [PATCH luajit v4 2/3] tools: add execution permission to sysprof parser Maksim Kokryashkin via Tarantool-patches
2023-08-21 10:06 ` [Tarantool-patches] [PATCH luajit v4 3/3] sysprof: improve parser's memory footprint Maksim Kokryashkin via Tarantool-patches
2023-08-21 13:05   ` Igor Munkin via Tarantool-patches [this message]
2023-08-31 15:17 ` [Tarantool-patches] [PATCH luajit v4 0/3] sysprof: parser refactoring Igor Munkin 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=ZONhJfQd8wZAPaH/@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=max.kokryashkin@gmail.com \
    --subject='Re: [Tarantool-patches] [PATCH luajit v4 3/3] sysprof: improve parser'\''s memory footprint' \
    /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