arch: dump "<noname>" as the task name if CONFIG_TASK_NAME_SIZE equals 0

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-06-06 18:00:04 +08:00 committed by Petro Karashchenko
parent 2b2830c252
commit 28b25e0391
3 changed files with 15 additions and 19 deletions

View File

@ -180,7 +180,7 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg)
{ {
FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb;
snprintf(args, sizeof(args), "%p ", ptcb->arg); snprintf(args, sizeof(args), " %p", ptcb->arg);
} }
else else
#endif #endif
@ -190,7 +190,7 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg)
while (*argv != NULL && npos < sizeof(args)) while (*argv != NULL && npos < sizeof(args))
{ {
npos += snprintf(args + npos, sizeof(args) - npos, "%s ", *argv++); npos += snprintf(args + npos, sizeof(args) - npos, " %s", *argv++);
} }
} }
@ -210,11 +210,7 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg)
#ifdef CONFIG_SCHED_CPULOAD #ifdef CONFIG_SCHED_CPULOAD
" %3" PRId32 ".%01" PRId32 "%%" " %3" PRId32 ".%01" PRId32 "%%"
#endif #endif
#if CONFIG_TASK_NAME_SIZE > 0 " %s%s\n"
" %s %s\n"
#else
" %s\n"
#endif
, tcb->pid, tcb->sched_priority , tcb->pid, tcb->sched_priority
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
, tcb->cpu , tcb->cpu
@ -232,6 +228,8 @@ static void arm_dump_task(struct tcb_s *tcb, void *arg)
#endif #endif
#if CONFIG_TASK_NAME_SIZE > 0 #if CONFIG_TASK_NAME_SIZE > 0
, tcb->name , tcb->name
#else
, "<noname>"
#endif #endif
, args , args
); );

View File

@ -180,7 +180,7 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg)
{ {
FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb;
snprintf(args, sizeof(args), "%p ", ptcb->arg); snprintf(args, sizeof(args), " %p", ptcb->arg);
} }
else else
#endif #endif
@ -190,7 +190,7 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg)
while (*argv != NULL && npos < sizeof(args)) while (*argv != NULL && npos < sizeof(args))
{ {
npos += snprintf(args + npos, sizeof(args) - npos, "%s ", *argv++); npos += snprintf(args + npos, sizeof(args) - npos, " %s", *argv++);
} }
} }
@ -210,11 +210,7 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg)
#ifdef CONFIG_SCHED_CPULOAD #ifdef CONFIG_SCHED_CPULOAD
" %3" PRId32 ".%01" PRId32 "%%" " %3" PRId32 ".%01" PRId32 "%%"
#endif #endif
#if CONFIG_TASK_NAME_SIZE > 0 " %s%s\n"
" %s %s\n"
#else
" %s\n"
#endif
, tcb->pid, tcb->sched_priority , tcb->pid, tcb->sched_priority
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
, tcb->cpu , tcb->cpu
@ -232,6 +228,8 @@ static void riscv_dump_task(struct tcb_s *tcb, void *arg)
#endif #endif
#if CONFIG_TASK_NAME_SIZE > 0 #if CONFIG_TASK_NAME_SIZE > 0
, tcb->name , tcb->name
#else
, "<noname>"
#endif #endif
, args , args
); );

View File

@ -95,7 +95,7 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg)
{ {
FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb;
snprintf(args, sizeof(args), "%p ", ptcb->arg); snprintf(args, sizeof(args), " %p", ptcb->arg);
} }
else else
#endif #endif
@ -105,7 +105,7 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg)
while (*argv != NULL && npos < sizeof(args)) while (*argv != NULL && npos < sizeof(args))
{ {
npos += snprintf(args + npos, sizeof(args) - npos, "%s ", *argv++); npos += snprintf(args + npos, sizeof(args) - npos, " %s", *argv++);
} }
} }
@ -126,9 +126,7 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg)
" %3" PRId32 ".%01" PRId32 "%%" " %3" PRId32 ".%01" PRId32 "%%"
#endif #endif
#if CONFIG_TASK_NAME_SIZE > 0 #if CONFIG_TASK_NAME_SIZE > 0
" %s %s\n" " %s%s\n"
#else
" %s\n"
#endif #endif
, tcb->pid, tcb->sched_priority , tcb->pid, tcb->sched_priority
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
@ -147,6 +145,8 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg)
#endif #endif
#if CONFIG_TASK_NAME_SIZE > 0 #if CONFIG_TASK_NAME_SIZE > 0
, tcb->name , tcb->name
#else
, "<noname>"
#endif #endif
, args , args
); );