You probably realize that although the trace BIFs are extremely powerful and handy, they are also very low-level and are not very user-friendly. After all, they are there to provide a base on which to build other tools such as the dbg tracer.
The dbg tracer is a text-based debugger providing a user-friendly interface to
trace_pattern BIFs, but using the tracing
principles and mechanisms introduced in the preceding section. You can use
the dbg tool as a complement to the process manager we discussed in the
section The Process Manager in Chapter 4,
especially when you are tracing on text-based terminals and do not have
access to the display or you have to divert the output. The dbg tool has a
small impact on system performance, making it a suitable candidate for
tracing large live systems.
dbg:h() call provides
you with a list of helpful functions; to find out more details about any
of these functions, you can pass their names to
dbg:h/1. The last thing you want to do when
under pressure debugging a live system after a support call in the
middle of the night is to have to look at the Erlang manual pages. The
help function always comes in handy:
dbg:h().The following help items are available: p, c - Set trace flags for processes tp, tpl, ctp, ctpl, ctpg, ltp, dtp, wtp, rtp - Manipulate trace patterns for functions n, cn, ln - Add/remove traced nodes. tracer, trace_port, trace_client, get_tracer, stop, stop_clear - Manipulate ...