mirror of
https://github.com/apache/nuttx.git
synced 2026-10-12 00:30:23 +00:00
stack recored:Fixed the problem of missing the 0th data in statistics
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
d6ae4a0342
commit
632b13fe03
1 changed files with 4 additions and 3 deletions
|
|
@ -1061,12 +1061,13 @@ static ssize_t proc_stack(FAR struct proc_file_s *procfile,
|
|||
buffer += copysize;
|
||||
remaining -= copysize;
|
||||
|
||||
for (i = tcb->level_deepest - 1; i > 0; i--)
|
||||
for (i = tcb->level_deepest - 1; i >= 0; i--)
|
||||
{
|
||||
linesize = procfs_snprintf(procfile->line, STATUS_LINELEN,
|
||||
"%-12zu%-pS\n",
|
||||
tcb->stackrecord_sp_deepest[i - 1] -
|
||||
tcb->stackrecord_sp_deepest[i],
|
||||
(i ? tcb->stackrecord_sp_deepest[i - 1] :
|
||||
tcb->stack_base_ptr + tcb->adj_stack_size)
|
||||
- tcb->stackrecord_sp_deepest[i],
|
||||
tcb->stackrecord_pc_deepest[i]);
|
||||
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
|
||||
&offset);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue