Re: Re: Re: cpu usage information in proc fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

after reading the proc.txt file
i come to the following conclusion

i get the total clock speed of the cpu from /proc/cpuinfo from cpu MHz entry
now i add the values of all the colomns in the first row of /proc/stat(the row which starts with cpu).this gives the total cpu usage.
then i am dividing the above value with 1000 and the resulting answer is again divided with the total clock speed to get the percentage of cpu usage.
is my approach  correct.
i am checking my results with system moniter but there is a variation
plz rectify me
if i am wrong
thanks sounak

On Mon, 07 Mar 2005 Erik Mouw wrote :
>A: Because it messes up the order in which people normally read text.
>Q: Why is top-posting such a bad thing?
>A: Top-posting.
>Q: What is the most annoying thing in e-mail?
>
>A: No.
>Q: Should I include quotations after my reply?
>
>(Oh, and don't use HTML for email, and get a real mailer that doesn't
>mess up threading).
>
>On Mon, Mar 07, 2005 at 12:18:44PM -0000, sounak  chakraborty wrote:
> > i read the /proc/stat file but there were 7 entries along the first
> > line beginning with CPU but it is not specified what information they
> > are providing.
>
>Either read the kernel source (which always is the ultimate
>documentation), or read Documentation/filesystems/proc.txt. Or read the
>source of top and vmstat.
>
>
>Erik
>
>--
>Erik Mouw
>J.A.K.Mouw@xxxxxxxxxxxxxx  mouw@xxxxxxxxxxxx




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux