Skip to content
Snippets Groups Projects
Commit 3eee469f authored by David Sidrane's avatar David Sidrane Committed by Lorenz Meier
Browse files

Display the irq stack usage on the for the init thread (pid = 0)

parent 17818011
No related branches found
No related tags found
No related merge requests found
......@@ -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 -
(uintptr_t)system_load.tasks[i].tcb->stack_alloc_ptr;
unsigned stack_free = 0;
uint8_t *stack_sweeper = (uint8_t *)system_load.tasks[i].tcb->stack_alloc_ptr;
while (stack_free < stack_size) {
if (*stack_sweeper++ != 0xff) {
break;
}
size_t stack_size = system_load.tasks[i].tcb->adj_stack_size;
ssize_t stack_free = 0;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
if (system_load.tasks[i].tcb->pid == 0) {
stack_size = (CONFIG_ARCH_INTERRUPTSTACK & ~3);
stack_free = up_check_intstack_remain();
stack_free++;
} 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) ",
clear_line,
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,
system_load.tasks[i].tcb->sched_priority,
#if CONFIG_ARCH_BOARD_SIM
#if CONFIG_ARCH_BOARD_SIM || !defined(CONFIG_PRIORITY_INHERITANCE)
0);
#else
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
/* print scheduling info with RR time slice */
dprintf(fd, " %6d\n", system_load.tasks[i].tcb->timeslice);
(void)tstate_name(TSTATE_TASK_INVALID); // Stop not used warning
#else
// print task state instead
dprintf(fd, " %-6s\n", tstate_name(system_load.tasks[i].tcb->task_state));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment