#44 [m_linux.c] faulty reporting of CPU states

v3.8beta
open
nobody
Display (18)
5
2009-09-01
2009-09-01
Mike Chang
No

my specific envt is Redhat Enterprise Linux 4 running RHEL4 kernel 2.6.9-42 - seen in top 3.8b1, 3.7b2, and 3.5 binaries

The specific problem occurs when the counters in /proc/stat are too big. machine/m_linux.c expects these numbers to be longs, but the numbers are actually unsigned long longs. (kernel source fs/proc/proc_misc.c, include/linux/kernel_stat.h) This results in odd calculated percentages of cpu states in the top display. Swapping the strtoul() with strtoull() calls produces expected output.

I presume this is not Redhat Enterprise 4 specific, but did not investigate further.

Discussion

  • Mike Chang

    Mike Chang - 2009-09-01

    /proc/stat snapshot #1

     
  • Mike Chang

    Mike Chang - 2009-09-01

    /proc/stat snapshot #2, a few seconds later

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks