ACSE/Presentation and ROSE Interface Programmer's Guide

78 Chapter 5
Troubleshooting Your Application
Using ROSE API Tracing
2. Within your program, enable tracing and select the level of tracing
you want by modifying the value of the rose_trace variable. For
example, to enable procedure tracing, input parameters tracing,
output parameters tracing and error tracing, enter the statement:
rose_trace =
API_TR_ENTRY_EXIT|API_TR_INPUT|API_TR_OUTPUT|API_TR_I
NT_ERROR;
3. If you want to redirect the trace output from the default file stderr
enter the statement:
if ((rose_trace_fp=fopen(“/tmp/my_ro_trace”, “w”))
== NULL); rose_trace_fp = stderr;
where /tmp/my_ro_trace is the name of the file you choose for tracing.
4. If you want more than the first 16 bytes of data to be displayed (the
default), then modify the rose_trace_max_udata parameter. For
example to increase the data displayed to 256 bytes enter:
rose_trace_max_udata = 256;
Trace Output
ROSE tracing is included in the online ROSE program example. The
format of the trace output is consistent with the format described for A/P
tracing:
The first line indicates what function is being called and at what
time. The “->” symbol indicates procedure entry. For example:
12:54:30 -> ro_bind()
The subsequent line(s) indicate the input parameters to the function
call. The parameter name and its value are listed.
After the input parameters are displayed, the procedure exit is
shown. The time of return, and the return value are shown. The “<-”
symbol indicates procedure exit. For example:
12:54:30 <- ro_bind() NO ERRORS
Lastly, any output parameters returned by the function call are
displayed. The parameter name is listed with its value.