From owner-freebsd-hackers Mon Mar 25 17:28:28 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id 5445F37B41C for ; Mon, 25 Mar 2002 17:28:21 -0800 (PST) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id g2Q1SGG04013; Mon, 25 Mar 2002 17:28:16 -0800 Date: Mon, 25 Mar 2002 17:28:16 -0800 From: Brooks Davis To: Ron Chen Cc: hackers@FreeBSD.ORG Subject: Re: Help with getting load information Message-ID: <20020325172816.A2514@Odin.AC.HMC.Edu> References: <20020326011626.85427.qmail@web14703.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020326011626.85427.qmail@web14703.mail.yahoo.com>; from ron_chen_123@yahoo.com on Mon, Mar 25, 2002 at 05:16:26PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 25, 2002 at 05:16:26PM -0800, Ron Chen wrote: > Hi all, >=20 > Is there a set of APIs that I can use to get the > system information like the memory size, swap size, # > of CPUs? For some globus GRIS scripts, I'm using the sysctls vm.stats.vm.v_page_size and vm.stats.vm.v_page_count to get memory size. I'm calculating free memory (a bogus concept in FreeBSD) as total-active-inactive-wired, all of which are available under vm.stats.vm. Swap information is available from the swapinfo command. If you really need it in an API you could just steal the code. The number of cpus is easy as it's just the hw.ncpu sysctl. Other information is currently difficult to obtain and I'm currently parsing the output of the cpuid port to obtain a fair bit of it. The only source of Mhz is /var/run/dmesg.boot. > Also, I want to get the information about the load, > and also process information. Load is available from the sysctl vm.loadavg. -- 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 --zhXaljGHf11kAtnf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8n86vXY6L6fI4GtQRAvezAJ9/MFpNfpZUCsN4JVdMH4WUiknXeQCfbEmt uw68UQz3I7jwKFvejBx95sU= =5b6/ -----END PGP SIGNATURE----- --zhXaljGHf11kAtnf-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message