how to get the status of cpu in kernel?

From: shiner chen (shiner_chen_at_yahoo.com.cn)
Date: 05/21/05

  • Next message: Danny Braniss: "Re: WRAP.1E and geode.c"
    Date: Sat, 21 May 2005 18:49:36 +0800 (CST)
    To: freebsd-hackers@freebsd.org
    
    

    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!?
    注册世界一流品质的雅虎免费电邮
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Danny Braniss: "Re: WRAP.1E and geode.c"

    Relevant Pages