luajit-dump.el -- Emacs mode for reading jit.dump files

  • From: Luke Gorrie <luke@xxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx, "snabb-devel@xxxxxxxxxxxxxxxx" <snabb-devel@xxxxxxxxxxxxxxxx>
  • Date: Fri, 12 Dec 2014 18:19:47 +0100

Howdy!

I made a small Emacs hack to help read LuaJIT dump files. It just puts them
into a foldable tree structure (outline-mode) and can open relevant source
files at the referenced lines. The hope is to make it easier to make sense
of big dump files e.g. hundreds of thousands of lines (which seem typical
to me lately).

Screenshot:
http://lukego.tumblr.com/post/105010736106

Code:
https://github.com/SnabbCo/luajit-emacs/blob/master/luajit-dump.el

I only wrote this today so I don't have much experience with it yet. But I
wanted to post it to see if it's interesting to other people and to fish
for other tips and tricks for how people make sense of JIT behaviour in
larger programs?

I also have a jit.dump feature idea and I wonder if it would be feasible:
to have a table that spells the (partial) mapping between line numbers of
source code, byte code, IR, and machine code. So that you can jump from
(say) an IR line to the relevant source code or machine code. This
information could be cross-referenced in interesting ways e.g. to highlight
source lines that cause unsunk allocations, trace exits, trace aborts, etc
in a given trace.

I'd be happy to make use of that information if it were made available in
the trace files somehow :-).

Cheers,
-Luke

Other related posts: