]> granicus.if.org Git - procps-ng/commit
top: fixup logic for Nehalem cpu 'idle' threshold
authorJim Warner <james.warner@comcast.net>
Thu, 9 Feb 2012 05:59:59 +0000 (23:59 -0600)
committerCraig Small <csmall@enc.com.au>
Thu, 9 Feb 2012 20:01:10 +0000 (07:01 +1100)
commitce1410a51a624a91816fcc8c232c8a4d60b09638
tree4268e063a550a293f2c5ae83465bc7e483438b71
parent9349100dd3cff28e6a91e4b77596f55f3b91d140
top: fixup logic for Nehalem cpu 'idle' threshold

Due to a poorly constructed temporary fprintf
used during development, an earlier commit went
a little too far in its computations.  The net
result was the code looked nice but actually
accomplished nothing.

It is the /proc/stat line 1 (summary line)
whose tics must be used in establishing the
threshold boundary.  And that calculation
need be performed just once per frame.

This commit ensures one threshold calculation
per delay interval no matter how many cpus
are ultimately displayed.

It also corrects scalability by factoring in
the total number of online processors.

Reference:
commit 9e7dd43ab7b2e68177cefd49b3c07311ea79bc1a
top/top.c
top/top.h