Tarantool development patches archive
 help / color / mirror / Atom feed
From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: Maxim Kokryashkin <max.kokryashkin@gmail.com>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] profilers: purge generation mechanism
Date: Mon, 4 Sep 2023 08:47:27 +0300	[thread overview]
Message-ID: <d5sshdmwi76f5bahfprheu7x5c6dervioj4elp6ztqlt33gmrc@jmyynypuif47> (raw)
In-Reply-To: <ZPReL-SbVeBAcz1x@root>

Hi, Sergey!
Thanks for the review!
Fixed your comments, the branch is force-pushed.
On Sun, Sep 03, 2023 at 01:21:35PM +0300, Sergey Kaplun wrote:
> Hi, Maxim!
> Thanks for the patch!
> I see improvements in time of the parsing even for small payloads!
> Nice work! LGTM, with minor nits below.
> 
> On 28.08.23, Maxim Kokryashkin wrote:
> > Since both of the profiler parsers are now processing
> > the events in a stream-like fashion, the generation
> > mechanism is excessive and can be purged. This results
> > in a significant memory consumption drop, especially
> > for the AVL-tree part.
> > 
> > Follows up tarantool/tarantool#8700
> > ---
> >  .../gh-5813-resolving-of-c-symbols.test.lua   |  7 ++--
> >  tools/memprof/parse.lua                       |  2 +-
> >  tools/sysprof/parse.lua                       |  9 ++---
> >  tools/utils/avl.lua                           |  4 +--
> >  tools/utils/symtab.lua                        | 33 +++++++------------
> >  5 files changed, 19 insertions(+), 36 deletions(-)
> > 
> > diff --git a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
> > index 30b8a3ca..1581ee4b 100644
> > --- a/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
> > +++ b/test/tarantool-tests/gh-5813-resolving-of-c-symbols.test.lua
> > @@ -24,12 +24,9 @@ local TMP_BINFILE = profilename("memprofdata.tmp.bin")
> 
> <snipped>
> 
> > diff --git a/tools/memprof/parse.lua b/tools/memprof/parse.lua
> > index 1b6eceb4..6fd7451b 100644
> > --- a/tools/memprof/parse.lua
> > +++ b/tools/memprof/parse.lua
> 
> <snipped>
> 
> > diff --git a/tools/sysprof/parse.lua b/tools/sysprof/parse.lua
> > index 451edecb..bb1cb02c 100755
> > --- a/tools/sysprof/parse.lua
> > +++ b/tools/sysprof/parse.lua
> > @@ -59,7 +59,7 @@ end
> >  local function parse_lfunc(reader, symbols)
> >    local addr = reader:read_uleb128()
> >    local line = reader:read_uleb128()
> > -  local loc = symtab.loc(symbols, { addr = addr, line = line })
> > +  local loc = symtab.loc{ addr = addr, line = line }
> 
> Minor: Please, use `()` for function calls. Here and below.
Fixed. Here is the diff:

==========================================================================
diff --git a/tools/sysprof/parse.lua b/tools/sysprof/parse.lua
index bb1cb02c..64c4a455 100755
--- a/tools/sysprof/parse.lua
+++ b/tools/sysprof/parse.lua
@@ -59,7 +59,7 @@ end
 local function parse_lfunc(reader, symbols)
   local addr = reader:read_uleb128()
   local line = reader:read_uleb128()
-  local loc = symtab.loc{ addr = addr, line = line }
+  local loc = symtab.loc({ addr = addr, line = line })
   loc.type = FRAME.LFUNC
   return symtab.demangle(symbols, loc)
 end
@@ -71,7 +71,7 @@ end
 
 local function parse_cfunc(reader, symbols)
   local addr = reader:read_uleb128()
-  local loc = symtab.loc{ addr = addr }
+  local loc = symtab.loc({ addr = addr })
   loc.type = FRAME.CFUNC
   return symtab.demangle(symbols, loc)
 end
@@ -99,7 +99,7 @@ local function parse_host_callchain(reader, event, symbols)
   local addr = reader:read_uleb128()
 
   while addr ~= 0 do
-    local loc = symtab.loc{ addr = addr }
+    local loc = symtab.loc({ addr = addr })
     table.insert(event.host.callchain, 1, symtab.demangle(symbols, loc))
     addr = reader:read_uleb128()
   end
diff --git a/tools/utils/symtab.lua b/tools/utils/symtab.lua
index 2afd2fd1..0c878e7a 100644
--- a/tools/utils/symtab.lua
+++ b/tools/utils/symtab.lua
@@ -61,7 +61,7 @@ function M.parse_sym_trace(reader, symtab)
   symtab.trace[traceno] = symtab.trace[traceno] or {}
 
   symtab.trace[traceno] = {
-    start = M.loc{ addr = sym_addr, line = sym_line }
+    start = M.loc({ addr = sym_addr, line = sym_line })
   }
 end

==========================================================================
> 
> >    loc.type = FRAME.LFUNC
> >    return symtab.demangle(symbols, loc)
> >  end
> > @@ -71,7 +71,7 @@ end
> >  
> >  local function parse_cfunc(reader, symbols)
> >    local addr = reader:read_uleb128()
> > -  local loc = symtab.loc(symbols, { addr = addr })
> > +  local loc = symtab.loc{ addr = addr }
> >    loc.type = FRAME.CFUNC
> >    return symtab.demangle(symbols, loc)
> >  end
> > @@ -99,7 +99,7 @@ local function parse_host_callchain(reader, event, symbols)
> >    local addr = reader:read_uleb128()
> >  
> >    while addr ~= 0 do
> > -    local loc = symtab.loc(symbols, { addr = addr })
> > +    local loc = symtab.loc{ addr = addr }
> >      table.insert(event.host.callchain, 1, symtab.demangle(symbols, loc))
> >      addr = reader:read_uleb128()
> >    end
> > @@ -113,14 +113,11 @@ local function parse_trace_callchain(reader, event, symbols)
> 
> <snipped>
> 
> > diff --git a/tools/utils/avl.lua b/tools/utils/avl.lua
> > index d5baa534..81ef9265 100644
> > --- a/tools/utils/avl.lua
> > +++ b/tools/utils/avl.lua
> 
> <snipped>
> 
> > diff --git a/tools/utils/symtab.lua b/tools/utils/symtab.lua
> > index c26a9e8c..2afd2fd1 100644
> > --- a/tools/utils/symtab.lua
> > +++ b/tools/utils/symtab.lua
> 
> <snipped>
> 
> > @@ -69,9 +60,9 @@ function M.parse_sym_trace(reader, symtab)
> >  
> >    symtab.trace[traceno] = symtab.trace[traceno] or {}
> >  
> > -  table.insert(symtab.trace[traceno], {
> > -    start = M.loc(symtab, { addr = sym_addr, line = sym_line })
> > -  })
> > +  symtab.trace[traceno] = {
> > +    start = M.loc{ addr = sym_addr, line = sym_line }
> > +  }
> >  end
> >  
> >  -- Parse a single entry in a symtab: .so library
> > @@ -136,7 +127,7 @@ end
> 
> <snipped>
> 
> > -- 
> > 2.41.0
> > 
> 
> -- 
> Best regards,
> Sergey Kaplun

  reply	other threads:[~2023-09-04  5:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28 15:23 [Tarantool-patches] [PATCH luajit 0/2] profilers: purge generations Maxim Kokryashkin via Tarantool-patches
2023-08-28 15:23 ` [Tarantool-patches] [PATCH luajit 1/2] memprof: refactor symbol resolution Maxim Kokryashkin via Tarantool-patches
2023-09-03 10:14   ` Sergey Kaplun via Tarantool-patches
2023-09-04  5:44     ` Maxim Kokryashkin via Tarantool-patches
2023-09-05 11:47   ` Sergey Bronnikov via Tarantool-patches
2023-09-08 11:04     ` Maxim Kokryashkin via Tarantool-patches
2023-10-06 14:52       ` Sergey Bronnikov via Tarantool-patches
2023-08-28 15:23 ` [Tarantool-patches] [PATCH luajit 2/2] profilers: purge generation mechanism Maxim Kokryashkin via Tarantool-patches
2023-09-03 10:21   ` Sergey Kaplun via Tarantool-patches
2023-09-04  5:47     ` Maxim Kokryashkin via Tarantool-patches [this message]
2023-09-05 11:53   ` Sergey Bronnikov via Tarantool-patches
2023-09-12 10:26     ` Maxim Kokryashkin via Tarantool-patches
2023-09-14  9:47       ` Sergey Bronnikov via Tarantool-patches
2023-09-18  9:18         ` Maxim Kokryashkin via Tarantool-patches
2023-10-06 14:43           ` Sergey Bronnikov via Tarantool-patches
2023-10-06 14:45             ` Sergey Bronnikov via Tarantool-patches
2023-10-06 14:40       ` Sergey Bronnikov via Tarantool-patches
2023-10-06 14:52       ` Sergey Bronnikov via Tarantool-patches
2023-11-13 18:48       ` Igor Munkin via Tarantool-patches
2023-11-23  6:32 ` [Tarantool-patches] [PATCH luajit 0/2] profilers: purge generations 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=d5sshdmwi76f5bahfprheu7x5c6dervioj4elp6ztqlt33gmrc@jmyynypuif47 \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.kokryashkin@tarantool.org \
    --cc=max.kokryashkin@gmail.com \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH luajit 2/2] profilers: purge generation mechanism' \
    /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