brew install qcachegrind
install erlgrind
Fun = fun() ->
random:seed(erlang:now()),
list:usort([random:uniform(100) || _ <- lists:seq(1, 1000)])
end,
fprof:trace([start, {file, "/tmp/erl_trace"}, verbose, {procs, self()}]).
Fun()
fprof:trace([stop]).
fprof:profile({file, "/tmp/erl_trace"}).
fprof:analyse({dest, "/tmp/outfile.fprof"}).
~/src/erlgrind/src/erlgrind /tmp/outfile.fprof /tmp/callgrind.out
qcachegrind /tmp/callgrind.out
fprofx basically does the same but removes the call to suspended
and lists GC.