Re: systat and livelocks

2010-11-27 Thread Can Erkin Acar

On 11/25/10 05:57, 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).


It is interesting that claudio@ made it display differences about 3 
weeks ago. It was displaying absolute values before.


I am not 100% happy with the diff. Some systat views have a mode where 
you can display the absolute and difference values.  At present, this 
works for 'if' and 'vmstat' views. It is not yet documented after the 
rewrite (although it was present in the original systat as well).


The modes are selected by the 'r', 'b', 't' and 'z' keys. 'r' is for 
RUN, the values start from zero, and accumulated (pressing 'z' zeroes 
the values again). In TIME ('t') mode, they are cleared at every 'tick', 
showing the differences. In BOOT mode ('b') the values since system boot 
are shown.


Perhaps it makes more sense to have this documented, and added to other 
views. It is probably better than adding a separate column for different 
interpretations of the same value.



Can



Re: systat and livelocks

2010-11-25 Thread Mark Kettenis
> Date: Thu, 25 Nov 2010 15:31:38 +0100
> From: Claudio Jeker 
> 
> 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.

The total number of livelocks tells me how badly my host has been
affected by livelocks in the past.  That is useful to know.  Not sure
whether it is systat's job to report it though.  The sysctl is good
enough for me.



Re: systat and livelocks

2010-11-25 Thread Claudio Jeker
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 -   1.31
> +++ mbufs.c   25 Nov 2010 13:55:48 -
> @@ -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_LLOCKSFIELD_ADDR(3)
> -#define FLD_MB_MSIZE FIELD_ADDR(4)
> -#define FLD_MB_MALIVEFIELD_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_NOWFIELD_ADDR(3)
> +#define FLD_MB_LLOCKS_SUMFIELD_ADDR(4)
> +#define FLD_MB_MSIZE FIELD_ADDR(5)
> +#define FLD_MB_MALIVEFIELD_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



systat and livelocks

2010-11-25 Thread Jasper Lievisse Adriaanse
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).

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 -   1.31
+++ mbufs.c 25 Nov 2010 13:55:48 -
@@ -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_MLWMFIELD_ADDR(6)
-#define FLD_MB_MHWMFIELD_ADDR(7)
-#define FLD_MB_MCWMFIELD_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_MLWMFIELD_ADDR(7)
+#define FLD_MB_MHWMFIELD_ADDR(8)
+#define FLD_MB_MCWMFIELD_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);