aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chdebug.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-07-09 09:15:49 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-07-09 09:15:49 +0000
commitb38e1f2c96ca1940f210be9ec2de6eeb076f1a10 (patch)
treedcab0b9fdeefb08700af11750b0bee3c7f1292e2 /os/kernel/src/chdebug.c
parenta53bc3d266cae5f72c30abed0aa884ade3723192 (diff)
downloadChibiOS-b38e1f2c96ca1940f210be9ec2de6eeb076f1a10.tar.gz
ChibiOS-b38e1f2c96ca1940f210be9ec2de6eeb076f1a10.tar.bz2
ChibiOS-b38e1f2c96ca1940f210be9ec2de6eeb076f1a10.zip
Improvements to the trace buffer and other debug features.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3139 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src/chdebug.c')
-rw-r--r--os/kernel/src/chdebug.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/os/kernel/src/chdebug.c b/os/kernel/src/chdebug.c
index 3c3c34c70..208ac2a69 100644
--- a/os/kernel/src/chdebug.c
+++ b/os/kernel/src/chdebug.c
@@ -40,7 +40,7 @@
/**
* @brief Public trace buffer.
*/
-TraceBuffer trace_buffer;
+ch_trace_buffer_t ch_dbg_trace_buffer;
/**
* @brief Trace circular buffer subsystem initialization.
@@ -48,8 +48,8 @@ TraceBuffer trace_buffer;
*/
void _trace_init(void) {
- trace_buffer.tb_size = TRACE_BUFFER_SIZE;
- trace_buffer.tb_ptr = &trace_buffer.tb_buffer[0];
+ ch_dbg_trace_buffer.tb_size = CH_TRACE_BUFFER_SIZE;
+ ch_dbg_trace_buffer.tb_ptr = &ch_dbg_trace_buffer.tb_buffer[0];
}
/**
@@ -61,12 +61,13 @@ void _trace_init(void) {
*/
void chDbgTrace(Thread *otp) {
- trace_buffer.tb_ptr->cse_wtobjp = otp->p_u.wtobjp;
- trace_buffer.tb_ptr->cse_time = chTimeNow();
- trace_buffer.tb_ptr->cse_state = otp->p_state;
- trace_buffer.tb_ptr->cse_tid = (unsigned)currp >> 6;
- if (++trace_buffer.tb_ptr >= &trace_buffer.tb_buffer[TRACE_BUFFER_SIZE])
- trace_buffer.tb_ptr = &trace_buffer.tb_buffer[0];
+ ch_dbg_trace_buffer.tb_ptr->se_time = chTimeNow();
+ ch_dbg_trace_buffer.tb_ptr->se_tp = currp;
+ ch_dbg_trace_buffer.tb_ptr->se_wtobjp = otp->p_u.wtobjp;
+ ch_dbg_trace_buffer.tb_ptr->se_state = (uint8_t)otp->p_state;
+ if (++ch_dbg_trace_buffer.tb_ptr >=
+ &ch_dbg_trace_buffer.tb_buffer[CH_TRACE_BUFFER_SIZE])
+ ch_dbg_trace_buffer.tb_ptr = &ch_dbg_trace_buffer.tb_buffer[0];
}
#endif /* CH_DBG_ENABLE_TRACE */
@@ -78,7 +79,7 @@ void chDbgTrace(Thread *otp) {
* written once and then the system is halted. This variable can be
* set to @p NULL if the halt is caused by a stack overflow.
*/
-char *panic_msg;
+char *ch_dbg_panic_msg;
/**
* @brief Prints a panic message on the console and then halts the system.
@@ -87,7 +88,7 @@ char *panic_msg;
*/
void chDbgPanic(char *msg) {
- panic_msg = msg;
+ ch_dbg_panic_msg = msg;
chSysHalt();
}
#endif /* CH_DBG_ENABLE_ASSERTS || CH_DBG_ENABLE_CHECKS || CH_DBG_ENABLE_STACK_CHECK */