lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

It should be easy to combine the two to get a stack dump and timing
information to produce those flame graphs
( everybody seems to be
producing nowadays.

Many thanks for this link -- that's exactly the sort of reference I was fishing for when I mentioned "reverse engineering the .vsp format".  I assumed *someone* must have generated a full-featured tool for inspecting generic instrumentation data; and it looks like Brendan has done exactly that (in Perl / SVG).  I will steal his code happily :)

Do it in Lua, profile and then decide if you need to modify the Lua interpeter.

Your advice is very reasonable, of course.  But, I'm afraid I have already started down this dark path -- and it looks like writing a data collector that hooks in via luaD_poscall and luaD_precall is going to suit my own purposes nicely ;)  (Functionally, there's really not much difference between this approach and the debug.sethook(hook,"cr") template code you posted -- but working in C++ lets me keep the instrumentation overhead a bit lower.)