logger: add watchdog that boosts its priority when the writer is blocked for >1s

This is to guard against busy-looping tasks, so that we at least have a
log. In case the watchdog is triggered, it also logs CPU load of all
tasks.
This commit is contained in:
Beat Küng
2018-05-03 11:36:51 +02:00
committed by Lorenz Meier
parent 401eefd39b
commit dd30012b27
7 changed files with 285 additions and 0 deletions
+4
View File
@@ -167,7 +167,11 @@ void sched_note_resume(FAR struct tcb_s *tcb)
for (int i = 0; i < CONFIG_MAX_TASKS; i++) {
if (system_load.tasks[i].valid && system_load.tasks[i].tcb->pid == tcb->pid) {
// curr_start_time is accessed from an IRQ handler (in logger), so we need
// to make the update atomic
irqstate_t irq_state = px4_enter_critical_section();
system_load.tasks[i].curr_start_time = new_time;
px4_leave_critical_section(irq_state);
break;
}
}