From 9cffc105c8cb56dae2bd791821cf09aada569559 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Wed, 23 Mar 2022 15:17:02 +0800 Subject: [PATCH] arch: Show assigned cpu in dump task Signed-off-by: Huang Qi --- arch/arm/src/common/arm_assert.c | 12 ++++++++++++ arch/risc-v/src/common/riscv_assert.c | 12 ++++++++++++ arch/xtensa/src/common/xtensa_dumpstate.c | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/arch/arm/src/common/arm_assert.c b/arch/arm/src/common/arm_assert.c index e3da777c3a9..ee6306170d1 100644 --- a/arch/arm/src/common/arm_assert.c +++ b/arch/arm/src/common/arm_assert.c @@ -165,6 +165,9 @@ static void arm_dump_task(FAR struct tcb_s *tcb, FAR void *arg) /* Dump interesting properties of this task */ _alert(" %4d %4d" +#ifdef CONFIG_SMP + " %4d" +#endif #ifdef CONFIG_STACK_COLORATION " %7lu" #endif @@ -180,6 +183,9 @@ static void arm_dump_task(FAR struct tcb_s *tcb, FAR void *arg) #endif "\n", tcb->pid, tcb->sched_priority, +#ifdef CONFIG_SMP + tcb->cpu, +#endif #ifdef CONFIG_STACK_COLORATION (unsigned long)up_check_tcbstack(tcb), #endif @@ -234,6 +240,9 @@ static void arm_showtasks(void) /* Dump interesting properties of each task in the crash environment */ _alert(" PID PRI" +#ifdef CONFIG_SMP + " CPU" +#endif #ifdef CONFIG_STACK_COLORATION " USED" #endif @@ -251,6 +260,9 @@ static void arm_showtasks(void) #if CONFIG_ARCH_INTERRUPTSTACK > 7 _alert(" ---- ----" +# ifdef CONFIG_SMP + " ----" +# endif # ifdef CONFIG_STACK_COLORATION " %7lu" # endif diff --git a/arch/risc-v/src/common/riscv_assert.c b/arch/risc-v/src/common/riscv_assert.c index d0c0416241d..25e4b4bec23 100644 --- a/arch/risc-v/src/common/riscv_assert.c +++ b/arch/risc-v/src/common/riscv_assert.c @@ -175,6 +175,9 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg) /* Dump interesting properties of this task */ _alert(" %4d %4d" +#ifdef CONFIG_SMP + " %4d" +#endif #ifdef CONFIG_STACK_COLORATION " %7lu" #endif @@ -190,6 +193,9 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg) #endif "\n", tcb->pid, tcb->sched_priority, +#ifdef CONFIG_SMP + tcb->cpu, +#endif #ifdef CONFIG_STACK_COLORATION (unsigned long)up_check_tcbstack(tcb), #endif @@ -244,6 +250,9 @@ static inline void riscv_showtasks(void) /* Dump interesting properties of each task in the crash environment */ _alert(" PID PRI" +#ifdef CONFIG_SMP + " CPU" +#endif #ifdef CONFIG_STACK_COLORATION " USED" #endif @@ -261,6 +270,9 @@ static inline void riscv_showtasks(void) #if CONFIG_ARCH_INTERRUPTSTACK > 15 _alert(" ---- ----" +# ifdef CONFIG_SMP + " ----" +# endif # ifdef CONFIG_STACK_COLORATION " %7lu" # endif diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c index f5869f5a77e..1b9e59fcd52 100644 --- a/arch/xtensa/src/common/xtensa_dumpstate.c +++ b/arch/xtensa/src/common/xtensa_dumpstate.c @@ -90,6 +90,9 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) /* Dump interesting properties of this task */ _alert(" %4d %4d" +#ifdef CONFIG_SMP + " %4d" +#endif #ifdef CONFIG_STACK_COLORATION " %7lu" #endif @@ -105,6 +108,9 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) #endif "\n", tcb->pid, tcb->sched_priority, +#ifdef CONFIG_SMP + tcb->cpu, +#endif #ifdef CONFIG_STACK_COLORATION (unsigned long)up_check_tcbstack(tcb), #endif @@ -159,6 +165,9 @@ static inline void xtensa_showtasks(void) /* Dump interesting properties of each task in the crash environment */ _alert(" PID PRI" +#ifdef CONFIG_SMP + " CPU" +#endif #ifdef CONFIG_STACK_COLORATION " USED" #endif @@ -176,6 +185,9 @@ static inline void xtensa_showtasks(void) #if CONFIG_ARCH_INTERRUPTSTACK > 15 _alert(" ---- ----" +# ifdef CONFIG_SMP + " ----" +# endif # ifdef CONFIG_STACK_COLORATION " %7lu" # endif