blob: 5ed5b2a0c3080eff4763988d8dad634f697388cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
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}
|