On Thu, Nov 25, 2010 at 02:57:56PM +0100, Jasper Lievisse Adriaanse wrote:
> Hi,
> 
> Currently the 'mbufs' view of systat only shows the difference of livelocks,
> this diff also adds the actual total (or sum). This is info most people are
> actually looking for anyway (as noticed by kettenis and sthen yesterday).
> 

Why? The total number of livelocks is just a number it has no
meaningful value. I also wonder why yet another column needs to be added
for something that is just printed once. systat mbuf output may actually
need some rework.

> OK?
> 
> -- 
> Cheers,
> Jasper
> 
> "Stay Hungry. Stay Foolish."
> 
> Index: mbufs.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/systat/mbufs.c,v
> retrieving revision 1.31
> diff -p -u -r1.31 mbufs.c
> --- mbufs.c   5 Nov 2010 10:07:30 -0000       1.31
> +++ mbufs.c   25 Nov 2010 13:55:48 -0000
> @@ -61,7 +61,8 @@ field_def fields_mbuf[] = {
>       {"IFACE", 8, 16, 1, FLD_ALIGN_LEFT, -1, 0, 0, 0},
>       {"RXDELAY", 5, 8, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
>       {"TXDELAY", 5, 8, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
> -     {"LIVELOCKS", 5, 10, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
> +     {"LIVELOCKS (NOW)", 5, 15, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
> +     {"(SUM)", 5, 10, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
>       {"SIZE", 3, 5, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
>       {"ALIVE", 3, 5, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
>       {"LWM", 3, 5, 1, FLD_ALIGN_RIGHT, -1, 0, 0, 0},
> @@ -72,15 +73,16 @@ field_def fields_mbuf[] = {
>  
>  #define FIELD_ADDR(x) (&fields_mbuf[x])
>  
> -#define FLD_MB_IFACE FIELD_ADDR(0)
> -#define FLD_MB_RXDELAY       FIELD_ADDR(1)
> -#define FLD_MB_TXDELAY       FIELD_ADDR(2)
> -#define FLD_MB_LLOCKS        FIELD_ADDR(3)
> -#define FLD_MB_MSIZE FIELD_ADDR(4)
> -#define FLD_MB_MALIVE        FIELD_ADDR(5)
> -#define FLD_MB_MLWM  FIELD_ADDR(6)
> -#define FLD_MB_MHWM  FIELD_ADDR(7)
> -#define FLD_MB_MCWM  FIELD_ADDR(8)
> +#define FLD_MB_IFACE         FIELD_ADDR(0)
> +#define FLD_MB_RXDELAY               FIELD_ADDR(1)
> +#define FLD_MB_TXDELAY               FIELD_ADDR(2)
> +#define FLD_MB_LLOCKS_NOW    FIELD_ADDR(3)
> +#define FLD_MB_LLOCKS_SUM    FIELD_ADDR(4)
> +#define FLD_MB_MSIZE         FIELD_ADDR(5)
> +#define FLD_MB_MALIVE                FIELD_ADDR(6)
> +#define FLD_MB_MLWM          FIELD_ADDR(7)
> +#define FLD_MB_MHWM          FIELD_ADDR(8)
> +#define FLD_MB_MCWM          FIELD_ADDR(9)
>  
>  
>  /* Define views */
> @@ -89,7 +91,7 @@ field_def *view_mbuf[] = {
>  #if NOTYET
>       FLD_MB_RXDELAY, FLD_MB_TXDELAY,
>  #endif
> -     FLD_MB_LLOCKS, FLD_MB_MSIZE, FLD_MB_MALIVE, FLD_MB_MLWM, FLD_MB_MHWM,
> +     FLD_MB_LLOCKS_NOW, FLD_MB_LLOCKS_SUM, FLD_MB_MSIZE, FLD_MB_MALIVE, 
> FLD_MB_MLWM, FLD_MB_MHWM,
>       FLD_MB_MCWM, NULL
>  };
>  
> @@ -353,7 +355,8 @@ showmbuf(struct if_info *ifi, int p, int
>               print_fld_str(FLD_MB_IFACE, ifi->name);
>  
>       if (p == -1 && ifi == interfaces) {
> -             print_fld_uint(FLD_MB_LLOCKS, mcllivelocks_diff);
> +             print_fld_uint(FLD_MB_LLOCKS_NOW, mcllivelocks_diff);
> +             print_fld_uint(FLD_MB_LLOCKS_SUM, mcllivelocks_cur);
>               print_fld_size(FLD_MB_MSIZE, mbpool.pr_size);
>               print_fld_size(FLD_MB_MALIVE, mbpool.pr_nget - mbpool.pr_nput);
>               print_fld_size(FLD_MB_MHWM, mbpool.pr_hiwat);
> 

-- 
:wq Claudio

Reply via email to