|
ChibiOS
19.1.4
|
|
System events tracing service.
Debug related settings | |
| #define | CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED |
| Trace buffer entries. More... | |
| #define | CH_DBG_TRACE_BUFFER_SIZE 128 |
| Trace buffer entries. More... | |
Data Structures | |
| struct | ch_trace_event_t |
| Trace buffer record. More... | |
| struct | ch_trace_buffer_t |
| Trace buffer header. More... | |
Functions | |
| static NOINLINE void | trace_next (void) |
| Writes a time stamp and increases the trace buffer pointer. More... | |
| void | _trace_init (void) |
| Trace circular buffer subsystem initialization. More... | |
| void | _trace_switch (thread_t *ntp, thread_t *otp) |
| Inserts in the circular debug trace buffer a context switch record. More... | |
| void | _trace_isr_enter (const char *isr) |
| Inserts in the circular debug trace buffer an ISR-enter record. More... | |
| void | _trace_isr_leave (const char *isr) |
| Inserts in the circular debug trace buffer an ISR-leave record. More... | |
| void | _trace_halt (const char *reason) |
| Inserts in the circular debug trace buffer an halt record. More... | |
| void | chDbgWriteTraceI (void *up1, void *up2) |
| Adds an user trace record to the trace buffer. More... | |
| void | chDbgWriteTrace (void *up1, void *up2) |
| Adds an user trace record to the trace buffer. More... | |
| void | chDbgSuspendTraceI (uint16_t mask) |
| Suspends one or more trace events. More... | |
| void | chDbgSuspendTrace (uint16_t mask) |
| Suspends one or more trace events. More... | |
| void | chDbgResumeTraceI (uint16_t mask) |
| Resumes one or more trace events. More... | |
| void | chDbgResumeTrace (uint16_t mask) |
| Resumes one or more trace events. More... | |
| #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED |
| #define CH_DBG_TRACE_BUFFER_SIZE 128 |
Trace buffer entries.
CH_DBG_TRACE_MASK is different from CH_DBG_TRACE_MASK_DISABLED. Definition at line 87 of file chtrace.h.
Referenced by _trace_init(), and trace_next().
|
static |
Writes a time stamp and increases the trace buffer pointer.
Definition at line 57 of file chtrace.c.
References ch_trace_buffer_t::buffer, ch, CH_CFG_TRACE_HOOK, CH_DBG_TRACE_BUFFER_SIZE, chSysGetRealtimeCounterX, chVTGetSystemTimeX, ch_system::dbg, ch_trace_buffer_t::ptr, ch_trace_event_t::rtstamp, ch_trace_event_t::time, and ch_system_debug::trace_buffer.
Referenced by _trace_halt(), _trace_isr_enter(), _trace_isr_leave(), _trace_switch(), and chDbgWriteTraceI().
| void _trace_init | ( | void | ) |
Trace circular buffer subsystem initialization.
Definition at line 85 of file chtrace.c.
References ch_trace_buffer_t::buffer, ch, CH_DBG_TRACE_BUFFER_SIZE, ch_system::dbg, ch_trace_buffer_t::ptr, ch_trace_buffer_t::size, ch_trace_buffer_t::suspended, ch_system_debug::trace_buffer, and ch_trace_event_t::type.
Referenced by chSysInit().
Inserts in the circular debug trace buffer a context switch record.
| [in] | ntp | the thread being switched in |
| [in] | otp | the thread being switched out |
Definition at line 104 of file chtrace.c.
References ch, currp, ch_system::dbg, ch_trace_buffer_t::ptr, ch_trace_event_t::state, ch_thread::state, ch_trace_buffer_t::suspended, ch_trace_event_t::sw, ch_system_debug::trace_buffer, trace_next(), ch_trace_event_t::type, ch_thread::u, and ch_thread::wtobjp.

| void _trace_isr_enter | ( | const char * | isr | ) |
Inserts in the circular debug trace buffer an ISR-enter record.
| [in] | isr | name of the isr |
Definition at line 124 of file chtrace.c.
References ch, ch_system::dbg, ch_trace_event_t::isr, port_lock_from_isr(), port_unlock_from_isr(), ch_trace_buffer_t::ptr, ch_trace_event_t::state, ch_trace_buffer_t::suspended, ch_system_debug::trace_buffer, trace_next(), and ch_trace_event_t::type.

| void _trace_isr_leave | ( | const char * | isr | ) |
Inserts in the circular debug trace buffer an ISR-leave record.
| [in] | isr | name of the isr |
Definition at line 143 of file chtrace.c.
References ch, ch_system::dbg, ch_trace_event_t::isr, port_lock_from_isr(), port_unlock_from_isr(), ch_trace_buffer_t::ptr, ch_trace_event_t::state, ch_trace_buffer_t::suspended, ch_system_debug::trace_buffer, trace_next(), and ch_trace_event_t::type.

| void _trace_halt | ( | const char * | reason | ) |
Inserts in the circular debug trace buffer an halt record.
| [in] | reason | the halt error string |
Definition at line 162 of file chtrace.c.
References ch, ch_system::dbg, ch_trace_event_t::halt, ch_trace_buffer_t::ptr, ch_trace_event_t::state, ch_trace_buffer_t::suspended, ch_system_debug::trace_buffer, trace_next(), and ch_trace_event_t::type.
Referenced by chSysHalt().

| void chDbgWriteTraceI | ( | void * | up1, |
| void * | up2 | ||
| ) |
Adds an user trace record to the trace buffer.
| [in] | up1 | user parameter 1 |
| [in] | up2 | user parameter 2 |
Definition at line 180 of file chtrace.c.
References ch, ch_system::dbg, ch_trace_buffer_t::ptr, ch_trace_event_t::state, ch_trace_buffer_t::suspended, ch_system_debug::trace_buffer, trace_next(), ch_trace_event_t::type, and ch_trace_event_t::user.
Referenced by chDbgWriteTrace().

| void chDbgWriteTrace | ( | void * | up1, |
| void * | up2 | ||
| ) |
Adds an user trace record to the trace buffer.
| [in] | up1 | user parameter 1 |
| [in] | up2 | user parameter 2 |
Definition at line 201 of file chtrace.c.
References chDbgWriteTraceI(), chSysLock, and chSysUnlock.

| void chDbgSuspendTraceI | ( | uint16_t | mask | ) |
Suspends one or more trace events.
| [in] | mask | mask of the trace events to be suspended |
Definition at line 215 of file chtrace.c.
References ch, ch_system::dbg, ch_trace_buffer_t::suspended, and ch_system_debug::trace_buffer.
Referenced by chDbgSuspendTrace().
| void chDbgSuspendTrace | ( | uint16_t | mask | ) |
Suspends one or more trace events.
| [in] | mask | mask of the trace events to be suspended |
Definition at line 229 of file chtrace.c.
References chDbgSuspendTraceI(), chSysLock, and chSysUnlock.

| void chDbgResumeTraceI | ( | uint16_t | mask | ) |
Resumes one or more trace events.
| [in] | mask | mask of the trace events to be resumed |
Definition at line 243 of file chtrace.c.
References ch, ch_system::dbg, ch_trace_buffer_t::suspended, and ch_system_debug::trace_buffer.
Referenced by chDbgResumeTrace().
| void chDbgResumeTrace | ( | uint16_t | mask | ) |
Resumes one or more trace events.
| [in] | mask | mask of the trace events to be resumed |
Definition at line 257 of file chtrace.c.
References chDbgResumeTraceI(), chSysLock, and chSysUnlock.
