From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,d07ddb9ee24c3c6,start X-Google-Attributes: gidfee84,public X-Google-Thread: 115aec,d07ddb9ee24c3c6,start X-Google-Attributes: gid115aec,public From: Kevin Barrett Subject: How to determine CPU utilization Date: 1996/06/20 Message-ID: <31CA1F20.4D58B9C7@rt66.com>#1/1 X-Deja-AN: 161325873 cc: kbarrett@rt66.com content-type: text/plain; charset=us-ascii organization: Rt66.COM, Public Internet Access in New Mexico mime-version: 1.0 newsgroups: comp.realtime,comp.unix.osf.osf1 x-mailer: Mozilla 2.0 (X11; I; Linux 1.2.13 i586) I am working on a real-time executive on the DEC Alpha. A requirement is to provide 50% spare CPU capacity, and I would like to have my console display the current CPU idle time. One implementation we have considered is to have a task run at the lowest priority, that just counts in a while loop. That task would be interrupted at a set rate, say 2 Hz, at which time it would report the count value and reset. This is an acceptable solution, but I was wondering if OSF/1 (or any POSIX.4 Unix, for that matter) provides a service for determining the percentage of time the CPU is idle (or in use). Oh, we have thought about using the proc filesystem, but I don't think all that system call activity would be such a good idea in hard real-time. Does anyone know of a service we can use? Thanks! -- +----------------------------------------------------------------------------+ | Kevin Barrett | Albuquerque, New Mexico, USA | | kbarrett@rt66.com | http://www.rt66.com/~kbarrett | +----------------------------------------------------------------------------+ "What about the Rimmer Directive, which states: 'Never tangle with anything that's got more teeth than the entire Osmond family'?" - Arnold Rimmer