From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 2 10:46:16 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E4AED16A4CE for ; Fri, 2 Apr 2004 10:46:16 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5C1143D1D for ; Fri, 2 Apr 2004 10:46:16 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.3) with ESMTP id i32Ik2QF010136; Fri, 2 Apr 2004 10:46:03 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i32Ik288010135; Fri, 2 Apr 2004 10:46:02 -0800 Date: Fri, 2 Apr 2004 10:46:02 -0800 From: Brooks Davis To: Jose Marcio Martins da Cruz Message-ID: <20040402184600.GD11637@Odin.AC.HMC.Edu> References: <406D6CEF.9030501@ensmp.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C+ts3FVlLX8+P6JN" Content-Disposition: inline In-Reply-To: <406D6CEF.9030501@ensmp.fr> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: freebsd-hackers@freebsd.org Subject: Re: Pointers about CPU load measuring X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2004 18:46:17 -0000 --C+ts3FVlLX8+P6JN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 02, 2004 at 03:38:55PM +0200, Jose Marcio Martins da Cruz wrote: >=20 > Someone can send some pointers on how to measure global CPU load under=20 > FreeBSD from a C program ? I'm looking for values for idle/kernel/user,= =20 > in a similar way as does top. Is there any pointer or doc ?. I'd like to= =20 > avoir browsing top code. The top code is rather gross. You might take a look at the Ganglia source code. It products metrics like that in fairly focused functions so it's more readable then top. The file you're intrested in is here: http://cvs.sourceforge.net/viewcvs.py/ganglia/monitor-core/gmond/machines/f= reebsd.c?rev=3D1.7&view=3Dauto If you want to play with the whole thing, the sysutils/ganglia-monitor-core port may be of use. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --C+ts3FVlLX8+P6JN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAbbTnXY6L6fI4GtQRAqsJAJ9CMg2AJNNt31VZ1sTqlShQiULoCwCdF9c3 O5MOcBHylk7bfBeQi1pWe4I= =FRFG -----END PGP SIGNATURE----- --C+ts3FVlLX8+P6JN--