Siri Hansen (EAB)
Tue Jan 14 08:54:58 CET 2003
You can use tracing. In OTP there are several ways of doing this. Have
a look at the runtime_tools and observer(R9) applications. Here
is a very simple example using the dbg module in runtime_tools. It
produces a printout in the erlang shell when the traced function is called:
6> % start at tracer
7> % set the 'call' trace flag on all processes
8> % set a trace pattern (here ) on the function to trace
8> % First an exported function
9> % then an internal function
(<0.25.0>) call m:f()
(<0.25.0>) call m:internal()
11> % clear all trace patterns
12> % stop trace tool
runtime_tools and observer also provide functions for directing the
trace result to e.g. a file instead of the erlang shell.
See also the documentation of the trace BIF (Ref man for the erlang
module in the kernel application), and match specifications (for
setting trace patterns) in the ERTS user guide.
Anders Fluur (EAB) wrote:
> I am writing a test application and I would like to verify that the tested application makes a call: module_x:function_y()!
> Preferrably, this should be performed as a call to my testapplication.
> How can I do this without modifying the tested application?
> Best regards,
More information about the erlang-questions