diff --git a/arch/arm/src/common/arm_assert.c b/arch/arm/src/common/arm_assert.c index 8be91268143..360ff30a19d 100644 --- a/arch/arm/src/common/arm_assert.c +++ b/arch/arm/src/common/arm_assert.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -137,6 +138,7 @@ static void arm_registerdump(volatile uint32_t *regs) static void arm_dump_task(struct tcb_s *tcb, void *arg) { + char args[64] = ""; #ifdef CONFIG_STACK_COLORATION uint32_t stack_filled = 0; uint32_t stack_used; @@ -172,6 +174,26 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg) } #endif +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; + + snprintf(args, sizeof(args), "%p ", ptcb->arg); + } + else +#endif + { + FAR char **argv; + size_t npos = 0; + + for (argv = tcb->group->tg_info->argv + 1; *argv; argv++) + { + npos += strlcpy(args + npos, *argv, sizeof(args) - npos); + npos += strlcpy(args + npos, " ", sizeof(args) - npos); + } + } + /* Dump interesting properties of this task */ _alert(" %4d %4d" @@ -189,9 +211,10 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg) " %3" PRId32 ".%01" PRId32 "%%" #endif #if CONFIG_TASK_NAME_SIZE > 0 - " %s" + " %s %s\n", +#else + " %s\n", #endif - "\n", tcb->pid, tcb->sched_priority, #ifdef CONFIG_SMP tcb->cpu, @@ -210,6 +233,7 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg) #if CONFIG_TASK_NAME_SIZE > 0 , tcb->name #endif + , args ); } @@ -263,10 +287,7 @@ static void arm_showtasks(void) #ifdef CONFIG_SCHED_CPULOAD " CPU" #endif -#if CONFIG_TASK_NAME_SIZE > 0 - " COMMAND" -#endif - "\n"); + " COMMAND\n"); #if CONFIG_ARCH_INTERRUPTSTACK > 7 _alert(" ---- ----" diff --git a/arch/risc-v/src/common/riscv_assert.c b/arch/risc-v/src/common/riscv_assert.c index 3844823ce43..8c85dd35880 100644 --- a/arch/risc-v/src/common/riscv_assert.c +++ b/arch/risc-v/src/common/riscv_assert.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -137,6 +138,7 @@ static inline void riscv_registerdump(volatile uintptr_t *regs) static void riscv_dump_task(struct tcb_s *tcb, void *arg) { + char args[64] = ""; #ifdef CONFIG_STACK_COLORATION uint32_t stack_filled = 0; uint32_t stack_used; @@ -172,6 +174,26 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg) } #endif +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; + + snprintf(args, sizeof(args), "%p ", ptcb->arg); + } + else +#endif + { + FAR char **argv; + size_t npos = 0; + + for (argv = tcb->group->tg_info->argv + 1; *argv; argv++) + { + npos += strlcpy(args + npos, *argv, sizeof(args) - npos); + npos += strlcpy(args + npos, " ", sizeof(args) - npos); + } + } + /* Dump interesting properties of this task */ _alert(" %4d %4d" @@ -189,9 +211,10 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg) " %3" PRId32 ".%01" PRId32 "%%" #endif #if CONFIG_TASK_NAME_SIZE > 0 - " %s" + " %s %s\n", +#else + " %s\n", #endif - "\n", tcb->pid, tcb->sched_priority, #ifdef CONFIG_SMP tcb->cpu, @@ -210,6 +233,7 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg) #if CONFIG_TASK_NAME_SIZE > 0 , tcb->name #endif + , args ); } @@ -263,10 +287,7 @@ static inline void riscv_showtasks(void) #ifdef CONFIG_SCHED_CPULOAD " CPU" #endif -#if CONFIG_TASK_NAME_SIZE > 0 - " COMMAND" -#endif - "\n"); + " COMMAND\n"); #if CONFIG_ARCH_INTERRUPTSTACK > 15 _alert(" ---- ----" diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c index 77b478d676d..e5df7fab9b9 100644 --- a/arch/xtensa/src/common/xtensa_dumpstate.c +++ b/arch/xtensa/src/common/xtensa_dumpstate.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -52,6 +53,7 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) { + char args[64] = ""; #ifdef CONFIG_STACK_COLORATION uint32_t stack_filled = 0; uint32_t stack_used; @@ -87,6 +89,26 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) } #endif +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; + + snprintf(args, sizeof(args), "%p ", ptcb->arg); + } + else +#endif + { + FAR char **argv; + size_t npos = 0; + + for (argv = tcb->group->tg_info->argv + 1; *argv; argv++) + { + npos += strlcpy(args + npos, *argv, sizeof(args) - npos); + npos += strlcpy(args + npos, " ", sizeof(args) - npos); + } + } + /* Dump interesting properties of this task */ _alert(" %4d %4d" @@ -104,9 +126,10 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) " %3" PRId32 ".%01" PRId32 "%%" #endif #if CONFIG_TASK_NAME_SIZE > 0 - " %s" + " %s %s\n", +#else + " %s\n", #endif - "\n", tcb->pid, tcb->sched_priority, #ifdef CONFIG_SMP tcb->cpu, @@ -125,6 +148,7 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) #if CONFIG_TASK_NAME_SIZE > 0 , tcb->name #endif + , args ); } @@ -178,10 +202,7 @@ static inline void xtensa_showtasks(void) #ifdef CONFIG_SCHED_CPULOAD " CPU" #endif -#if CONFIG_TASK_NAME_SIZE > 0 - " COMMAND" -#endif - "\n"); + " COMMAND\n"); #if CONFIG_ARCH_INTERRUPTSTACK > 15 _alert(" ---- ----"