Go to the documentation of this file.
39 #define CH_TRACE_TYPE_UNUSED 0U
40 #define CH_TRACE_TYPE_SWITCH 1U
41 #define CH_TRACE_TYPE_ISR_ENTER 2U
42 #define CH_TRACE_TYPE_ISR_LEAVE 3U
43 #define CH_TRACE_TYPE_HALT 4U
44 #define CH_TRACE_TYPE_USER 5U
51 #define CH_DBG_TRACE_MASK_DISABLED 255U
52 #define CH_DBG_TRACE_MASK_NONE 0U
53 #define CH_DBG_TRACE_MASK_SWITCH 1U
54 #define CH_DBG_TRACE_MASK_ISR 2U
55 #define CH_DBG_TRACE_MASK_HALT 4U
56 #define CH_DBG_TRACE_MASK_USER 8U
57 #define CH_DBG_TRACE_MASK_SLOW (CH_DBG_TRACE_MASK_SWITCH | \
58 CH_DBG_TRACE_MASK_HALT | \
59 CH_DBG_TRACE_MASK_USER)
60 #define CH_DBG_TRACE_MASK_ALL (CH_DBG_TRACE_MASK_SWITCH | \
61 CH_DBG_TRACE_MASK_ISR | \
62 CH_DBG_TRACE_MASK_HALT | \
63 CH_DBG_TRACE_MASK_USER)
77 #if !defined(CH_DBG_TRACE_MASK) || defined(__DOXYGEN__)
78 #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
86 #if !defined(CH_DBG_TRACE_BUFFER_SIZE) || defined(__DOXYGEN__)
87 #define CH_DBG_TRACE_BUFFER_SIZE 128
99 #if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_DISABLED) || defined(__DOXYGEN__)
202 #if CH_DBG_TRACE_MASK == CH_DBG_TRACE_MASK_DISABLED
203 #if !defined(_trace_init)
204 #define _trace_init()
206 #if !defined(_trace_switch)
207 #define _trace_switch(ntp, otp)
209 #if !defined(_trace_isr_enter)
210 #define _trace_isr_enter(isr)
212 #if !defined(_trace_isr_leave)
213 #define _trace_isr_leave(isr)
215 #if !defined(_trace_halt)
216 #define _trace_halt(reason)
218 #if !defined(chDbgWriteTraceI)
219 #define chDbgWriteTraceI(up1, up2)
221 #if !defined(chDbgWriteTrace)
222 #define chDbgWriteTrace(up1, up2)
233 #if (CH_DBG_TRACE_MASK != CH_DBG_TRACE_MASK_DISABLED) || defined(__DOXYGEN__)
ch_trace_event_t * ptr
Pointer to the buffer front.
uint16_t size
Trace buffer size (entries).
#define CH_DBG_TRACE_BUFFER_SIZE
Trace buffer entries.
uint64_t systime_t
Type of system time.
void _trace_isr_enter(const char *isr)
Inserts in the circular debug trace buffer an ISR-enter record.
void * wtobjp
Object where going to sleep.
void * up2
Trace user parameter 2.
thread_t * ntp
Switched in thread.
void chDbgWriteTraceI(void *up1, void *up2)
Adds an user trace record to the trace buffer.
void _trace_init(void)
Trace circular buffer subsystem initialization.
systime_t time
System time stamp of the switch event.
void chDbgSuspendTraceI(uint16_t mask)
Suspends one or more trace events.
uint32_t type
Record type.
const char * name
ISR function name taken using func.
Structure representing a thread.
void chDbgSuspendTrace(uint16_t mask)
Suspends one or more trace events.
uint32_t rtstamp
Accurate time stamp.
const char * reason
Halt error string.
void _trace_halt(const char *reason)
Inserts in the circular debug trace buffer an halt record.
void chDbgResumeTraceI(uint16_t mask)
Resumes one or more trace events.
uint32_t state
Switched out thread state.
uint16_t suspended
Suspended trace sources mask.
void * up1
Trace user parameter 1.
void chDbgResumeTrace(uint16_t mask)
Resumes one or more trace events.
void _trace_switch(thread_t *ntp, thread_t *otp)
Inserts in the circular debug trace buffer a context switch record.
void chDbgWriteTrace(void *up1, void *up2)
Adds an user trace record to the trace buffer.
void _trace_isr_leave(const char *isr)
Inserts in the circular debug trace buffer an ISR-leave record.