Skip to content

Instantly share code, notes, and snippets.

@jvantuyl
Created January 4, 2010 14:28
Show Gist options
  • Save jvantuyl/268539 to your computer and use it in GitHub Desktop.
Save jvantuyl/268539 to your computer and use it in GitHub Desktop.
% Start a tracer
dbg:tracer().
% Tell it to trace the current process and its children
dbg:p(self(), [c,sos]).
% Tell it to trace our test function
dbg:tpl(testmod,test,2,[]). % Tells it to trace testmod:test/2
% Call module to see test message
testmod:test(1,2).
% Note that it shows the parameters. You can trace my_server:handle_call to see state of calls.
% You can also trace a great many other things besides just calls. Very handy. See the dbg docs.
% If you want to go really crazy, the ET module has facilities to graphically inspect traces. Have fun!
-module(testmod).
-export([test/2]).
test(_A,_B) -> ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment