Generate a call graph of Lua programs.
syntax: graph.capture(name)
Starts capturing the call graph from that point in the program.
syntax: graph.emit(name, filename)
Emits the captured call graph named name
into the DOT file filename
.
Given the Lua code below
local graph = require"graph"
function a()
b()
end
function b()
c()
print()
end
function c()
d()
end
function d()
print("")
end
graph.capture("g")
a()
graph.emit("g", "graph.dot")
the library outputs the following call graph: