how to get the status of cpu in kernel?
shiner_chen at yahoo.com.cn
Sat May 21 10:49:39 GMT 2005
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 ?
May 21th 2005
Do You Yahoo!?
More information about the freebsd-hackers