DragonFly BSD
DragonFly users List (threaded) for 2005-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: SMP CPU Statistics


To: John Leimon <jleimon@xxxxxxxxxxxxx>
From: Hiten Pandya <hmp@xxxxxxxxxxxxx>
Date: Fri, 29 Apr 2005 13:13:06 +0100

John Leimon wrote:
I'm trying to write a simple CPU load monitor program that can measure load
on multiple CPUs. I have been looking at top and ps sourcecode and have
come across the kinfo_get_sched_cputime function which is basically a
measure of the overall system load. Is there any way to measure load on a
per-cpu basis?

John

John, the CPU load statistics are now on a per-cpu basis. The API function, kinfo_get_sched_cputime provides an aggregated view.

	You can use the kern.cputime sysctl for getting an array of struct
	kinfo_cputime, indexed by CPUs.  In a day I will commit a program
	called cpustat(8) which will be able to display CPU load statistics
	for each CPU, just the way top(1) does.

Hope that helps.

Kind regards,

			-Hiten
			Hiten Pandya
			hmp@xxxxxxxxxxxxxxxx



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