fs/procfs: add StackAlloc field for task stack info

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2021-06-19 17:27:08 +08:00 committed by Xiang Xiao
parent 198b85d233
commit f57ba35151
1 changed files with 17 additions and 1 deletions

View File

@ -854,9 +854,25 @@ static ssize_t proc_stack(FAR struct proc_file_s *procfile,
remaining = buflen;
totalsize = 0;
/* Show the stack alloc address */
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%p\n",
"StackAlloc:", tcb->stack_alloc_ptr);
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
&offset);
totalsize += copysize;
buffer += copysize;
remaining -= copysize;
if (totalsize >= buflen)
{
return totalsize;
}
/* Show the stack base address */
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s0x%p\n",
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%p\n",
"StackBase:", tcb->stack_base_ptr);
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
&offset);