Skip to content

Commit c56f565

Browse files
committed
os/kernel: Update sysdbg availabe in current TizenRT
- Modified sysdbg structures to support multiple CPUs by adding arrays for scheduling and IRQ history. - Modified sysdbg_print to display task and IRQ scheduling history per CPU. - Modified sysdbg to use spin_lock_irqsave() instead of enter_critical_section(), because enter_critical_section makes recursive call. - enter_critical_section() -> up_cpu_paused_restore() -> up_restoretask() -> save_task_scheduling_status() -> enter_critical_section() - spin_lock_irqsave blocks interrupt and provides SMP-safe protection for sysdbg_struct without the enter_critical_section() - Modified to call blocking functions(lldbg, kmm_free, kmm_zalloc) outside of spinlock to avoid deadlock. - This patch makes sysdbg available in current TizenRT system. Signed-off-by: seokhun-eom <seokhun.eom@samsung.com>
1 parent 71fa807 commit c56f565

File tree

2 files changed

+565
-147
lines changed

2 files changed

+565
-147
lines changed

os/include/tinyara/debug/sysdbg.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,23 @@ typedef enum sem_status_s sem_status_t;
102102

103103
struct sysdbg_s {
104104
#ifdef CONFIG_TASK_SCHED_HISTORY
105+
#ifdef CONFIG_SMP
106+
sched_history_t *sched[CONFIG_SMP_NCPUS];
107+
int task_lastindex[CONFIG_SMP_NCPUS];
108+
#else
105109
sched_history_t *sched;
106110
int task_lastindex;
107111
#endif
112+
#endif
108113
#ifdef CONFIG_IRQ_SCHED_HISTORY
114+
#ifdef CONFIG_SMP
115+
irq_history_t *irq[CONFIG_SMP_NCPUS];
116+
int irq_lastindex[CONFIG_SMP_NCPUS];
117+
#else
109118
irq_history_t *irq;
110119
int irq_lastindex;
111120
#endif
121+
#endif
112122
#ifdef CONFIG_SEMAPHORE_HISTORY
113123
sem_history_t *sem_log;
114124
int sem_lastindex;

0 commit comments

Comments
 (0)