[erlang-questions] tracing function calls in a given process

Attila Rajmund Nohl attila.r.nohl@REDACTED
Wed Jul 27 21:11:08 CEST 2011


2011/7/27 Joel Reymont <joelr1@REDACTED>:
> What is the right dbg incarnation for tracing functions calls within a given process?
>
> There's
>
>    dbg:p(Pid, [all]).
>
> to trace all messages in a process. There's
>
>    dbg:tpl(M, F, dbg:fun2ms(fun(_) -> return_trace() end)),
>
> to trace all calls to a function in a given module, or
>
>    dbg:tpl(M, dbg:fun2ms(fun(_) -> return_trace() end)),
>
> to trace all function calls in a module.
>
> How do I combine the above, though?

I don't know, but if you don't find a solution, you can always write
your own trace handler - the Pid, Module and Function is there in the
trace messages, so it is possible to filter on them.



More information about the erlang-questions mailing list