diff options
author | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
commit | 84adefa331c4159d432d22840663c38f155cd4c1 (patch) | |
tree | bff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/odbc/src/odbc_debug.erl | |
download | otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2 otp-84adefa331c4159d432d22840663c38f155cd4c1.zip |
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/odbc/src/odbc_debug.erl')
-rw-r--r-- | lib/odbc/src/odbc_debug.erl | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/odbc/src/odbc_debug.erl b/lib/odbc/src/odbc_debug.erl new file mode 100644 index 0000000000..a2e5e5dff3 --- /dev/null +++ b/lib/odbc/src/odbc_debug.erl @@ -0,0 +1,43 @@ +%%%------------------------------------------------------------------- +%%% File : odbc_debug.erl +%%% Author : Ingela Anderton Andin <[email protected]> +%%% Description : Issuse standard tracing on an odbc connection process +%%% +%%% Created : 12 Dec 2003 by Ingela Anderton Andin <[email protected]> +%%%------------------------------------------------------------------- +-module(odbc_debug). + +-export([trace_odbc/2]). + +%%%======================================================================== +%%% Debug functions +%%%======================================================================== + +%%-------------------------------------------------------------------------- +%% trace_odbc(Process, OnOff, <Level>) -> ok +%% Process - pid() | Name | {global, Name} | {Name, Node} +%% OnOff - on | off +%% Level - exported | all +%% Description: Turns on tracing of messages sent and recived by +%% the server <Process> and tracing on all, or all exported +%% functions, according to level <Level>, in this module. +%% Result will be printed on stdout. +%%-------------------------------------------------------------------------- +trace_odbc(Process, OnOff) -> + trace_odbc(Process, OnOff, exported). + +trace_odbc(Process, on, exported) -> + dbg:tracer(), + dbg:tp(odbc, [{'_', [], [{return_trace}]}]), + dbg:p(Process, [call, m]), + ok; + +trace_odbc(Process, on, all) -> + dbg:tracer(), + dbg:tpl(odbc, [{'_', [], [{return_trace}]}]), + dbg:p(Process, [call, m]), + ok; + +trace_odbc(_Process, off, _Level) -> + dbg:stop(), + ok. |