[Tarantool-patches] [PATCH luajit v3 2/4] sysprof: remove `split by vmstate` option
Maxim Kokryashkin
max.kokryashkin at gmail.com
Mon Jul 31 23:30:04 MSK 2023
This option is unneeded and was never used
by anybody. There is no reason to maintain it
in the scope of refactoring.
Needed for tarantool/tarantool#8700
---
tools/sysprof.lua | 9 +--------
tools/sysprof/collapse.lua | 10 +++-------
2 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/tools/sysprof.lua b/tools/sysprof.lua
index 1afab195..22c724e9 100644
--- a/tools/sysprof.lua
+++ b/tools/sysprof.lua
@@ -6,8 +6,6 @@ local misc = require "sysprof.collapse"
local stdout, stderr = io.stdout, io.stderr
local match, gmatch = string.match, string.gmatch
-local split_by_vmstate = false
-
-- Program options.
local opt_map = {}
@@ -23,15 +21,10 @@ luajit-parse-sysprof [options] sysprof.bin
Supported options are:
--help Show this help and exit
- --split Split callchains by vmstate
]]
os.exit(0)
end
-function opt_map.split()
- split_by_vmstate = true
-end
-
-- Print error and exit with error status.
local function opterror(...)
stderr:write("luajit-parse-sysprof.lua: ERROR: ", ...)
@@ -103,7 +96,7 @@ local function dump(inputfile)
local symbols = symtab.parse(reader)
local events = sysprof.parse(reader, symbols)
- local calltree = misc.collapse(events, symbols, split_by_vmstate)
+ local calltree = misc.collapse(events, symbols)
traverse_calltree(calltree, '')
diff --git a/tools/sysprof/collapse.lua b/tools/sysprof/collapse.lua
index 3d83d5ea..ac5269ea 100755
--- a/tools/sysprof/collapse.lua
+++ b/tools/sysprof/collapse.lua
@@ -75,7 +75,7 @@ end
-- merge lua and host callchains into one callchain representing
-- transfer of control
-local function merge(event, symbols, sep_vmst)
+local function merge(event, symbols)
local cc = {}
for _,h_fr in pairs(event.host.callchain) do
@@ -98,19 +98,15 @@ local function merge(event, symbols, sep_vmst)
end
- if sep_vmst == true then
- table.insert(cc, { name = VMST_NAMES[event.lua.vmstate] })
- end
-
return cc
end
-- Collapse all the events into call tree
-function M.collapse(events, symbols, sep_vmst)
+function M.collapse(events, symbols)
local root = new_node('root', false)
for _,ev in pairs(events) do
- local callchain = merge(ev, symbols, sep_vmst)
+ local callchain = merge(ev, symbols)
local curr_node = root
for i=#callchain,1,-1 do
curr_node = insert(callchain[i].name, curr_node, false)
--
2.41.0
More information about the Tarantool-patches
mailing list