HP 9000 Networking XTI Programmer's Guide

38
Using API Tracing in Your Programs
Enable API Tracing
Enable API Tracing
To enable API tracing in your program, add the following statements to your
program:
1 Include the appropriate definitions by adding these lines:
#include<api_trace.h>
extern int xti_trace;
extern int xti_trace_max_udata;
extern FILE *xti_trace_fp;
2 Within your program, enable tracing and select the level of tracing you want by
modifying the value of the xti_trace variable. For example, to enable procedure
tracing, input parameters tracing, and output parameters tracing, enter the
statement:
xti_trace=API_TR_ENTRY_EXIT | API_TR_INPUT | API_TR_OUTPUT;
3 If you want to redirect the trace output from the default file stderr, enter the
statement:
xti_trace_fp = fopen(“/tmp/my_xti_trace”, “w”);
where /tmp/my_xti_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 xti_trace_mas_udata parameter. For example, to increase the
data displayed to 256 bytes, enter:
xti_trace_max_udata = 256;