From: Sergey Kaplun <skaplun@tarantool.org> To: Igor Munkin <imun@tarantool.org>, Sergey Ostanevich <sergos@tarantool.org> Cc: tarantool-discussions@dev.tarantool.org Subject: [Tarantool-discussions] [PATCH] build: embed LuaJIT memory profiler tools Date: Mon, 28 Dec 2020 10:00:36 +0300 [thread overview] Message-ID: <20201228070036.29637-1-skaplun@tarantool.org> (raw) 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
next reply other threads:[~2020-12-28 7:01 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-28 7:00 Sergey Kaplun [this message] 2020-12-28 7:06 ` Sergey Kaplun
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=20201228070036.29637-1-skaplun@tarantool.org \ --to=skaplun@tarantool.org \ --cc=imun@tarantool.org \ --cc=sergos@tarantool.org \ --cc=tarantool-discussions@dev.tarantool.org \ --subject='Re: [Tarantool-discussions] [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