vCenter

 View Only
  • 1.  cpu time resolution

    Posted Feb 22, 2007 12:13 AM
    doug,

    i had to change cpu time resolution in the .c files for various platforms. this is because in .c files, integer arithmetic would have already rounds off milliseconds. to get cpu usage of milliseconds, i took the approach of changing the .c files of various platforms at different places.

    wayne


  • 2.  RE: cpu time resolution

    Broadcom Employee
    Posted Feb 22, 2007 02:05 AM
    Hi Wayne,

    Please share your changes (diff -u format preferred) so we can look
    at integrating for future releases. Thanks.

    On Feb 21, 2007, at 4:12 PM, wayne yu wrote:

    > doug,
    >
    > i had to change cpu time resolution in the .c files for various
    > platforms. this is because in .c files, integer arithmetic would
    > have already rounds off milliseconds. to get cpu usage of
    > milliseconds, i took the approach of changing the .c files of
    > various platforms at different places.
    >
    > wayne
    >





  • 3.  RE: cpu time resolution

    Posted Feb 22, 2007 08:13 PM
    For linux:


    I modified linux_sigar.c:

    in fucntion:
    static int proc_stat_read(sigar_t *sigar, sigar_pid_t pid){
    ...
    pstat->utime = sigar_strtoull(ptr)*1000 / sigar->ticks; /* (14) */
    pstat->stime = sigar_strtoull(ptr)*1000 / sigar->ticks; /* (15) */
    ...
    }

    I added 1000 multiplication out there.

    Will send changes I made for two other platforms.

    Regards


  • 4.  RE: cpu time resolution

    Broadcom Employee
    Posted Feb 22, 2007 11:22 PM
    What version of sigar are you using? We changed the cpu times to
    millis in the 1.3.0 release, based on your earlier request:
    http://jira.hyperic.com/browse/SIGAR-19

    In the 1.3.0 version of linux_sigar.c you'll see:

    pstat->utime = SIGAR_TICK2MSEC(sigar_strtoull(ptr)); /* (14) */
    pstat->stime = SIGAR_TICK2MSEC(sigar_strtoull(ptr)); /* (15) */


    On Feb 22, 2007, at 12:13 PM, wayne yu wrote:

    > For linux:
    >
    >
    > I modified linux_sigar.c:
    >
    > in fucntion:
    > static int proc_stat_read(sigar_t *sigar, sigar_pid_t pid){
    > ...
    > pstat->utime = sigar_strtoull(ptr)*1000 / sigar->ticks; /* (14) */
    > pstat->stime = sigar_strtoull(ptr)*1000 / sigar->ticks; /* (15) */
    > ...
    > }
    >
    > I added 1000 multiplication out there.
    >
    > Will send changes I made for two other platforms.
    >
    > Regards
    >





  • 5.  RE: cpu time resolution

    Posted Feb 23, 2007 12:39 AM
    need to start ur new version now. somehow, from source control, i did not see some c source files getting changed.