]> granicus.if.org Git - procps-ng/commit
top: provide more accurate cpu usage stats for startup
authorJim Warner <james.warner@comcast.net>
Thu, 23 Mar 2017 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Wed, 29 Mar 2017 11:07:44 +0000 (22:07 +1100)
commit56d79b9d1382de445992a2455784cdccd3170725
tree1d9713e21d62c8617c05f815ae15528fd5414d1e
parent909b37d755fe22ee75b3115d4d402cf5f70708ae
top: provide more accurate cpu usage stats for startup

The top program already incorporated a modest delay at
startup so that some minimal process cpu history could
be established. However, Summary Area system level cpu
statistic history reflected usage since boot. As such,
unchanging % values would be shown with every restart.

This commit just adopts the same approach used in task
%CPU history for the Summary Area statistics. In other
words, it introduces a 'priming read' at startup as is
found in the newlib implementation for the <stat> API.

Reference(s):
https://gitlab.com/procps-ng/procps/merge_requests/42

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h