if (tcb->pid == 0) {
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
- printf("%3d ", tcb->pid);
+ printf("%3d | ", tcb->pid);
#if defined(CONFIG_SCHED_HAVE_PARENT) && !defined(HAVE_GROUP_MEMBERS)
- printf("%4d ", tcb->ppid);
+ printf("%5d | ", tcb->ppid);
#endif
- printf("%5d %5d %5d ", tcb->adj_stack_size, tcb->curr_alloc_size, tcb->peak_alloc_size);
+ printf("%5d | %9d | %9d | ", tcb->adj_stack_size, tcb->curr_alloc_size, tcb->peak_alloc_size);
/* Show task name and arguments */
#if CONFIG_TASK_NAME_SIZE > 0
}
heapinfo_parse(user_heap, mode, pid);
- printf("\nPID ");
+ printf("\n%3s | ", "PID");
#if defined(CONFIG_SCHED_HAVE_PARENT) && !defined(HAVE_GROUP_MEMBERS)
- printf("PPID ");
+ printf("%5s | ", "PPID");
#endif
- printf("STACK HEAP Curr Peak NAME\n");
- printf("------------------------------------\n");
+ printf("%5s | %9s | %9s | %s\n", "STACK", "CURR_HEAP", "PEAK_HEAP", "NAME");
+ printf("----|");
+#if defined(CONFIG_SCHED_HAVE_PARENT) && !defined(HAVE_GROUP_MEMBERS)
+ printf("-------|");
+#endif
+ printf("-------|-----------|-----------|----------\n");
sched_foreach(kdbg_heapinfo_task, NULL);
return OK;
static void kdbg_pseach(FAR struct tcb_s *tcb, FAR void *arg)
{
- printf("%5d %4d %4s %7s %c%c %8s", tcb->pid, tcb->sched_priority, tcb->flags & TCB_FLAG_ROUND_ROBIN ? "RR " : "FIFO", kdbg_ttypenames[(tcb->flags & TCB_FLAG_TTYPE_MASK) >> TCB_FLAG_TTYPE_SHIFT], tcb->flags & TCB_FLAG_NONCANCELABLE ? 'N' : ' ', tcb->flags & TCB_FLAG_CANCEL_PENDING ? 'P' : ' ', kdbg_statenames[tcb->task_state]);
+ printf("%5d | %4d | %4s | %7s | %c%c | %8s", tcb->pid, tcb->sched_priority, tcb->flags & TCB_FLAG_ROUND_ROBIN ? "RR " : "FIFO", kdbg_ttypenames[(tcb->flags & TCB_FLAG_TTYPE_MASK) >> TCB_FLAG_TTYPE_SHIFT], tcb->flags & TCB_FLAG_NONCANCELABLE ? 'N' : ' ', tcb->flags & TCB_FLAG_CANCEL_PENDING ? 'P' : ' ', kdbg_statenames[tcb->task_state]);
#if CONFIG_TASK_NAME_SIZE > 0
- printf(" %s", tcb->name);
+ printf(" | %s", tcb->name);
#endif
printf("\n");
}
int kdbg_ps(int argc, char **args)
{
#if CONFIG_TASK_NAME_SIZE > 0
- printf("\n PID PRIO FLAG TYPE NP STATUS NAME\n");
- printf("------------------------------------------------------\n");
+ printf("\n");
+ printf(" PID | PRIO | FLAG | TYPE | NP | STATUS | NAME\n");
+ printf("------|------|------|---------|----|----------|----------\n");
#else
- printf("\n PID PRIO FLAG TYPE NP STATUS\n");
- printf("-------------------------------------\n");
+ printf("\n");
+ printf(" PID | PRIO | FLAG | TYPE | NP | STATUS\n");
+ printf("------|------|------|---------|----|--------\n");
#endif
sched_foreach(kdbg_pseach, NULL);
return 0;
static void stkmon_title_print(void)
{
#ifdef CONFIG_DEBUG_MM_HEAPINFO
- printf("%-5s %s %8s %5s %7s %7s ", "PID", "STATUS", "SIZE", "PEAK_STACK", "PEAK_HEAP", "TIME");
+ printf("%5s | %8s | %8s | %10s | %10s | %7s | ", "PID", "STATUS", "SIZE", "PEAK_STACK", "PEAK_HEAP", "TIME");
#else
- printf("%-5s %s %8s %5s %7s\n", "PID", "STATUS", "SIZE", "PEAK_STACK", "TIME");
+ printf("%5s | %8s | %8s | %10s | %10s | ", "PID", "STATUS", "SIZE", "PEAK_STACK", "TIME");
#endif
#if (CONFIG_TASK_NAME_SIZE > 0)
printf("THREAD NAME\n");
for (inactive_idx = 0; inactive_idx < CONFIG_MAX_TASKS * 2; inactive_idx++) {
if (stkmon_arr[inactive_idx].timestamp != 0) {
#ifdef CONFIG_DEBUG_MM_HEAPINFO
- printf("%5d %s %6d %9d %10d %7lld ", stkmon_arr[inactive_idx].chk_pid, "INACTIVE", stkmon_arr[inactive_idx].chk_stksize, stkmon_arr[inactive_idx].chk_peaksize, stkmon_arr[inactive_idx].chk_peakheap, (uint64_t)((systime_t)stkmon_arr[inactive_idx].timestamp));
+ printf("%5d | %8s | %8d | %10d | %10d | %7lld | ", stkmon_arr[inactive_idx].chk_pid, "INACTIVE", stkmon_arr[inactive_idx].chk_stksize, stkmon_arr[inactive_idx].chk_peaksize, stkmon_arr[inactive_idx].chk_peakheap, (uint64_t)((systime_t)stkmon_arr[inactive_idx].timestamp));
#else
- printf("%5d %s %6d %9d %7lld ", stkmon_arr[inactive_idx].chk_pid, "INACTIVE", stkmon_arr[inactive_idx].chk_stksize, stkmon_arr[inactive_idx].chk_peaksize, (uint64_t)((systime_t)stkmon_arr[inactive_idx].timestamp));
+ printf("%5d | %8s | %8d | %10d | %10lld | ", stkmon_arr[inactive_idx].chk_pid, "INACTIVE", stkmon_arr[inactive_idx].chk_stksize, stkmon_arr[inactive_idx].chk_peaksize, (uint64_t)((systime_t)stkmon_arr[inactive_idx].timestamp));
#endif
#if (CONFIG_TASK_NAME_SIZE > 0)
printf("%s\n", stkmon_arr[inactive_idx].chk_name);
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
}
#ifdef CONFIG_DEBUG_MM_HEAPINFO
- printf("%5d %s %9d %8d %10d %7lld ", tcb->pid, "ACTIVE", tcb->adj_stack_size, up_check_tcbstack(tcb), tcb->peak_alloc_size, (uint64_t)((systime_t)clock_systimer()));
+ printf("%5d | %8s | %8d | %10d | %10d | %7lld | ", tcb->pid, "ACTIVE", tcb->adj_stack_size, up_check_tcbstack(tcb), tcb->peak_alloc_size, (uint64_t)((systime_t)clock_systimer()));
#else
- printf("%5d %s %9d %8d %7lld", tcb->pid, "ACTIVE", tcb->adj_stack_size, up_check_tcbstack(tcb), (uint64_t)((systime_t)clock_systimer()));
+ printf("%5d | %8s | %8d | %10d | %10lld | ", tcb->pid, "ACTIVE", tcb->adj_stack_size, up_check_tcbstack(tcb), (uint64_t)((systime_t)clock_systimer()));
#endif
#if (CONFIG_TASK_NAME_SIZE > 0)
printf("%s\n", tcb->name);
/* Loop until we detect that there is a request to stop. */
while (stkmon_started) {
- printf("===============================================================\n");
+ printf("\n=============================================================================\n");
stkmon_title_print();
- printf("---------------------------------------------------------------\n");
+#ifdef CONFIG_DEBUG_MM_HEAPINFO
+ printf("------|----------|----------|------------|------------|---------|------------\n");
+#else
+ printf("------|----------|----------|------------|------------|------------\n");
+#endif
stkmon_inactive_check();
- printf("---------------------------------------------------------------\n");
+#ifdef CONFIG_DEBUG_MM_HEAPINFO
+ printf("------|----------|----------|------------|------------|---------|------------\n");
+#else
+ printf("------|----------|----------|------------|------------|------------\n");
+#endif
sched_foreach(stkmon_active_check, NULL);
sleep(CONFIG_STACKMONITOR_INTERVAL);
}
if (mode != HEAPINFO_SIMPLE) {
printf("****************************************************************\n");
- printf("Heap Walker Output for Heap =0x%p\n", heap);
+ printf("Heap Walker Output for Heap = 0x%p\n", heap);
printf("****************************************************************\n");
}
printf("****************************************************************\n");
printf("Heap Alloation Info- (Size in Bytes)\n");
printf("****************************************************************\n");
- printf(" MemAddr Size Owner Pid \n");
+ printf(" MemAddr | Size | Status | Owner | Pid |\n");
+ printf("----------|----------|--------|-----------|-----|\n");
}
for (node = heap->mm_heapstart[region]; node < heap->mm_heapend[region]; node = (struct mm_allocnode_s *)((char *)node + node->size)) {
/* Check if the node corresponds to an allocated memory chunk */
if ((pid == HEAPINFO_PID_NOTNEEDED || node->pid == pid) && (node->preceding & MM_ALLOC_BIT) != 0) {
if (mode == HEAPINFO_DETAIL_ALL || mode == HEAPINFO_DETAIL_PID) {
- printf("0x%x %6d %c 0x%x %3d \n", node, node->size, 'A', node->alloc_call_addr, node->pid);
+ printf("0x%x | %8d | %c | 0x%x | %3d |\n", node, node->size, 'A', node->alloc_call_addr, node->pid);
}
#if CONFIG_TASK_NAME_SIZE > 0
mxordblk = node->size;
}
if (mode == HEAPINFO_DETAIL_ALL || mode == HEAPINFO_DETAIL_FREE) {
- printf("0x%x %6d %c\n", node, node->size, 'F');
+ printf("0x%x | %8d | %c | | |\n", node, node->size, 'F');
}
}
}
printf("\nNon Scheduled Task Resources : %d\n", nonsched_resource);
if (mode != HEAPINFO_SIMPLE) {
- printf("PID SIZE\n");
- printf("----------\n");
+ printf(" PID | SIZE \n");
+ printf("-----|------\n");
for (nonsched_idx = 0; nonsched_idx < CONFIG_MAX_TASKS; nonsched_idx++) {
if (nonsched_list[nonsched_idx] != -1) {
- printf("%4d %5d\n", nonsched_list[nonsched_idx], nonsched_size[nonsched_idx]);
+ printf("%4d | %5d\n", nonsched_list[nonsched_idx], nonsched_size[nonsched_idx]);
}
}
}