summaryrefslogtreecommitdiff
path: root/client/profile.lua
diff options
context:
space:
mode:
Diffstat (limited to 'client/profile.lua')
-rw-r--r--client/profile.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/profile.lua b/client/profile.lua
new file mode 100644
index 0000000..e7eab02
--- /dev/null
+++ b/client/profile.lua
@@ -0,0 +1,12 @@
+local profile = require"jit.profile"
+local function start(period,file)
+ local function cb(thread,samples,vmstate)
+ file:write(profile.dumpstack(thread,"pF l;",-100), vmstate, " ", samples, "\n")
+ end
+ profile.start("vli"..tonumber(period), cb)
+end
+local function stop() profile.stop() end
+
+
+return {start=start,stop=stop}
+