Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] build: embed LuaJIT memory profiler tools
Date: Mon, 28 Dec 2020 10:55:02 +0300	[thread overview]
Message-ID: <20201228075502.GA132261@hpalx> (raw)
In-Reply-To: <20201228070431.31068-1-skaplun@tarantool.org>

Hi Sergey, thanks for the patch, as I see no new degradation found in
gitlab-ci testing commit criteria pipeline [1], patch LGTM.

[1] - https://gitlab.com/tarantool/tarantool/-/pipelines/234950657

On Mon, Dec 28, 2020 at 10:04:31AM +0300, Sergey Kaplun via Tarantool-patches wrote:
> This patch embeds a parser for binary data dumped via the memory
> profiler to Tarantool binary.
> 
> It is a set of the following Lua modules:
> * utils/bufread.lua: read binary data from a file.
> * utils/symtab.lua: symbol table decode functions
> * memprof/parse.lua: decode the memory profiler event stream
> * memprof/humanize.lua: display decoded data in human readable format
> * memprof.lua: Lua script and module to display data
> 
> It launch with the following command:
> $ tarantool -e 'require("memprof")(arg[1])' - filename.bin
> 
> Closed #5490
> ---
> 
> Issue: https://github.com/tarantool/tarantool/issues/5490
> Branch: https://github.com/tarantool/tarantool/tree/skaplun/gh-5442-luajit-memory-profiler
> CI: https://gitlab.com/tarantool/tarantool/-/commits/skaplun/gh-5442-luajit-memory-profiler
> 
>  src/CMakeLists.txt |  6 ++++++
>  src/lua/init.c     | 15 ++++++++++++++-
>  2 files changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index b95688c1a..9a712bc29 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -61,6 +61,12 @@ lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/vmdef.lua
>  lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/v.lua")
>  lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/p.lua")
>  lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/src/jit/zone.lua")
> +# LuaJIT tools.* library
> +lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/tools/memprof.lua")
> +lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/tools/memprof/humanize.lua")
> +lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/tools/memprof/parse.lua")
> +lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/tools/utils/bufread.lua")
> +lua_source(lua_sources "${CMAKE_BINARY_DIR}/third_party/luajit/tools/utils/symtab.lua")
>  
>  add_custom_target(generate_lua_sources
>      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src/box
> diff --git a/src/lua/init.c b/src/lua/init.c
> index a0b2fc775..82075c595 100644
> --- a/src/lua/init.c
> +++ b/src/lua/init.c
> @@ -121,7 +121,14 @@ extern char strict_lua[],
>  	string_lua[],
>  	swim_lua[],
>  	p_lua[], /* LuaJIT 2.1 profiler */
> -	zone_lua[] /* LuaJIT 2.1 profiler */;
> +	zone_lua[], /* LuaJIT 2.1 profiler */
> +	/* tools.* libraries. */
> +	bufread_lua[],
> +	symtab_lua[],
> +	parse_lua[],
> +	humanize_lua[],
> +	memprof_lua[]
> +;
>  
>  static const char *lua_modules[] = {
>  	/* Make it first to affect load of all other modules */
> @@ -167,6 +174,12 @@ static const char *lua_modules[] = {
>  	/* Profiler */
>  	"jit.p", p_lua,
>  	"jit.zone", zone_lua,
> +	/* tools.* libraries. Order is important. */
> +	"utils.bufread", bufread_lua,
> +	"utils.symtab", symtab_lua,
> +	"memprof.parse", parse_lua,
> +	"memprof.humanize", humanize_lua,
> +	"memprof", memprof_lua,
>  	NULL
>  };
>  
> -- 
> 2.28.0
> 

  parent reply	other threads:[~2020-12-28  7:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28  7:04 Sergey Kaplun
2020-12-28  7:09 ` Igor Munkin
2020-12-28  7:10   ` Sergey Kaplun
2020-12-28  7:55 ` Alexander V. Tikhonov [this message]
2020-12-28  8:17 ` Igor Munkin

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=20201228075502.GA132261@hpalx \
    --to=avtikhon@tarantool.org \
    --cc=skaplun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] build: embed LuaJIT memory profiler tools' \
    /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