[Tarantool-patches] [PATCH luajit v1 00/11] LuaJIT memory profiler

Sergey Kaplun skaplun at tarantool.org
Wed Dec 16 22:13:35 MSK 2020


This patch provides a Lua interface for memory profiler in LuaJIT
and the corresponding parser of profiled data.

Issues: https://github.com/tarantool/tarantool/issues/5442
        https://github.com/tarantool/tarantool/issues/5490

Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-5442-luajit-memory-profiler

CI:     https://gitlab.com/tarantool/tarantool/-/pipelines/230917973

RFC: https://lists.tarantool.org/pipermail/tarantool-discussions/2020-December/000144.html

@ChangeLog:
 - Introduce LuaJIT memory profiler (gh-5442).

Sergey Kaplun (11):
  build: add src dir in building
  utils: introduce leb128 reader and writer
  profile: introduce profiler writing module
  profile: introduce symtab write module
  vm: introduce LFUNC and FFUNC vmstates
  core: introduce new mem_L field
  debug: move debug_frameline to public module API
  profile: introduce memory profiler
  misc: add Lua API for memory profiler
  tools: introduce tools directory
  profile: introduce profile parser

 src/Makefile                          |  16 +-
 src/Makefile.dep                      |  14 +-
 src/lib_misc.c                        | 165 ++++++++++
 src/lj_arch.h                         |  22 ++
 src/lj_debug.c                        |   8 +-
 src/lj_debug.h                        |   1 +
 src/lj_errmsg.h                       |   6 +
 src/lj_frame.h                        |  18 +-
 src/lj_gc.c                           |   2 +
 src/lj_obj.h                          |  13 +-
 src/lj_profile.c                      |   5 +-
 src/lj_state.c                        |   8 +
 src/lmisclib.h                        |  29 ++
 src/profile/ljp_memprof.c             | 413 ++++++++++++++++++++++++++
 src/profile/ljp_memprof.h             |  86 ++++++
 src/profile/ljp_symtab.c              |  55 ++++
 src/profile/ljp_symtab.h              |  57 ++++
 src/profile/ljp_write.c               | 195 ++++++++++++
 src/profile/ljp_write.h               |  84 ++++++
 src/utils/leb128.c                    | 124 ++++++++
 src/utils/leb128.h                    |  55 ++++
 src/vm_arm.dasc                       |   6 +-
 src/vm_arm64.dasc                     |   6 +-
 src/vm_mips.dasc                      |   6 +-
 src/vm_mips64.dasc                    |   6 +-
 src/vm_ppc.dasc                       |   6 +-
 src/vm_x64.dasc                       |  99 ++++--
 src/vm_x86.dasc                       | 137 ++++++---
 test/misclib-memprof-lapi.test.lua    | 125 ++++++++
 {src => tools}/luajit-gdb.py          |  14 +-
 tools/luajit-parse-memprof            |  20 ++
 tools/parse_memprof/bufread.lua       | 143 +++++++++
 tools/parse_memprof/main.lua          | 104 +++++++
 tools/parse_memprof/parse_memprof.lua | 195 ++++++++++++
 tools/parse_memprof/parse_symtab.lua  |  88 ++++++
 tools/parse_memprof/view_plain.lua    |  45 +++
 36 files changed, 2260 insertions(+), 116 deletions(-)
 create mode 100644 src/profile/ljp_memprof.c
 create mode 100644 src/profile/ljp_memprof.h
 create mode 100644 src/profile/ljp_symtab.c
 create mode 100644 src/profile/ljp_symtab.h
 create mode 100644 src/profile/ljp_write.c
 create mode 100644 src/profile/ljp_write.h
 create mode 100644 src/utils/leb128.c
 create mode 100644 src/utils/leb128.h
 create mode 100755 test/misclib-memprof-lapi.test.lua
 rename {src => tools}/luajit-gdb.py (98%)
 create mode 100755 tools/luajit-parse-memprof
 create mode 100644 tools/parse_memprof/bufread.lua
 create mode 100644 tools/parse_memprof/main.lua
 create mode 100644 tools/parse_memprof/parse_memprof.lua
 create mode 100644 tools/parse_memprof/parse_symtab.lua
 create mode 100644 tools/parse_memprof/view_plain.lua

-- 
2.28.0



More information about the Tarantool-patches mailing list