pkarashchenko commented on code in PR #8991:
URL: https://github.com/apache/nuttx/pull/8991#discussion_r1162387035
##########
fs/procfs/fs_procfsproc.c:
##########
@@ -854,12 +855,27 @@ static ssize_t proc_critmon(FAR struct proc_file_s
*procfile,
/* Generate output for maximum time thread running */
- linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%lu.%09lu\n",
+ linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%lu.%09lu,",
(unsigned long)maxtime.tv_sec,
(unsigned long)maxtime.tv_nsec);
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
&offset);
+ totalsize += copysize;
+ buffer += copysize;
+ remaining -= copysize;
+
+ /* Show the total running time of the task */
+
+ up_perf_convert(tcb->run_time, &runtime);
+
+ linesize = procfs_snprintf(procfile->line, STATUS_LINELEN,
+ "%lu.%09lu\n",
+ (unsigned long)runtime.tv_sec,
+ (unsigned long)(runtime.tv_nsec));
Review Comment:
```suggestion
linesize = procfs_snprintf(procfile->line, STATUS_LINELEN,
"%lu.%09lu\n",
(unsigned long)runtime.tv_sec,
(unsigned long)runtime.tv_nsec);
```
##########
fs/procfs/fs_procfsproc.c:
##########
@@ -762,6 +762,7 @@ static ssize_t proc_critmon(FAR struct proc_file_s
*procfile,
size_t buflen, off_t offset)
{
struct timespec maxtime;
Review Comment:
why not rename `maxtime` to `ts` and reuse it instead of adding new stack
variable?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]