mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
profcs task status will now show CPU is SMP is enabled
This commit is contained in:
@@ -375,6 +375,7 @@ static FAR const struct proc_node_s *proc_findnode(FAR const char *relpath)
|
||||
* Type: xxxxxxx {Task, pthread, Kthread, Invalid}
|
||||
* PPID: xxxxx Parent thread ID
|
||||
* Group: xxxxx Group ID
|
||||
* CPU: xxx CPU (CONFIG_SMP only)
|
||||
* State: xxxxxxxx,xxxxxxxxx {Invalid, Waiting, Ready, Running, Inactive},
|
||||
* {Unlock, Semaphore, Signal, MQ empty, MQ full}
|
||||
* Flags: xxx N,P,X
|
||||
@@ -461,6 +462,30 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile,
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
if (tcb->task_state >= FIRST_ASSIGNED_STATE &&
|
||||
tcb->task_state <= LAST_ASSIGNED_STATE)
|
||||
{
|
||||
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n", "CPU:",
|
||||
tcb->cpu);
|
||||
}
|
||||
else
|
||||
{
|
||||
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s---\n", "CPU:");
|
||||
}
|
||||
|
||||
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
|
||||
|
||||
totalsize += copysize;
|
||||
buffer += copysize;
|
||||
remaining -= copysize;
|
||||
|
||||
if (totalsize >= buflen)
|
||||
{
|
||||
return totalsize;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Show the thread state */
|
||||
|
||||
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n", "State:",
|
||||
|
||||
Reference in New Issue
Block a user