[rhelv6-list] Top Does not show all CPU cores

John Haxby john.haxby at gmail.com
Tue Aug 7 08:08:30 UTC 2012


On 6 August 2012 22:28, Tilsley, Jerry M. <jmtilsley at st-claire.org> wrote:

> First of all, I wasn't paying attention when I sent this 5.7 issue to the
> RHEL6 group, sorry about that!  Secondly, I found the issue.  I also didn't
> realize I was running as a basic user when trying to do top.  When I
> switched to user 'root' top worked as expected!
>
>

There's something else going on there.   It doesn't matter whether you're
on EL5 or EL6, "1" in top should show the per-cpu stats like this:

 top - 08:42:00 up 4 days, 20:51,  1 user,  load average: 0.00, 0.01, 0.05
Tasks: 118 total,   1 running, 117 sleeping,   0 stopped,   0 zombie
Cpu0  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
0.0%st
Cpu1  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
0.0%st
Cpu2  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
0.0%st
Cpu3  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,
0.0%st
Mem:   1880072k total,  1159908k used,   720164k free,   195840k buffers
Swap:  1048572k total,        0k used,  1048572k free,   606672k cached

It's not even as though the per-cpu information comes from a different
place: top gets both summary and the per-cpu data from /proc/stat.   Even
if you only have one CPU you'd still see a "Cpu0" line instead of "Cpu(s).

The only way I can see to prevent top from displaying per-cpu information
is to prevent it displaying any cpu information at all: try hitting "t" --
that will take away the Tasks and Cpu lines.

It's possible that the Task area (t flag) is off by default: it can be set
in either ~/.toprc or /etc/toprc.   If it's not and you still don't have
per-cpu data then something is seriously amiss.   Check /proc/stat to make
sure you do have per-cpu lines, check "rpm -qf $(type -p top)" to make sure
the top you're running really is the one in the procps rpm and "rpm -V
procps" to make sure procps isn't damaged.

And then check for rootkits :)

jch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhelv6-list/attachments/20120807/7a5f7460/attachment.htm>


More information about the rhelv6-list mailing list