mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 17:33:34 +08:00
Display the irq stack usage on the for the init thread (pid = 0)
This commit is contained in:
committed by
Lorenz Meier
parent
1781801151
commit
3eee469fbc
@@ -251,19 +251,23 @@ void print_load(uint64_t t, int fd, struct print_load_s *print_state)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned stack_size = (uintptr_t)system_load.tasks[i].tcb->adj_stack_ptr -
|
size_t stack_size = system_load.tasks[i].tcb->adj_stack_size;
|
||||||
(uintptr_t)system_load.tasks[i].tcb->stack_alloc_ptr;
|
ssize_t stack_free = 0;
|
||||||
unsigned stack_free = 0;
|
|
||||||
uint8_t *stack_sweeper = (uint8_t *)system_load.tasks[i].tcb->stack_alloc_ptr;
|
|
||||||
|
|
||||||
while (stack_free < stack_size) {
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
if (*stack_sweeper++ != 0xff) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
stack_free++;
|
if (system_load.tasks[i].tcb->pid == 0) {
|
||||||
|
stack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
|
||||||
|
stack_free = up_check_intstack_remain();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
#endif
|
||||||
|
stack_free = up_check_tcbstack_remain(system_load.tasks[i].tcb);
|
||||||
|
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
dprintf(fd, "%s%4d %*-s %8lld %2d.%03d %5u/%5u %3u (%3u) ",
|
dprintf(fd, "%s%4d %*-s %8lld %2d.%03d %5u/%5u %3u (%3u) ",
|
||||||
clear_line,
|
clear_line,
|
||||||
system_load.tasks[i].tcb->pid,
|
system_load.tasks[i].tcb->pid,
|
||||||
@@ -274,7 +278,7 @@ void print_load(uint64_t t, int fd, struct print_load_s *print_state)
|
|||||||
stack_size - stack_free,
|
stack_size - stack_free,
|
||||||
stack_size,
|
stack_size,
|
||||||
system_load.tasks[i].tcb->sched_priority,
|
system_load.tasks[i].tcb->sched_priority,
|
||||||
#if CONFIG_ARCH_BOARD_SIM
|
#if CONFIG_ARCH_BOARD_SIM || !defined(CONFIG_PRIORITY_INHERITANCE)
|
||||||
0);
|
0);
|
||||||
#else
|
#else
|
||||||
system_load.tasks[i].tcb->base_priority);
|
system_load.tasks[i].tcb->base_priority);
|
||||||
@@ -283,6 +287,7 @@ void print_load(uint64_t t, int fd, struct print_load_s *print_state)
|
|||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
/* print scheduling info with RR time slice */
|
/* print scheduling info with RR time slice */
|
||||||
dprintf(fd, " %6d\n", system_load.tasks[i].tcb->timeslice);
|
dprintf(fd, " %6d\n", system_load.tasks[i].tcb->timeslice);
|
||||||
|
(void)tstate_name(TSTATE_TASK_INVALID); // Stop not used warning
|
||||||
#else
|
#else
|
||||||
// print task state instead
|
// print task state instead
|
||||||
dprintf(fd, " %-6s\n", tstate_name(system_load.tasks[i].tcb->task_state));
|
dprintf(fd, " %-6s\n", tstate_name(system_load.tasks[i].tcb->task_state));
|
||||||
|
|||||||
Reference in New Issue
Block a user