Hi,
I am the author of gPS (http://gps.seul.org) and I'm trying to finish the
FreeBSD native poller. All I need now is a routine to get the CPU usage.
My program needs it every quarter of second, so the loadavg value is not
enough accurate for me. (the objective is the CPU/memory history window
shown in the third screenshot at the website)
I've already looked at the source of top but couldn't get much from there.
On Linux this is what I do to get this value: Measure the number of
scheduled jiffies (hundreths of second), measure elapsed time since last
measurement, divide. What I need is a scheduler-oriented cpu usage poller.
I have already found some symbols in the kernel that may provide this
value, but I couldn't get them to scale in a closed range (when I though I
got the correct factor, I got CPU usages of 1280 % and the like).
I am using FreeBSD-3.4-RELEASE/i386 for development, and would like to
code to be portable for the widest range of FreeBSD versions possible.
Can someone help me with code or good reference ?
Thanks,
.........................................................................
Felipe Paulo Guazzi Bergo, undergradute in Computer Engineering
[EMAIL PROTECTED] || [EMAIL PROTECTED] || [EMAIL PROTECTED]
Unicamp - Campinas - SP - Brazil - Earth
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message