Go to the documentation of this file.
39 #define CH_TRACE_TYPE_UNUSED 0U
40 #define CH_TRACE_TYPE_READY 1U
41 #define CH_TRACE_TYPE_SWITCH 2U
42 #define CH_TRACE_TYPE_ISR_ENTER 3U
43 #define CH_TRACE_TYPE_ISR_LEAVE 4U
44 #define CH_TRACE_TYPE_HALT 5U
45 #define CH_TRACE_TYPE_USER 6U
52 #define CH_DBG_TRACE_MASK_DISABLED 255U
53 #define CH_DBG_TRACE_MASK_NONE 0U
54 #define CH_DBG_TRACE_MASK_READY 1U
55 #define CH_DBG_TRACE_MASK_SWITCH 2U
56 #define CH_DBG_TRACE_MASK_ISR 4U
57 #define CH_DBG_TRACE_MASK_HALT 8U
58 #define CH_DBG_TRACE_MASK_USER 16U
59 #define CH_DBG_TRACE_MASK_SLOW (CH_DBG_TRACE_MASK_READY | \
60 CH_DBG_TRACE_MASK_SWITCH | \
61 CH_DBG_TRACE_MASK_HALT | \
62 CH_DBG_TRACE_MASK_USER)
63 #define CH_DBG_TRACE_MASK_ALL (CH_DBG_TRACE_MASK_READY | \
64 CH_DBG_TRACE_MASK_SWITCH | \
65 CH_DBG_TRACE_MASK_ISR | \
66 CH_DBG_TRACE_MASK_HALT | \
67 CH_DBG_TRACE_MASK_USER)
81 #if !defined(CH_DBG_TRACE_MASK) || defined(__DOXYGEN__)
82 #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
90 #if !defined(CH_DBG_TRACE_BUFFER_SIZE) || defined(__DOXYGEN__)
91 #define CH_DBG_TRACE_BUFFER_SIZE 128
103 #if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_DISABLED) || defined(__DOXYGEN__)
219 #if CH_DBG_TRACE_MASK == CH_DBG_TRACE_MASK_DISABLED
220 #if !defined(__trace_ready)
221 #define __trace_ready(tp, msg)
223 #if !defined(__trace_switch)
224 #define __trace_switch(ntp, otp)
226 #if !defined(__trace_isr_enter)
227 #define __trace_isr_enter(isr)
229 #if !defined(__trace_isr_leave)
230 #define __trace_isr_leave(isr)
232 #if !defined(__trace_halt)
233 #define __trace_halt(reason)
235 #if !defined(chDbgWriteTraceI)
236 #define chDbgWriteTraceI(up1, up2)
238 #if !defined(chDbgWriteTrace)
239 #define chDbgWriteTrace(up1, up2)
250 #if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_DISABLED) || defined(__DOXYGEN__)
261 void chTraceIResume(uint16_t mask);
void chTraceWriteI(void *up1, void *up2)
Adds an user trace record to the trace buffer.
#define CH_DBG_TRACE_BUFFER_SIZE
Trace buffer entries.
uint64_t systime_t
Type of system time.
void __trace_halt(const char *reason)
Inserts in the circular debug trace buffer an halt record.
const char * reason
Halt error string.
thread_t * ntp
Switched in thread.
void * up1
Trace user parameter 1.
uint16_t size
Trace buffer size (entries).
uint32_t rtstamp
Accurate time stamp.
systime_t time
System time stamp of the switch event.
Structure representing a thread.
uint32_t type
Record type.
void chTraceSuspend(uint16_t mask)
Suspends one or more trace events.
uint32_t state
Switched out thread state.
const char * name
ISR function name taken using func.
void chTraceResume(uint16_t mask)
Resumes one or more trace events.
void __trace_isr_leave(const char *isr)
Inserts in the circular debug trace buffer an ISR-leave record.
void __trace_isr_enter(const char *isr)
Inserts in the circular debug trace buffer an ISR-enter record.
void __trace_ready(thread_t *tp, msg_t msg)
Inserts in the circular debug trace buffer a ready record.
void chTraceWrite(void *up1, void *up2)
Adds an user trace record to the trace buffer.
uint16_t suspended
Suspended trace sources mask.
void __trace_object_init(trace_buffer_t *tbp)
Circular trace buffer initialization.
void * up2
Trace user parameter 2.
void * wtobjp
Object where going to sleep.
trace_event_t * ptr
Pointer to the buffer front.
void __trace_switch(thread_t *ntp, thread_t *otp)
Inserts in the circular debug trace buffer a context switch record.
void chTraceSuspendI(uint16_t mask)
Suspends one or more trace events.
thread_t * tp
Thread made ready.