xiaoxiang781216 commented on code in PR #7875: URL: https://github.com/apache/nuttx/pull/7875#discussion_r1050607180
########## arch/renesas/src/m16c/m16c_registerdump.c: ########## @@ -23,68 +23,55 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <nuttx/syslog/syslog.h> +#include <stdint.h> #include <debug.h> -#include "chip.h" -#include "sched/sched.h" -#include "z16_internal.h" +#include <nuttx/irq.h> +#include <nuttx/arch.h> -#ifdef CONFIG_ARCH_STACKDUMP +#include "renesas_internal.h" +#include "chip.h" /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** - * Name: up_getsp + * Name: up_getusrsp ****************************************************************************/ -/* To be provided */ +uintptr_t up_getusrsp(void) +{ + uint8_t *ptr = (uint8_t *) g_current_regs; + return (uintptr_t)(ptr[REG_SP] << 8 | ptr[REG_SP + 1]); +} /**************************************************************************** - * Name: z16_stackdump + * Public Functions Review Comment: remove ########## sched/misc/assert.c: ########## @@ -121,6 +128,303 @@ static void assert_end(void) } } +#ifdef CONFIG_ARCH_STACKDUMP + +/**************************************************************************** + * Name: stackdump + ****************************************************************************/ + +static void stackdump(uintptr_t sp, uintptr_t stack_top) +{ + uintptr_t stack; + + for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32) + { + FAR uint32_t *ptr = (FAR uint32_t *)stack; + _alert("%" PRIxPTR ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 "\n", + stack, ptr[0], ptr[1], ptr[2], ptr[3], + ptr[4], ptr[5], ptr[6], ptr[7]); + } +} + +/**************************************************************************** + * Name: dump_stack + ****************************************************************************/ + +static void dump_stack(FAR const char *tag, uintptr_t sp, + uintptr_t base, size_t size, + size_t used, bool force) +{ + uintptr_t top = base + size; + + _alert("%s Stack:\n", tag); + _alert("sp: %08" PRIxPTR "\n", sp); + _alert(" base: %08" PRIxPTR "\n", base); + _alert(" size: %08zu\n", size); + + if (sp >= base && sp < top) + { + stackdump(sp, top); + } + else + { + _alert("ERROR: %s Stack pointer is not within the stack\n", tag); + + if (force) + { +#ifdef CONFIG_STACK_COLORATION + size_t remain = size - used; + + base += remain; + size -= remain; +#endif + +#if CONFIG_ARCH_STACKDUMP_MAX_LENGTH > 0 + if (size > CONFIG_ARCH_STACKDUMP_MAX_LENGTH) + { + size = CONFIG_ARCH_STACKDUMP_MAX_LENGTH; + } +#endif + + stackdump(base, base + size); + } + } +} + +/**************************************************************************** + * Name: showstacks + ****************************************************************************/ + +static void showstacks(void) +{ + FAR struct tcb_s *rtcb = running_task(); + uintptr_t sp = up_getsp(); + + /* Get the limits on the interrupt stack memory */ + +#if CONFIG_ARCH_INTERRUPTSTACK > 0 + dump_stack("IRQ", sp, + up_get_intstackbase(), + CONFIG_ARCH_INTERRUPTSTACK, +# ifdef CONFIG_STACK_COLORATION + up_check_intstack(), +# else + 0, +# endif + up_interrupt_context()); + if (up_interrupt_context()) + { + sp = up_getusrsp(); + } +#endif + + dump_stack("User", sp, + (uintptr_t)rtcb->stack_base_ptr, + (size_t)rtcb->adj_stack_size, +#ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +#else + 0, +#endif +#ifdef CONFIG_ARCH_KERNEL_STACK + false +#else + true +#endif + ); + +#ifdef CONFIG_ARCH_KERNEL_STACK + dump_stack("Kernel", sp, + (uintptr_t)rtcb->xcp.kstack, + CONFIG_ARCH_KERNEL_STACKSIZE, +# ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +# else + 0, +# endif + false); +#endif +} + +#endif + +/**************************************************************************** + * Name: dump_task + ****************************************************************************/ + +static void dump_task(struct tcb_s *tcb, void *arg) +{ + char args[64] = ""; +#ifdef CONFIG_STACK_COLORATION + size_t stack_filled = 0; + size_t stack_used; +#endif +#ifdef CONFIG_SCHED_CPULOAD + struct cpuload_s cpuload; + size_t fracpart; + size_t intpart; + size_t tmp; + + clock_cpuload(tcb->pid, &cpuload); + + if (cpuload.total > 0) + { + tmp = (1000 * cpuload.active) / cpuload.total; + intpart = tmp / 10; + fracpart = tmp - 10 * intpart; + } + else + { + intpart = 0; Review Comment: merge to line 266-268 ########## arch/renesas/src/m16c/m16c_registerdump.c: ########## @@ -23,68 +23,55 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <nuttx/syslog/syslog.h> +#include <stdint.h> #include <debug.h> -#include "chip.h" -#include "sched/sched.h" -#include "z16_internal.h" +#include <nuttx/irq.h> +#include <nuttx/arch.h> -#ifdef CONFIG_ARCH_STACKDUMP +#include "renesas_internal.h" +#include "chip.h" /**************************************************************************** * Private Functions Review Comment: Public ########## arch/z16/src/common/z16_registerdump.c: ########## @@ -27,49 +27,37 @@ #include <stdint.h> #include <debug.h> -#include <nuttx/irq.h> -#include <nuttx/arch.h> - #include "z16_internal.h" -#ifdef CONFIG_ARCH_STACKDUMP - /**************************************************************************** - * Private Data + * Private Functions Review Comment: Public ########## sched/misc/assert.c: ########## @@ -46,6 +47,12 @@ # define CONFIG_BOARD_RESET_ON_ASSERT 0 #endif +/* Check if an interrupt stack size is configured */ + +#ifndef CONFIG_ARCH_INTERRUPTSTACK Review Comment: remove, don't need ########## sched/misc/assert.c: ########## @@ -121,6 +128,303 @@ static void assert_end(void) } } +#ifdef CONFIG_ARCH_STACKDUMP + +/**************************************************************************** + * Name: stackdump + ****************************************************************************/ + +static void stackdump(uintptr_t sp, uintptr_t stack_top) +{ + uintptr_t stack; + + for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32) + { + FAR uint32_t *ptr = (FAR uint32_t *)stack; + _alert("%" PRIxPTR ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 "\n", + stack, ptr[0], ptr[1], ptr[2], ptr[3], + ptr[4], ptr[5], ptr[6], ptr[7]); + } +} + +/**************************************************************************** + * Name: dump_stack + ****************************************************************************/ + +static void dump_stack(FAR const char *tag, uintptr_t sp, + uintptr_t base, size_t size, + size_t used, bool force) +{ + uintptr_t top = base + size; + + _alert("%s Stack:\n", tag); + _alert("sp: %08" PRIxPTR "\n", sp); + _alert(" base: %08" PRIxPTR "\n", base); + _alert(" size: %08zu\n", size); + + if (sp >= base && sp < top) + { + stackdump(sp, top); + } + else + { + _alert("ERROR: %s Stack pointer is not within the stack\n", tag); + + if (force) + { +#ifdef CONFIG_STACK_COLORATION + size_t remain = size - used; + + base += remain; + size -= remain; +#endif + +#if CONFIG_ARCH_STACKDUMP_MAX_LENGTH > 0 + if (size > CONFIG_ARCH_STACKDUMP_MAX_LENGTH) + { + size = CONFIG_ARCH_STACKDUMP_MAX_LENGTH; + } +#endif + + stackdump(base, base + size); + } + } +} + +/**************************************************************************** + * Name: showstacks + ****************************************************************************/ + +static void showstacks(void) +{ + FAR struct tcb_s *rtcb = running_task(); + uintptr_t sp = up_getsp(); + + /* Get the limits on the interrupt stack memory */ + +#if CONFIG_ARCH_INTERRUPTSTACK > 0 + dump_stack("IRQ", sp, + up_get_intstackbase(), + CONFIG_ARCH_INTERRUPTSTACK, +# ifdef CONFIG_STACK_COLORATION + up_check_intstack(), +# else + 0, +# endif + up_interrupt_context()); + if (up_interrupt_context()) + { + sp = up_getusrsp(); + } +#endif + + dump_stack("User", sp, + (uintptr_t)rtcb->stack_base_ptr, + (size_t)rtcb->adj_stack_size, +#ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +#else + 0, +#endif +#ifdef CONFIG_ARCH_KERNEL_STACK + false +#else + true +#endif + ); + +#ifdef CONFIG_ARCH_KERNEL_STACK + dump_stack("Kernel", sp, + (uintptr_t)rtcb->xcp.kstack, + CONFIG_ARCH_KERNEL_STACKSIZE, +# ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +# else + 0, +# endif + false); +#endif +} + +#endif + +/**************************************************************************** + * Name: dump_task + ****************************************************************************/ + +static void dump_task(struct tcb_s *tcb, void *arg) +{ + char args[64] = ""; +#ifdef CONFIG_STACK_COLORATION + size_t stack_filled = 0; + size_t stack_used; +#endif +#ifdef CONFIG_SCHED_CPULOAD + struct cpuload_s cpuload; + size_t fracpart; + size_t intpart; + size_t tmp; + + clock_cpuload(tcb->pid, &cpuload); + + if (cpuload.total > 0) + { + tmp = (1000 * cpuload.active) / cpuload.total; + intpart = tmp / 10; + fracpart = tmp - 10 * intpart; + } + else + { + intpart = 0; + fracpart = 0; + } +#endif + +#ifdef CONFIG_STACK_COLORATION + stack_used = up_check_tcbstack(tcb); + if (tcb->adj_stack_size > 0 && stack_used > 0) + { + /* Use fixed-point math with one decimal place */ + + stack_filled = 10 * 100 * stack_used / tcb->adj_stack_size; + } +#endif + +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + struct pthread_tcb_s *ptcb = (struct pthread_tcb_s *)tcb; + + snprintf(args, sizeof(args), " %p", ptcb->arg); + } + else +#endif + { + char **argv = tcb->group->tg_info->argv + 1; + size_t npos = 0; + + while (*argv != NULL && npos < sizeof(args)) + { + npos += snprintf(args + npos, sizeof(args) - npos, " %s", *argv++); + } + } + + /* Dump interesting properties of this task */ + + _alert(" %4d %4d" +#ifdef CONFIG_SMP + " %4d" +#endif + " %7lu" +#ifdef CONFIG_STACK_COLORATION + " %7lu %3zu.%1zu%%%c" +#endif +#ifdef CONFIG_SCHED_CPULOAD + " %3zu.%01zu%%" +#endif + " %s%s\n" + , tcb->pid, tcb->sched_priority +#ifdef CONFIG_SMP + , tcb->cpu +#endif + , (unsigned long)tcb->adj_stack_size Review Comment: remove the cast, change lu to zu ########## sched/misc/assert.c: ########## @@ -121,6 +128,303 @@ static void assert_end(void) } } +#ifdef CONFIG_ARCH_STACKDUMP + +/**************************************************************************** + * Name: stackdump + ****************************************************************************/ + +static void stackdump(uintptr_t sp, uintptr_t stack_top) +{ + uintptr_t stack; + + for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32) + { + FAR uint32_t *ptr = (FAR uint32_t *)stack; + _alert("%" PRIxPTR ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 "\n", + stack, ptr[0], ptr[1], ptr[2], ptr[3], + ptr[4], ptr[5], ptr[6], ptr[7]); + } +} + +/**************************************************************************** + * Name: dump_stack + ****************************************************************************/ + +static void dump_stack(FAR const char *tag, uintptr_t sp, + uintptr_t base, size_t size, + size_t used, bool force) +{ + uintptr_t top = base + size; + + _alert("%s Stack:\n", tag); + _alert("sp: %08" PRIxPTR "\n", sp); + _alert(" base: %08" PRIxPTR "\n", base); + _alert(" size: %08zu\n", size); + + if (sp >= base && sp < top) + { + stackdump(sp, top); + } + else + { + _alert("ERROR: %s Stack pointer is not within the stack\n", tag); + + if (force) + { +#ifdef CONFIG_STACK_COLORATION + size_t remain = size - used; + + base += remain; + size -= remain; +#endif + +#if CONFIG_ARCH_STACKDUMP_MAX_LENGTH > 0 + if (size > CONFIG_ARCH_STACKDUMP_MAX_LENGTH) + { + size = CONFIG_ARCH_STACKDUMP_MAX_LENGTH; + } +#endif + + stackdump(base, base + size); + } + } +} + +/**************************************************************************** + * Name: showstacks + ****************************************************************************/ + +static void showstacks(void) +{ + FAR struct tcb_s *rtcb = running_task(); + uintptr_t sp = up_getsp(); + + /* Get the limits on the interrupt stack memory */ + +#if CONFIG_ARCH_INTERRUPTSTACK > 0 + dump_stack("IRQ", sp, + up_get_intstackbase(), + CONFIG_ARCH_INTERRUPTSTACK, +# ifdef CONFIG_STACK_COLORATION + up_check_intstack(), +# else + 0, +# endif + up_interrupt_context()); + if (up_interrupt_context()) + { + sp = up_getusrsp(); + } +#endif + + dump_stack("User", sp, + (uintptr_t)rtcb->stack_base_ptr, + (size_t)rtcb->adj_stack_size, +#ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +#else + 0, +#endif +#ifdef CONFIG_ARCH_KERNEL_STACK + false +#else + true +#endif + ); + +#ifdef CONFIG_ARCH_KERNEL_STACK + dump_stack("Kernel", sp, + (uintptr_t)rtcb->xcp.kstack, + CONFIG_ARCH_KERNEL_STACKSIZE, +# ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +# else + 0, +# endif + false); +#endif +} + +#endif + +/**************************************************************************** + * Name: dump_task + ****************************************************************************/ + +static void dump_task(struct tcb_s *tcb, void *arg) +{ + char args[64] = ""; +#ifdef CONFIG_STACK_COLORATION + size_t stack_filled = 0; + size_t stack_used; +#endif +#ifdef CONFIG_SCHED_CPULOAD + struct cpuload_s cpuload; + size_t fracpart; + size_t intpart; + size_t tmp; + + clock_cpuload(tcb->pid, &cpuload); + + if (cpuload.total > 0) + { + tmp = (1000 * cpuload.active) / cpuload.total; + intpart = tmp / 10; + fracpart = tmp - 10 * intpart; + } + else + { + intpart = 0; + fracpart = 0; + } +#endif + +#ifdef CONFIG_STACK_COLORATION + stack_used = up_check_tcbstack(tcb); + if (tcb->adj_stack_size > 0 && stack_used > 0) + { + /* Use fixed-point math with one decimal place */ + + stack_filled = 10 * 100 * stack_used / tcb->adj_stack_size; + } +#endif + +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + struct pthread_tcb_s *ptcb = (struct pthread_tcb_s *)tcb; + + snprintf(args, sizeof(args), " %p", ptcb->arg); + } + else +#endif + { + char **argv = tcb->group->tg_info->argv + 1; + size_t npos = 0; + + while (*argv != NULL && npos < sizeof(args)) + { + npos += snprintf(args + npos, sizeof(args) - npos, " %s", *argv++); + } + } + + /* Dump interesting properties of this task */ + + _alert(" %4d %4d" +#ifdef CONFIG_SMP + " %4d" +#endif + " %7lu" +#ifdef CONFIG_STACK_COLORATION + " %7lu %3zu.%1zu%%%c" +#endif +#ifdef CONFIG_SCHED_CPULOAD + " %3zu.%01zu%%" +#endif + " %s%s\n" + , tcb->pid, tcb->sched_priority +#ifdef CONFIG_SMP + , tcb->cpu +#endif + , (unsigned long)tcb->adj_stack_size +#ifdef CONFIG_STACK_COLORATION + , (unsigned long)up_check_tcbstack(tcb) + , stack_filled / 10, stack_filled % 10 + , (stack_filled >= 10 * 80 ? '!' : ' ') +#endif +#ifdef CONFIG_SCHED_CPULOAD + , intpart, fracpart +#endif +#if CONFIG_TASK_NAME_SIZE > 0 + , tcb->name +#else + , "<noname>" +#endif + , args + ); +} + +/**************************************************************************** + * Name: dump_backtrace + ****************************************************************************/ + +#ifdef CONFIG_SCHED_BACKTRACE +static void dump_backtrace(FAR struct tcb_s *tcb, FAR void *arg) +{ + /* Show back trace */ + + sched_dumpstack(tcb->pid); +} +#endif + +/**************************************************************************** + * Name: showtasks + ****************************************************************************/ + +static void showtasks(void) +{ +#if CONFIG_ARCH_INTERRUPTSTACK > 0 +# ifdef CONFIG_STACK_COLORATION + size_t stack_used = up_check_intstack(); + size_t stack_filled = 0; + + if (stack_used > 0) + { + /* Use fixed-point math with one decimal place */ + + stack_filled = 10 * 100 * + stack_used / CONFIG_ARCH_INTERRUPTSTACK; + } +# endif +#endif + + /* Dump interesting properties of each task in the crash environment */ + + _alert(" PID PRI" +#ifdef CONFIG_SMP + " CPU" +#endif + " STACK" +#ifdef CONFIG_STACK_COLORATION + " USED FILLED " +#endif +#ifdef CONFIG_SCHED_CPULOAD + " CPU" +#endif + " COMMAND\n"); + +#if CONFIG_ARCH_INTERRUPTSTACK > 0 + _alert(" ---- ----" +# ifdef CONFIG_SMP + " ----" +# endif + " %7u" +# ifdef CONFIG_STACK_COLORATION + " %7zu %3zu.%1zu%%%c" +# endif +# ifdef CONFIG_SCHED_CPULOAD + " ----" +# endif + " irq\n" + , CONFIG_ARCH_INTERRUPTSTACK +# ifdef CONFIG_STACK_COLORATION + , stack_used + , stack_filled / 10, stack_filled % 10, + (stack_filled >= 10 * 80 ? '!' : ' ') +# endif + ); +#endif + + nxsched_foreach(dump_task, NULL); + +#ifdef CONFIG_SCHED_BACKTRACE + nxsched_foreach(dump_backtrace, NULL); +#endif +} + Review Comment: move assert_end here ########## arch/z80/src/ez80/Make.defs: ########## @@ -25,10 +25,6 @@ CMN_CSRCS += z80_idle.c z80_assert.c z80_doirq.c CMN_CSRCS += z80_mdelay.c z80_stackframe.c z80_udelay.c z80_usestack.c CMN_CSRCS += z80_nputs.c -ifeq ($(CONFIG_ARCH_STACKDUMP),y) -CMN_CSRCS += z80_stackdump.c Review Comment: not remove z80_stackdump.c yet ########## sched/misc/assert.c: ########## @@ -121,6 +128,303 @@ static void assert_end(void) } } +#ifdef CONFIG_ARCH_STACKDUMP + +/**************************************************************************** + * Name: stackdump + ****************************************************************************/ + +static void stackdump(uintptr_t sp, uintptr_t stack_top) +{ + uintptr_t stack; + + for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32) + { + FAR uint32_t *ptr = (FAR uint32_t *)stack; + _alert("%" PRIxPTR ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 + " %08" PRIx32 "\n", + stack, ptr[0], ptr[1], ptr[2], ptr[3], + ptr[4], ptr[5], ptr[6], ptr[7]); + } +} + +/**************************************************************************** + * Name: dump_stack + ****************************************************************************/ + +static void dump_stack(FAR const char *tag, uintptr_t sp, + uintptr_t base, size_t size, + size_t used, bool force) +{ + uintptr_t top = base + size; + + _alert("%s Stack:\n", tag); + _alert("sp: %08" PRIxPTR "\n", sp); + _alert(" base: %08" PRIxPTR "\n", base); + _alert(" size: %08zu\n", size); + + if (sp >= base && sp < top) + { + stackdump(sp, top); + } + else + { + _alert("ERROR: %s Stack pointer is not within the stack\n", tag); + + if (force) + { +#ifdef CONFIG_STACK_COLORATION + size_t remain = size - used; + + base += remain; + size -= remain; +#endif + +#if CONFIG_ARCH_STACKDUMP_MAX_LENGTH > 0 + if (size > CONFIG_ARCH_STACKDUMP_MAX_LENGTH) + { + size = CONFIG_ARCH_STACKDUMP_MAX_LENGTH; + } +#endif + + stackdump(base, base + size); + } + } +} + +/**************************************************************************** + * Name: showstacks + ****************************************************************************/ + +static void showstacks(void) +{ + FAR struct tcb_s *rtcb = running_task(); + uintptr_t sp = up_getsp(); + + /* Get the limits on the interrupt stack memory */ + +#if CONFIG_ARCH_INTERRUPTSTACK > 0 + dump_stack("IRQ", sp, + up_get_intstackbase(), + CONFIG_ARCH_INTERRUPTSTACK, +# ifdef CONFIG_STACK_COLORATION + up_check_intstack(), +# else + 0, +# endif + up_interrupt_context()); + if (up_interrupt_context()) + { + sp = up_getusrsp(); + } +#endif + + dump_stack("User", sp, + (uintptr_t)rtcb->stack_base_ptr, + (size_t)rtcb->adj_stack_size, +#ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +#else + 0, +#endif +#ifdef CONFIG_ARCH_KERNEL_STACK + false +#else + true +#endif + ); + +#ifdef CONFIG_ARCH_KERNEL_STACK + dump_stack("Kernel", sp, + (uintptr_t)rtcb->xcp.kstack, + CONFIG_ARCH_KERNEL_STACKSIZE, +# ifdef CONFIG_STACK_COLORATION + up_check_tcbstack(rtcb), +# else + 0, +# endif + false); +#endif +} + +#endif + +/**************************************************************************** + * Name: dump_task + ****************************************************************************/ + +static void dump_task(struct tcb_s *tcb, void *arg) +{ + char args[64] = ""; +#ifdef CONFIG_STACK_COLORATION + size_t stack_filled = 0; + size_t stack_used; +#endif +#ifdef CONFIG_SCHED_CPULOAD + struct cpuload_s cpuload; + size_t fracpart; + size_t intpart; + size_t tmp; + + clock_cpuload(tcb->pid, &cpuload); + + if (cpuload.total > 0) + { + tmp = (1000 * cpuload.active) / cpuload.total; + intpart = tmp / 10; + fracpart = tmp - 10 * intpart; + } + else + { + intpart = 0; + fracpart = 0; + } +#endif + +#ifdef CONFIG_STACK_COLORATION + stack_used = up_check_tcbstack(tcb); + if (tcb->adj_stack_size > 0 && stack_used > 0) + { + /* Use fixed-point math with one decimal place */ + + stack_filled = 10 * 100 * stack_used / tcb->adj_stack_size; + } +#endif + +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + struct pthread_tcb_s *ptcb = (struct pthread_tcb_s *)tcb; + + snprintf(args, sizeof(args), " %p", ptcb->arg); + } + else +#endif + { + char **argv = tcb->group->tg_info->argv + 1; + size_t npos = 0; + + while (*argv != NULL && npos < sizeof(args)) + { + npos += snprintf(args + npos, sizeof(args) - npos, " %s", *argv++); + } + } + + /* Dump interesting properties of this task */ + + _alert(" %4d %4d" +#ifdef CONFIG_SMP + " %4d" +#endif + " %7lu" +#ifdef CONFIG_STACK_COLORATION + " %7lu %3zu.%1zu%%%c" +#endif +#ifdef CONFIG_SCHED_CPULOAD + " %3zu.%01zu%%" +#endif + " %s%s\n" + , tcb->pid, tcb->sched_priority +#ifdef CONFIG_SMP + , tcb->cpu +#endif + , (unsigned long)tcb->adj_stack_size +#ifdef CONFIG_STACK_COLORATION + , (unsigned long)up_check_tcbstack(tcb) Review Comment: remove the cast, change lu to zu -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org