Walt Wimer
09/24/2010 11:34 AM
post68535
|
Hi all,
I'm trying to find a way to extract/display an overall system "percent CPU
utilization" under QNX4, similar to what you might see with the "top"
program on Linux or the minimized Task Manager under MS Windows. I would
think that there would be a standard utility for this purpose, along with a
corresponding API, but I haven't found them yet.
I wrote a small program to periodically call qnx_psinfo() for the idle
process and then compute the overall CPU utilization as (1 - (idle_time /
wall_time)) * 100, where "idle_time" is the tms_utime value from the
qnx_psinfo() result structure. This works reasonably well, but after the
system has been up for a long time, tms_utime hits ULONG_MAX and just pegs
itself there, rather than wrapping around to zero (which I could deal with).
At this point, my algorithm becomes useless.
Thanks in advance for any suggestions.
Thanks!!!
Walt Wimer
TCSA, Inc.
|
|
|