Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Kernel Tracer Alternate APIs for RTKernel-32 |
Kernel TracerThe Kernel Tracer can be used to analyze the exact sequence of events within the kernel. About 32 different event types are written to a ring buffer by the kernel. Another 10 event types are reserved for the application; thus, you can also use the Tracer to analyze your application code. A trace event consists of a source object (task or interrupt handler), the originating CPU, an optional time stamp, an event identification (type RTKTraceEvent, an enumeration type declared in header file Include\Rttrace.h), and, in many cases, some supplementary information. There is, for example, the trace event tStateCurrent. It occurs whenever a task enters the state Current (i.e., a task switch takes place). As supplementary information for this event type, the task handle of the task being activated, is recorded in the trace buffer. The supplementary information of a trace event can be a task, semaphore, mailbox, spinlock, an IRQ, a pointer, a number, or a pointer to a string. Please refer to file Include\Rttrace.h for details on the trace events supported and the exact data structures used by the tracer. The variable RTKTraceBuffer contains a pointer to the trace buffer and can be inspected using a debugger. The trace buffer is supported by RTKernel-32's Debug and Standard Versions. However, the tracer will record kernel events in the trace buffer only in the Debug Version; in the Standard Version, the tracer only records user events. The default trace buffer size is 64 entries in the Debug Version and 0 entries in the Standard Version. The kernel tracer API functions of RTKernel-32 are documented in the RTKernel-32 Reference Manual.
|