Date: Thu, 4 Nov 1999 09:23:04 -0800 From: Arun Sharma <adsharma@home.com> To: "Matthew N. Dodd" <winter@jurai.net> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: kstat - an API for gathering kernel stats Message-ID: <19991104092304.A708@home.com> In-Reply-To: <Pine.BSF.4.20.9911040251030.18969-100000@sasami.jurai.net>; from Matthew N. Dodd on Thu, Nov 04, 1999 at 02:53:51AM -0500 References: <19991103215642.A31757@home.com> <Pine.BSF.4.20.9911040251030.18969-100000@sasami.jurai.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991104092304.A708>