From 9ff0971d3f3bf0acc1f2eaf769465ac9f8da62c8 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 7 Jul 2022 10:34:36 +0800 Subject: [PATCH] arch: Correct the order of stack related information in assert forget to update in this patch: commit b02db04e00f4f1f6e9b5a416ef880c0c19991347 Author: Xiang Xiao Date: Sun Jun 5 17:10:19 2022 +0800 arch/assert: Keep the thread dump column order same as ps Signed-off-by: Xiang Xiao Signed-off-by: Xiang Xiao --- arch/arm/src/common/arm_assert.c | 21 ++++----------------- arch/risc-v/src/common/riscv_assert.c | 21 ++++----------------- arch/xtensa/src/common/xtensa_dumpstate.c | 21 ++++----------------- 3 files changed, 12 insertions(+), 51 deletions(-) diff --git a/arch/arm/src/common/arm_assert.c b/arch/arm/src/common/arm_assert.c index 0555180275c..77c41957639 100644 --- a/arch/arm/src/common/arm_assert.c +++ b/arch/arm/src/common/arm_assert.c @@ -202,10 +202,7 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg) #endif " %7lu" #ifdef CONFIG_STACK_COLORATION - " %7lu" -#endif -#ifdef CONFIG_STACK_COLORATION - " %3" PRId32 ".%1" PRId32 "%%%c" + " %7lu %3" PRId32 ".%1" PRId32 "%%%c" #endif #ifdef CONFIG_SCHED_CPULOAD " %3" PRId32 ".%01" PRId32 "%%" @@ -218,8 +215,6 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg) , (unsigned long)tcb->adj_stack_size #ifdef CONFIG_STACK_COLORATION , (unsigned long)up_check_tcbstack(tcb) -#endif -#ifdef CONFIG_STACK_COLORATION , stack_filled / 10, stack_filled % 10 , (stack_filled >= 10 * 80 ? '!' : ' ') #endif @@ -274,13 +269,10 @@ static void arm_showtasks(void) _alert(" PID PRI" #ifdef CONFIG_SMP " CPU" -#endif -#ifdef CONFIG_STACK_COLORATION - " USED" #endif " STACK" #ifdef CONFIG_STACK_COLORATION - " FILLED " + " USED FILLED " #endif #ifdef CONFIG_SCHED_CPULOAD " CPU" @@ -291,13 +283,10 @@ static void arm_showtasks(void) _alert(" ---- ----" # ifdef CONFIG_SMP " ----" -# endif -# ifdef CONFIG_STACK_COLORATION - " %7lu" # endif " %7lu" # ifdef CONFIG_STACK_COLORATION - " %3" PRId32 ".%1" PRId32 "%%%c" + " %7lu %3" PRId32 ".%1" PRId32 "%%%c" # endif # ifdef CONFIG_SCHED_CPULOAD " ----" @@ -306,11 +295,9 @@ static void arm_showtasks(void) " irq" # endif "\n" -# ifdef CONFIG_STACK_COLORATION - , (unsigned long)stack_used -# endif , (unsigned long)(CONFIG_ARCH_INTERRUPTSTACK & ~7) # ifdef CONFIG_STACK_COLORATION + , (unsigned long)stack_used , stack_filled / 10, stack_filled % 10, (stack_filled >= 10 * 80 ? '!' : ' ') # endif diff --git a/arch/risc-v/src/common/riscv_assert.c b/arch/risc-v/src/common/riscv_assert.c index 5bd41282d3f..1cf8524808b 100644 --- a/arch/risc-v/src/common/riscv_assert.c +++ b/arch/risc-v/src/common/riscv_assert.c @@ -202,10 +202,7 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg) #endif " %7lu" #ifdef CONFIG_STACK_COLORATION - " %7lu" -#endif -#ifdef CONFIG_STACK_COLORATION - " %3" PRId32 ".%1" PRId32 "%%%c" + " %7lu %3" PRId32 ".%1" PRId32 "%%%c" #endif #ifdef CONFIG_SCHED_CPULOAD " %3" PRId32 ".%01" PRId32 "%%" @@ -218,8 +215,6 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg) , (unsigned long)tcb->adj_stack_size #ifdef CONFIG_STACK_COLORATION , (unsigned long)up_check_tcbstack(tcb) -#endif -#ifdef CONFIG_STACK_COLORATION , stack_filled / 10, stack_filled % 10 , (stack_filled >= 10 * 80 ? '!' : ' ') #endif @@ -274,13 +269,10 @@ static inline void riscv_showtasks(void) _alert(" PID PRI" #ifdef CONFIG_SMP " CPU" -#endif -#ifdef CONFIG_STACK_COLORATION - " USED" #endif " STACK" #ifdef CONFIG_STACK_COLORATION - " FILLED " + " USED FILLED " #endif #ifdef CONFIG_SCHED_CPULOAD " CPU" @@ -291,13 +283,10 @@ static inline void riscv_showtasks(void) _alert(" ---- ----" # ifdef CONFIG_SMP " ----" -# endif -# ifdef CONFIG_STACK_COLORATION - " %7lu" # endif " %7lu" # ifdef CONFIG_STACK_COLORATION - " %3" PRId32 ".%1" PRId32 "%%%c" + " %7lu %3" PRId32 ".%1" PRId32 "%%%c" # endif # ifdef CONFIG_SCHED_CPULOAD " ----" @@ -306,11 +295,9 @@ static inline void riscv_showtasks(void) " irq" # endif "\n" -# ifdef CONFIG_STACK_COLORATION - , (unsigned long)stack_used -# endif , (unsigned long)(CONFIG_ARCH_INTERRUPTSTACK & ~15) # ifdef CONFIG_STACK_COLORATION + , (unsigned long)stack_used , stack_filled / 10, stack_filled % 10, (stack_filled >= 10 * 80 ? '!' : ' ') # endif diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c index c510652ec39..00c38c4cf6f 100644 --- a/arch/xtensa/src/common/xtensa_dumpstate.c +++ b/arch/xtensa/src/common/xtensa_dumpstate.c @@ -117,10 +117,7 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) #endif " %7lu" #ifdef CONFIG_STACK_COLORATION - " %7lu" -#endif -#ifdef CONFIG_STACK_COLORATION - " %3" PRId32 ".%1" PRId32 "%%%c" + " %7lu %3" PRId32 ".%1" PRId32 "%%%c" #endif #ifdef CONFIG_SCHED_CPULOAD " %3" PRId32 ".%01" PRId32 "%%" @@ -135,8 +132,6 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) , (unsigned long)tcb->adj_stack_size #ifdef CONFIG_STACK_COLORATION , (unsigned long)up_check_tcbstack(tcb) -#endif -#ifdef CONFIG_STACK_COLORATION , stack_filled / 10, stack_filled % 10 , (stack_filled >= 10 * 80 ? '!' : ' ') #endif @@ -191,13 +186,10 @@ static inline void xtensa_showtasks(void) _alert(" PID PRI" #ifdef CONFIG_SMP " CPU" -#endif -#ifdef CONFIG_STACK_COLORATION - " USED" #endif " STACK" #ifdef CONFIG_STACK_COLORATION - " FILLED " + " USED FILLED " #endif #ifdef CONFIG_SCHED_CPULOAD " CPU" @@ -208,13 +200,10 @@ static inline void xtensa_showtasks(void) _alert(" ---- ----" # ifdef CONFIG_SMP " ----" -# endif -# ifdef CONFIG_STACK_COLORATION - " %7lu" # endif " %7lu" # ifdef CONFIG_STACK_COLORATION - " %3" PRId32 ".%1" PRId32 "%%%c" + " %7lu %3" PRId32 ".%1" PRId32 "%%%c" # endif # ifdef CONFIG_SCHED_CPULOAD " ----" @@ -223,11 +212,9 @@ static inline void xtensa_showtasks(void) " irq" # endif "\n" -# ifdef CONFIG_STACK_COLORATION - , (unsigned long)stack_used -# endif , (unsigned long)(CONFIG_ARCH_INTERRUPTSTACK & ~15) # ifdef CONFIG_STACK_COLORATION + , (unsigned long)stack_used , stack_filled / 10, stack_filled % 10, (stack_filled >= 10 * 80 ? '!' : ' ') # endif