Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Apr 2004 22:27:23 +0200
From:      des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=)
To:        Jose Marcio Martins da Cruz <Jose-Marcio.Martins@ensmp.fr>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Pointers about CPU load measuring
Message-ID:  <xzpsmfm5dn8.fsf@dwp.des.no>
In-Reply-To: <406D6CEF.9030501@ensmp.fr> (Jose Marcio Martins da Cruz's message of "Fri, 02 Apr 2004 15:38:55 %2B0200")
References:  <406D6CEF.9030501@ensmp.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
Jose Marcio Martins da Cruz <Jose-Marcio.Martins@ensmp.fr> writes:
> Someone can send some pointers on how to measure global CPU load under
> FreeBSD from a C program ? I'm looking for values for
> idle/kernel/user, in a similar way as does top. Is there any pointer
> or doc ?. I'd like to avoir browsing top code.

Use sysctlbyname(3) to retrieve vm.loadavg, which is a struct loadavg
(defined in <sys/resource.h>)

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpsmfm5dn8.fsf>