Elias Hogstvedt
2014-09-04 02:09:20 UTC
I wrote a profiler for my project using the low level one included in
luajit. In addition to that I wrote something to show trace abort reasons
with jit.attach and then have it show why functions called the most
wouldn't compile.
Using these two together seems to often make the abort reason 0 (error
thrown or hook called during recording)
All I'm doing in callbacks is this:
---------------------------------------------------------------------------------------------
local function profiler_callback(thread, samples, vmstate)
local str = jit_profiler.dumpstack(thread, "pl\n", 10)
table.insert(profiler.raw_data.statistical, {str, samples})
end
local function trace_dump_callback(what, trace_id, func, pc,
trace_error_id, trace_error_arg)
if what == "abort" then
local info = jit_util.funcinfo(func, pc)
table.insert(profiler.raw_data.trace_aborts, {info, trace_error_id,
trace_error_arg})
end
end
---------------------------------------------------------------------------------------------
Then I handle the rest of the data when I ask for status (although I should
probably do it every now and then so the tables don't get too big)
Roughly according to the frametime it seems as if things are getting
compiled anyway.
Is this a bug?
luajit. In addition to that I wrote something to show trace abort reasons
with jit.attach and then have it show why functions called the most
wouldn't compile.
Using these two together seems to often make the abort reason 0 (error
thrown or hook called during recording)
All I'm doing in callbacks is this:
---------------------------------------------------------------------------------------------
local function profiler_callback(thread, samples, vmstate)
local str = jit_profiler.dumpstack(thread, "pl\n", 10)
table.insert(profiler.raw_data.statistical, {str, samples})
end
local function trace_dump_callback(what, trace_id, func, pc,
trace_error_id, trace_error_arg)
if what == "abort" then
local info = jit_util.funcinfo(func, pc)
table.insert(profiler.raw_data.trace_aborts, {info, trace_error_id,
trace_error_arg})
end
end
---------------------------------------------------------------------------------------------
Then I handle the rest of the data when I ask for status (although I should
probably do it every now and then so the tables don't get too big)
Roughly according to the frametime it seems as if things are getting
compiled anyway.
Is this a bug?