task: show thread main entry when display thread name

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2022-12-14 10:08:24 +08:00 committed by Xiang Xiao
parent 3d2ffed8ae
commit 3462061624
2 changed files with 11 additions and 7 deletions

View File

@ -718,8 +718,9 @@ static ssize_t proc_cmdline(FAR struct proc_file_s *procfile,
{ {
FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb;
linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, " %p\n", linesize = procfs_snprintf(procfile->line, STATUS_LINELEN,
ptcb->arg); " %p %p\n",
ptcb->cmn.entry.main, ptcb->arg);
copysize = procfs_memcpy(procfile->line, linesize, buffer, copysize = procfs_memcpy(procfile->line, linesize, buffer,
remaining, &offset); remaining, &offset);

View File

@ -251,7 +251,8 @@ static void dump_task(struct tcb_s *tcb, void *arg)
{ {
struct pthread_tcb_s *ptcb = (struct pthread_tcb_s *)tcb; struct pthread_tcb_s *ptcb = (struct pthread_tcb_s *)tcb;
snprintf(args, sizeof(args), " %p", ptcb->arg); snprintf(args, sizeof(args), " %p %p",
ptcb->cmn.entry.main, ptcb->arg);
} }
else else
#endif #endif
@ -443,16 +444,18 @@ void _assert(FAR const char *filename, int linenum)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
# if CONFIG_TASK_NAME_SIZE > 0 # if CONFIG_TASK_NAME_SIZE > 0
_alert("Assertion failed CPU%d at file:%s line: %d task: %s\n", _alert("Assertion failed CPU%d at file:%s line: %d task: %s %p\n",
up_cpu_index(), filename, linenum, running_task()->name); up_cpu_index(), filename, linenum, running_task()->name,
running_task()->entry.main);
# else # else
_alert("Assertion failed CPU%d at file:%s line: %d\n", _alert("Assertion failed CPU%d at file:%s line: %d\n",
up_cpu_index(), filename, linenum); up_cpu_index(), filename, linenum);
# endif # endif
#else #else
# if CONFIG_TASK_NAME_SIZE > 0 # if CONFIG_TASK_NAME_SIZE > 0
_alert("Assertion failed at file:%s line: %d task: %s\n", _alert("Assertion failed at file:%s line: %d task: %s %p\n",
filename, linenum, running_task()->name); filename, linenum, running_task()->name,
running_task()->entry.main);
# else # else
_alert("Assertion failed at file:%s line: %d\n", _alert("Assertion failed at file:%s line: %d\n",
filename, linenum); filename, linenum);