#17 wio(wait) timer ignored on OSF1

v3.5.1
closed-fixed
Display (18)
5
2005-09-28
2005-09-27
Gordon Lack
No

I've just spent some time working out why OSF1 sar
completely misses some CPU usage and have discovered
that it ignores the si_idle tick counter!

It was your top code that enabled me to track this
down quickly - thanks.

But, in the process I noticed that top ignore the
wait(wio) tick counter:

from <sys/table.h>

struct tbl_sysinfo {
long si_user; /* User time */
long si_nice; /* Nice time */
long si_sys; /* System time */
long si_idle; /* Idle time */
long si_hz;
long si_phz;
long si_boottime; /* Boot time in
seconds */
long wait; /* Wait time */ <<<<<<< THIS ONE !!!!!
int si_max_procs; /*
rpb->rpb_numprocs */
#define usr si_user
#define sys si_sys
#define idle si_idle
};

(Not sure why it has the si_ missing, but hey - this
is OSF1.)

Anyway, attached is a patch for the
machine/m_decosf1.c file in top-3.5.1 which uses all 5
tick counters (and when you use all five tick counters
the sum of their increments each second is 1024, which
looks right to me)

PS: top-3.6alpha-050919.tar.gz won't build, as help.h
is missing.

Discussion

  • William LeFebvre

    Logged In: YES
    user_id=687210

    I dont see a file attached to your original post, but I have
    an idea what needs to be fixed. Thanks for the tip.

    Don't use 3.6alpha (in fact I will be removing that file
    momentarily). I just posted 3.6beta yesterday. Please use that.

     
  • William LeFebvre

    • labels: --> Display
    • milestone: --> v3.5.1
    • assigned_to: nobody --> wnl
     
  • Nobody/Anonymous

    Logged In: NO

    Here's the patch - not sure why no file was attached
    originally.

    =================================

    --- m_decosf1.c.orig Fri Mar 10 15:03:16 2000
    +++ m_decosf1.c Tue Sep 27 15:20:58 2005
    @@ -160,12 +160,12 @@

    /* these are for detailing the cpu states */

    -int cpu_states[4];
    +int cpu_states[5];
    char *cpustatenames[] = {
    - "user", "nice", "system", "idle", NULL
    + "user", "nice", "system", "wio", "idle", NULL
    };

    -long old_cpu_ticks[4];
    +long old_cpu_ticks[5];

    /* these are for detailing the memory statistics */

    @@ -317,7 +317,8 @@
    old_cpu_ticks[0] = sibuf.si_user;
    old_cpu_ticks[1] = sibuf.si_nice;
    old_cpu_ticks[2] = sibuf.si_sys;
    - old_cpu_ticks[3] = sibuf.si_idle;
    + old_cpu_ticks[3] = sibuf.wait;
    + old_cpu_ticks[4] = sibuf.si_idle;

    /* all done! */
    return(0);
    @@ -345,7 +346,7 @@
    struct tbl_swapinfo swbuf;
    vm_statistics_data_t vmstats;
    int swap_pages=0,swap_free=0,i;
    - long new_ticks[4],diff_ticks[4];
    + long new_ticks[5],diff_ticks[5];
    long delta_ticks;

    if (do_last_pid)
    @@ -378,16 +379,17 @@
    return;
    }
    new_ticks[0] = sibuf.si_user ; new_ticks[1] =
    sibuf.si_nice;
    - new_ticks[2] = sibuf.si_sys ; new_ticks[3] =
    sibuf.si_idle;
    + new_ticks[2] = sibuf.si_sys ; new_ticks[3] = sibuf.wait;
    + new_ticks[4] = sibuf.si_idle;
    delta_ticks=0;
    - for(i=0;i<4;i++) {
    + for(i=0;i<5;i++) {
    diff_ticks[i] = new_ticks[i] - old_cpu_ticks[i];
    delta_ticks += diff_ticks[i];
    old_cpu_ticks[i] = new_ticks[i];
    }
    si->cpustates = cpu_states;
    if(delta_ticks)
    - for(i=0;i<4;i++)
    + for(i=0;i<5;i++)
    si->cpustates[i] = (int)( ( (double)diff_ticks[i] /

    (double)delta_ticks ) * 1000 );

     
  • William LeFebvre

    • status: open --> closed-fixed
     
  • William LeFebvre

    Logged In: YES
    user_id=687210

    Fixed in 3.6beta2.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks