Purpose
This function creates a trace data object and returns a handle to it. This
trace handle can be used in your program to log trace information to trace
files. The trace information is supplied in a buffer passed on cwbSV_LogTraceData()
calls.
Syntax
unsigned int CWB_ENTRY cwbSV_CreateTraceDataHandle(
char *productID,
char *componentID,
cwbSV_TraceDataHandle *traceDataHandle);
Parameters
- char * productID - input
- Points to a null-terminated string that contains a product identifier
to be used on this message entry. Parameter is optional, if null, no productID
is set. NOTE: A maximum of CWBSV_MAX_PRODUCT_ID characters will be logged
for the product ID. Larger strings will be truncated.
- char * componentID - input
- Points to a null-terminated string that contains a component identifier
to be used on this message entry. Parameter is optional, if null, no componentID
is set. NOTE: A maximum of CWBSV_MAX_COMP_ID characters will be logged for
the component ID. Larger strings will be truncated.
- cwbSV_TraceDataHandle * traceDataHandle - input/output
- Pointer to a cwbSV_TraceDataHandle where the handle will be returned.
This handle should be used in subsequent calls to the trace data functions.
Return Codes
The following list shows common return values.
- CWB_OK
- Successful completion.
- CWB_INVALID_POINTER
- NULL passed on output parameter.
- CWB_NOT_ENOUGH_MEMORY
- Insufficient memory to create handle.
Usage
It is recommended that you set a unique product ID and component ID in
the trace data handle before using it to log trace entries. These ID's will
distinguish your trace entries from other entries in the trace file.