From owner-freebsd-hackers Mon Mar 25 18:12:21 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from 12-234-96-171.client.attbi.com (12-234-96-171.client.attbi.com [12.234.96.171]) by hub.freebsd.org (Postfix) with ESMTP id D35EA37B400 for ; Mon, 25 Mar 2002 18:12:18 -0800 (PST) Received: by 12-234-96-171.client.attbi.com (Postfix, from userid 1000) id 8DA295E72; Thu, 25 Apr 2002 18:12:08 -0700 (PDT) Date: Thu, 25 Apr 2002 18:12:08 -0700 From: Jon Mini To: Rayson Ho Cc: hackers@FreeBSD.ORG Subject: Re: Help with getting load information Message-ID: <20020425181208.A42560@stylus.haikugeek.com> References: <20020325172816.A2514@Odin.AC.HMC.Edu> <20020326015427.48101.qmail@web11407.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <20020326015427.48101.qmail@web11407.mail.yahoo.com>; from raysonlogin@yahoo.com on Mon, Mar 25, 2002 at 05:54:27PM -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 Rayson Ho [raysonlogin@yahoo.com] wrote : > Does "top" use those calls?? No. > Rayson > > --- Brooks Davis wrote: > > On Mon, Mar 25, 2002 at 05:16:26PM -0800, Ron Chen wrote: > > > Hi all, > > > > > > 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 > > > > -- > > 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 > > > > > ATTACHMENT part 2 application/pgp-signature > > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Movies - coverage of the 74th Academy Awards® > http://movies.yahoo.com/ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- Jonathan Mini mini@haikugeek.com Yersterday, I was ashamed of myself. Today, I am just hungry. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message