Date: Sat, 21 May 2005 18:49:36 +0800 (CST) From: shiner chen <shiner_chen@yahoo.com.cn> To: freebsd-hackers@freebsd.org Subject: how to get the status of cpu in kernel? Message-ID: <20050521104937.70622.qmail@web15509.mail.cnb.yahoo.com>
next in thread | raw e-mail | index | archive | help
In order to implement a dispacthing policy I want to get the status of cpu. I have read the code of top command and i find it get the status of cpu by the function : int sysctlbyname(const char *, void *, size_t *, void *, size_t); I search the code of kernel ,then I consider that i can get the status of cpu through the funciton: int kernel_sysctlbyname(struct thread *td, char *name, void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval); I try to get the status of cpu by that function ,but it does not work! who can tell me the problem? How do i get the status of cpu? How do i use it if the funcion is right? what's the mean of the function's arguments ? thanks ! shiner_chen May 21th 2005 --------------------------------- Do You Yahoo!? 注册世界一流品质的雅虎免费电邮
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050521104937.70622.qmail>