From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 940415A9F2A; Mon, 4 Sep 2023 08:47:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 940415A9F2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1693806449; bh=hclinU3LkQnEYf8QOGjcPLuCUXZzYgQGng5j5zNSTSk=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nHNbC5HpuBlStkhHhNoH5VaBqBPlavgUlBwPxwKOLPaGGVbwJX6GW0ljw12PQrW+D DRdJyfYAaFhFJNg9FSjeOGsmmZ73M+bMnjJ3RpInJ1P1PmvrWcbk2C8GOjZ2oylr/q Z2Oq8oPScdlFQ0nulBIyzULgtxWNv4ffaYwKImoc= Received: from smtp46.i.mail.ru (smtp46.i.mail.ru [95.163.41.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EE17C5A9F2A for ; Mon, 4 Sep 2023 08:47:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EE17C5A9F2A Received: by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1qd2Qq-00DzVg-0e; Mon, 04 Sep 2023 08:47:28 +0300 Date: Mon, 4 Sep 2023 08:47:27 +0300 To: Sergey Kaplun Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD96E142CFC92DB15CDE87830E258C493C61F3CEBBE49E3D68C182A05F538085040C17A16B17DF1024EC1518A4122DA2D6D86EFD6D276780D4658D4FE6E9D9D6F1D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE792C68BF9CD4C0E9EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375CC217B55A7C05578638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D87F4B4D33897D3F44CEF9D2C706D47AF0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCB816BE3345416868389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8B861051D4BA689FCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C457EE4B4996FC54603F1AB874ED890284AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3CD582FA7F3E0DDE5BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE75A9E79F66F1C28F3731C566533BA786AA5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A52C62AF795D9EA5EE29550811D2100194AB7CA050525296F8F87CCE6106E1FC07E67D4AC08A07B9B06A1CB4668A9CA5FACB5012B2E24CD356 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF6DE32E4B1E5E7A6CAA8C53059D60EAAC28D8FCA75EED46BCB0DFF45CB2ED417DE5D0AE1B90484215EA61C66FA002EE2792EC261C5B20BF711E8E55BCB6185DE4A74DFFEFA5DC0E7F02C26D483E81D6BE64ACE4A408B72B61B0CA6F94E606A667A52EF62A646584F811BD90D3D42C882D43082AE146A756F3 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojNmsqR+t6vc93/+q1XuYeqQ== X-Mailru-Sender: 7940E2A4EB16C9975791D6D34F6B5B9EB2BD91EC1D62F3BE3FD97C46B013935AE2527C969975515CFF9FCECFB8D89CB6C77752E0C033A69E235A20A81F3B0E39AB3C5F247CB2F7F93A5DB60FBEB33A8A0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] profilers: purge generation mechanism X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Cc: Maxim Kokryashkin , tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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") > > > > > 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 > > > > > 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) > > > > > 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 > > > > > 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 > > > > > @@ -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 > > > > > -- > > 2.41.0 > > > > -- > Best regards, > Sergey Kaplun