Skip to content

Instantly share code, notes, and snippets.

@bokner
Last active February 10, 2017 06:12
Show Gist options
  • Save bokner/3a048454f861fc0d61acd91b76459456 to your computer and use it in GitHub Desktop.
Save bokner/3a048454f861fc0d61acd91b76459456 to your computer and use it in GitHub Desktop.
LTTng+erlang:trace for tracing function calls/returns
1> l(dyntrace).
{module,dyntrace}
2> Match = [{'_', [], [{return_trace}]}]. %% Enable return trace for functions of any arity
[{'_',[],[{return_trace}]}]
3> erlang:trace_pattern({'_','_','_'}, Match, []). %% Trace all functions
2411
4> erlang:trace(all, true, [call,{tracer,dyntrace,[]}]). %% Trace function calls with dyntrace (i.e. LTTng)
26
5> erlang:now(). %% Or whatever function call you want to trace. See the traces coming in LTTng log.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment