Date: Mon, 9 Jan 2006 23:59:10 -0800 (PST) From: kamal kc <kamal_ckk@yahoo.com> To: freebsd <freebsd-hackers@freebsd.org> Subject: Re: using get_system_info() - obtaining system load averages Message-ID: <20060110075910.72058.qmail@web30006.mail.mud.yahoo.com> In-Reply-To: <20060110054656.GE89638@dan.emsphone.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--- Dan Nelson <dnelson@allantgroup.com> wrote: > In the last episode (Jan 09), kamal kc said: > > dear everybody, > > > > i want to use the routine get_system_info() to get > the load averages > > of the cpu. i found it that top uses it. > > get_system_info is just a function /in/ top itself > that gets the CPU > usage. It uses the vm.loadavg sysctl to get the > load average. A > simpler way is to just call the getloadavg() > function; see its manpage > for more info. thanks i tried getloadavg() it worked. but when i tried to put it in the kernel the kernel failed to link. i also looked at sysctl(3) and i guess it is also for user based programs. so i looked at the sys/sysctl.h and found that there was sysctl_find_oid() that was defined for kernel. but i don't know how to use it. i could not get any info on the web. the function declaration was :: int sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid, int *nindx, struct sysctl_req *req); isn't it the function i should be using to retrieve the sysctl value ??? how should i use it ?? any demo on using it would be immensely helpful for me. thanks, kamal __________________________________________ Yahoo! DSL – Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060110075910.72058.qmail>