• R/O
  • SSH
  • HTTPS

chibios: Commit


Commit MetaInfo

Révision13138 (tree)
l'heure2019-10-23 01:25:02
Auteurgdisirio

Message de Log

(empty log message)

Change Summary

Modification

--- branches/rt7_dev/demos/STM32/RT-STM32L476-DISCOVERY/cfg/chconf.h (revision 13137)
+++ branches/rt7_dev/demos/STM32/RT-STM32L476-DISCOVERY/cfg/chconf.h (revision 13138)
@@ -511,7 +511,7 @@
511511 * @note The default is @p FALSE.
512512 */
513513 #if !defined(CH_DBG_STATISTICS)
514-#define CH_DBG_STATISTICS FALSE
514+#define CH_DBG_STATISTICS TRUE
515515 #endif
516516
517517 /**
@@ -522,7 +522,7 @@
522522 * @note The default is @p FALSE.
523523 */
524524 #if !defined(CH_DBG_SYSTEM_STATE_CHECK)
525-#define CH_DBG_SYSTEM_STATE_CHECK FALSE
525+#define CH_DBG_SYSTEM_STATE_CHECK TRUE
526526 #endif
527527
528528 /**
@@ -533,7 +533,7 @@
533533 * @note The default is @p FALSE.
534534 */
535535 #if !defined(CH_DBG_ENABLE_CHECKS)
536-#define CH_DBG_ENABLE_CHECKS FALSE
536+#define CH_DBG_ENABLE_CHECKS TRUE
537537 #endif
538538
539539 /**
@@ -545,7 +545,7 @@
545545 * @note The default is @p FALSE.
546546 */
547547 #if !defined(CH_DBG_ENABLE_ASSERTS)
548-#define CH_DBG_ENABLE_ASSERTS FALSE
548+#define CH_DBG_ENABLE_ASSERTS TRUE
549549 #endif
550550
551551 /**
@@ -555,7 +555,7 @@
555555 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
556556 */
557557 #if !defined(CH_DBG_TRACE_MASK)
558-#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
558+#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_ALL
559559 #endif
560560
561561 /**
@@ -578,7 +578,7 @@
578578 * @p panic_msg variable set to @p NULL.
579579 */
580580 #if !defined(CH_DBG_ENABLE_STACK_CHECK)
581-#define CH_DBG_ENABLE_STACK_CHECK FALSE
581+#define CH_DBG_ENABLE_STACK_CHECK TRUE
582582 #endif
583583
584584 /**
@@ -590,7 +590,7 @@
590590 * @note The default is @p FALSE.
591591 */
592592 #if !defined(CH_DBG_FILL_THREADS)
593-#define CH_DBG_FILL_THREADS FALSE
593+#define CH_DBG_FILL_THREADS TRUE
594594 #endif
595595
596596 /**
--- branches/rt7_dev/os/rt/src/chschd.c (revision 13137)
+++ branches/rt7_dev/os/rt/src/chschd.c (revision 13138)
@@ -363,11 +363,16 @@
363363 (tp->state != CH_STATE_FINAL),
364364 "invalid state");
365365
366+ /* Tracing the event.*/
367+ __trace_ready(tp, tp->u.rdymsg);
368+
369+ /* Scanning ready list.*/
366370 tp->state = CH_STATE_READY;
367371 cp = (thread_t *)&oip->rlist.queue;
368372 do {
369373 cp = cp->queue.next;
370374 } while (cp->prio >= tp->prio);
375+
371376 /* Insertion on prev.*/
372377 tp->queue.next = cp;
373378 tp->queue.prev = cp->queue.prev;
@@ -404,11 +409,16 @@
404409 chDbgAssert(tp->owner == currcore, "invalid core");
405410 #endif
406411
412+ /* Tracing the event.*/
413+ __trace_ready(tp, tp->u.rdymsg);
414+
415+ /* Scanning ready list.*/
407416 tp->state = CH_STATE_READY;
408417 cp = (thread_t *)&currcore->rlist.queue;
409418 do {
410419 cp = cp->queue.next;
411420 } while (cp->prio > tp->prio);
421+
412422 /* Insertion on prev.*/
413423 tp->queue.next = cp;
414424 tp->queue.prev = cp->queue.prev;
--- branches/rt7_dev/os/rt/src/chtrace.c (revision 13137)
+++ branches/rt7_dev/os/rt/src/chtrace.c (revision 13138)
@@ -54,21 +54,21 @@
5454 *
5555 * @notapi
5656 */
57-static NOINLINE void trace_next(void) {
57+static NOINLINE void trace_next(os_instance_t *oip) {
5858
59- currcore->trace_buffer.ptr->time = chVTGetSystemTimeX();
59+ oip->trace_buffer.ptr->time = chVTGetSystemTimeX();
6060 #if PORT_SUPPORTS_RT == TRUE
61- currcore->trace_buffer.ptr->rtstamp = chSysGetRealtimeCounterX();
61+ oip->trace_buffer.ptr->rtstamp = chSysGetRealtimeCounterX();
6262 #else
63- currcore->trace_buffer.ptr->rtstamp = (rtcnt_t)0;
63+ oip->trace_buffer.ptr->rtstamp = (rtcnt_t)0;
6464 #endif
6565
6666 /* Trace hook, useful in order to interface debug tools.*/
6767 CH_CFG_TRACE_HOOK(ch.trace_buffer.ptr);
6868
69- if (++currcore->trace_buffer.ptr >=
70- &currcore->trace_buffer.buffer[CH_DBG_TRACE_BUFFER_SIZE]) {
71- currcore->trace_buffer.ptr = &currcore->trace_buffer.buffer[0];
69+ if (++oip->trace_buffer.ptr >=
70+ &oip->trace_buffer.buffer[CH_DBG_TRACE_BUFFER_SIZE]) {
71+ oip->trace_buffer.ptr = &oip->trace_buffer.buffer[0];
7272 }
7373 }
7474 #endif
@@ -103,16 +103,45 @@
103103 */
104104 void __trace_ready(thread_t *tp, msg_t msg) {
105105
106+#if CH_CFG_LOOSE_INSTANCES == FALSE
107+ if ((tp->owner->trace_buffer.suspended & CH_DBG_TRACE_MASK_READY) == 0U) {
108+ tp->owner->trace_buffer.ptr->type = CH_TRACE_TYPE_READY;
109+ tp->owner->trace_buffer.ptr->state = (uint8_t)tp->state;
110+ tp->owner->trace_buffer.ptr->u.rdy.tp = tp;
111+ tp->owner->trace_buffer.ptr->u.rdy.msg = msg;
112+ trace_next(tp->owner);
113+ }
114+#else
106115 if ((currcore->trace_buffer.suspended & CH_DBG_TRACE_MASK_READY) == 0U) {
107116 currcore->trace_buffer.ptr->type = CH_TRACE_TYPE_READY;
108117 currcore->trace_buffer.ptr->state = (uint8_t)tp->state;
109118 currcore->trace_buffer.ptr->u.rdy.tp = tp;
110119 currcore->trace_buffer.ptr->u.rdy.msg = msg;
111- trace_next();
120+ trace_next(currcore);
112121 }
122+#endif
113123 }
114124
115125 /**
126+ * @brief Inserts in the circular debug trace buffer a ready record.
127+ *
128+ * @param[in] tp the thread that just become ready
129+ * @param[in] msg the thread ready message
130+ *
131+ * @notapi
132+ */
133+void __trace_ready_other(thread_t *tp, msg_t msg) {
134+
135+ if ((currcore->trace_buffer.suspended & CH_DBG_TRACE_MASK_READY) == 0U) {
136+ currcore->trace_buffer.ptr->type = CH_TRACE_TYPE_READY;
137+ currcore->trace_buffer.ptr->state = (uint8_t)tp->state;
138+ currcore->trace_buffer.ptr->u.rdy.tp = tp;
139+ currcore->trace_buffer.ptr->u.rdy.msg = msg;
140+ trace_next(currcore);
141+ }
142+}
143+
144+/**
116145 * @brief Inserts in the circular debug trace buffer a context switch record.
117146 *
118147 * @param[in] ntp the thread being switched in
@@ -129,7 +158,7 @@
129158 currcore->trace_buffer.ptr->state = (uint8_t)otp->state;
130159 currcore->trace_buffer.ptr->u.sw.ntp = currthread;
131160 currcore->trace_buffer.ptr->u.sw.wtobjp = otp->u.wtobjp;
132- trace_next();
161+ trace_next(currcore);
133162 }
134163 }
135164
@@ -147,7 +176,7 @@
147176 currcore->trace_buffer.ptr->type = CH_TRACE_TYPE_ISR_ENTER;
148177 currcore->trace_buffer.ptr->state = 0U;
149178 currcore->trace_buffer.ptr->u.isr.name = isr;
150- trace_next();
179+ trace_next(currcore);
151180 port_unlock_from_isr();
152181 }
153182 }
@@ -166,7 +195,7 @@
166195 currcore->trace_buffer.ptr->type = CH_TRACE_TYPE_ISR_LEAVE;
167196 currcore->trace_buffer.ptr->state = 0U;
168197 currcore->trace_buffer.ptr->u.isr.name = isr;
169- trace_next();
198+ trace_next(currcore);
170199 port_unlock_from_isr();
171200 }
172201 }
@@ -184,7 +213,7 @@
184213 currcore->trace_buffer.ptr->type = CH_TRACE_TYPE_HALT;
185214 currcore->trace_buffer.ptr->state = 0;
186215 currcore->trace_buffer.ptr->u.halt.reason = reason;
187- trace_next();
216+ trace_next(currcore);
188217 }
189218 }
190219
@@ -205,7 +234,7 @@
205234 currcore->trace_buffer.ptr->state = 0;
206235 currcore->trace_buffer.ptr->u.user.up1 = up1;
207236 currcore->trace_buffer.ptr->u.user.up2 = up2;
208- trace_next();
237+ trace_next(currcore);
209238 }
210239 }
211240
Afficher sur ancien navigateur de dépôt.