public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* How to measue the total CPU specific load (including real time tasks)?
@ 2015-07-07 12:18 Koehrer Mathias (ETAS/ESW5)
  2015-07-08 17:19 ` Joe Korty
  0 siblings, 1 reply; 3+ messages in thread
From: Koehrer Mathias (ETAS/ESW5) @ 2015-07-07 12:18 UTC (permalink / raw)
  To: linux-rt-users@vger.kernel.org

Hi all,

we use the RT_PREEMPT kernel fairly long now and it is working really fine.
However, I have one question that is related to measure the available "CPU headroom" on all available CPU cores.
We are using an Intel Core i7 PC (32 and 64bit, Debian distribution, vanilla kernel + rt_preempt patch).
The question is the same for kernel 3.2.x and 3.18.x.

On the PC a couple of real time threads are running. They are hard bound to a particular CPU core 
(via pthread_setaffinity_np or sched_setaffinity).
As we are using the boot parameter  "isolcpus=1-31", all processes run per default on CPU core 0.
Now, I want to measure the total CPU specific load.
How can this be done easily?

When I use "top" in thread-mode I see the relative CPU load for particular threads/processes.
However the "idle" value in the "top" summary does not fit. With some experiments I saw the idle value for a CPU core to 
be nearly 100% even if on the very same CPU core a real time thread was consuming about 40% CPU time.
I looked into /proc/stat to take the idle tick value but this value seems not to consider the real time threads.


The only approach I found so far is to parse all /proc/PID/stat files periodically and to extract the 
fields utime, stime, cutime, cstime, task_cpu. These values can be used to compute the CPU specific load.
However, the effort to do so is really high.

Is there any /proc file (or something similar) I can use to get the total CPU specific load (including real time threads)?
Or do I have to enable a particular kernel configuration to get this value?

Thanks for any feedback on this question.

Regards

Mathias

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-09 11:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 12:18 How to measue the total CPU specific load (including real time tasks)? Koehrer Mathias (ETAS/ESW5)
2015-07-08 17:19 ` Joe Korty
2015-07-09 11:31   ` Koehrer Mathias (ETAS/ESW5)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox