Record a trace event into Component Trace, LMT or system trace buffers.
#include <sys/ras_trace.h>
CT_HOOK0(ras_block_t cb, int level, int mem_dest,long hkwd);
CT_HOOK1(ras_block_t cb, int level, int mem_dest, long hkwd, long d1);
CT_HOOK2(ras_block_t cb, int level, int mem_dest, long hkwd, long d1, long d2);
CT_HOOK3(ras_block_t cb, int level, int mem_dest, long hkwd, long d1, long d2, long d3);
CT_HOOK4(ras_block_t cb, int level, \
int mem_dest, long hkwd, long d1, long d2, \
long d3, long d4);
CT_HOOK5(ras_block_t cb, int level, int mem_dest, \
long hkwd, long d1, long d2, long d3, \
long d4, long d5);
CT_GEN (ras_block_t cb, int level, long hkwd, long data, long len, void *buf);
The CT_HOOKx macros allow you to record a trace hook. The "x" is the number of data words you want in this trace event.
The CT_GEN macro is used to record a generic trace hook.
All traces are timestamped.
Item | Description |
---|---|
ras_block_t cb | The cb parameter in the RAS control block that refers 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 will be considered as debug or detail information.
In other words, this trace entry will appear only if the level of
the trace entry is less than or equal to the level of 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 four special levels:
When you are porting an existing driver or subsystem from the existing system trace to component trace, trace existing entries at CT_LVL_DEFAULT. |
int mem_dest | For CT_HOOKx macros,
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 needed for the CT_GEN macro because lightweight memory trace cannot accommodate generic entries. CT_GEN checks the memory trace and system trace levels to determine whether the generic entry should enter the private memory buffer and system trace buffers respectively. |
The hkwd, d1, d2, d3, d4, d5, len and buf parameters are the same as those used for the existing TRCHKx or TRCGEN macros. The TRCHKx refers to the TRCHKLnT macros where n is from 0 to 5. For example, TRCHKL1T (hkwd, d1). The TRCGEN macros refer to the TRCGEN and TRCGENT macros.
For the hookword, OR the hookID with a subhookID if needed. For the CT_HOOKx macro, the subhook is ORed into the hookword. For the CT_GEN macro, the subhook is the d1 parameter.