Record a trace event into component serialized Component Trace, Lightweight Memory Trace (LMT), or system trace buffers.
The following set of macros is provided to record a trace entry:
#include <sys/ras_trace.h>
CTCS_HOOK0(ras_block_t cb, int level, int mem_dest, long hkwd);
CTCS_HOOK1(ras_block_t cb, int level, int mem_dest, long hkwd, long d1);
CTCS_HOOK2(ras_block_t cb, int level, int mem_dest, long hkwd, long d1, long d2);
CTCS_HOOK3(ras_block_t cb, int level, int mem_dest, long hkwd, long d1, long d2, long d3);
CTCS_HOOK4(ras_block_t cb, int level, int mem_dest, long hkwd, long d1, long d2, long d3, long d4);
CTCS_HOOK5(ras_block_t cb, int level, int mem_dest, long hkwd, long d1, long d2, long d3, long d4,
long d5);
The CTCS_HOOKx macros record a trace hook in to a Component Trace buffer that is component-serialized. These macros cannot be used with buffers that are not component-serialized. The x in CTCS_HOOKx is the number of data words you want in this trace event.
All of the traces that are recorded are time-stamped.
If the cb input parameter contains a value of RAS_BLOCK_NULL, no tracing is performed.
Item | Description |
---|---|
ras_block_t cb | The cb parameter is the RAS control block that links to the component that this trace entry belongs to. |
int level | The level parameter
allows filtering of different trace entries. The higher this level
is, the more this trace is considered as debug or detail information.
This trace entry is displayed only if the level of the trace entry
is less than or equal to the level of the trace chosen for memory
or system trace mode. Ten levels of trace are available (CT_LEVEL_0 to CT_LEVEL_9, corresponding to value 0 to 9) with the following special levels:
When you are porting an existing driver or subsystem from the existing system trace to a component trace, existing entries should be traced at the CT_LVL_DEFAULT level. |
int mem_dest | The mem_dest parameter
indicates the memory destination for this trace entry. It is an ORed
value with the following possible settings:
Only one of the MT_RARE, MT_COMMON, and MT_PRIV values should be used, but you can combine ORed with MT_SYSTEM. Otherwise, the trace entry will be duplicated in several memory buffers. The mem_dest parameter is not necessary for the CT_GEN macro because Lightweight Memory Trace cannot accommodate generic entries. The CT_GEN macro checks the memory trace and system trace levels to determine whether the generic entry should enter the private memory buffer and the system trace buffers respectively. |
The hkwd, d1, d2, d3, d4, and d5 parameters are the same as those used for the existing TRCHKx macros. The TRCHKx macros link to the TRCHKLnT macros where n is from 0 to 5. For example, TRCHKL1T (hkwd, d1).