From owner-freebsd-hackers Thu Nov 4 9:24:31 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.rdc1.sfba.home.com (ha1.rdc1.sfba.home.com [24.0.0.66]) by hub.freebsd.org (Postfix) with ESMTP id B85B1152C5 for ; Thu, 4 Nov 1999 09:24:28 -0800 (PST) (envelope-from adsharma@c62443-a.frmt1.sfba.home.com) Received: from c62443-a.frmt1.sfba.home.com ([24.0.69.165]) by mail.rdc1.sfba.home.com (InterMail v4.01.01.00 201-229-111) with ESMTP id <19991104172304.WNAO11261.mail.rdc1.sfba.home.com@c62443-a.frmt1.sfba.home.com>; Thu, 4 Nov 1999 09:23:04 -0800 Received: (from adsharma@localhost) by c62443-a.frmt1.sfba.home.com (8.9.3/8.9.3) id JAA00787; Thu, 4 Nov 1999 09:23:04 -0800 Date: Thu, 4 Nov 1999 09:23:04 -0800 From: Arun Sharma To: "Matthew N. Dodd" Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: kstat - an API for gathering kernel stats Message-ID: <19991104092304.A708@home.com> References: <19991103215642.A31757@home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: ; from Matthew N. Dodd on Thu, Nov 04, 1999 at 02:53:51AM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Nov 04, 1999 at 02:53:51AM -0500, Matthew N. Dodd wrote: > On Wed, 3 Nov 1999, Arun Sharma wrote: > > A user program makes a system call with this string "cpu.system" to get > > the current value of user/system/nice time etc. > > How is this different from doing: > > # sysctl -a | grep load > vm.loadavg: { 0.15 0.09 0.04 } > > Ideally we could have a syscall that could return the OID for a given name > to solve the portability and speed issues associated with doing repeated > lookups. > > Seems like you've reinvented the wheel to me. I just looked at the sysctl implementation and there are some differences. Moreover, since it was not being used in tools like vmstat and xosview, I thought there must be a reason. sysctl also seems to assume that it doesn't get called frequently. So mapping the name to the sysctl data is a slightly more heavy duty operation than a hash table lookup. -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message