cvs commit: src/sys/kern uipc_sockbuf.c src/sys/sys socketvar.h src/usr.bin/netstat inet.c main.c netstat.1 netstat.h

Anton Yuzhaninov citrin at citrin.ru
Fri Nov 14 08:19:50 PST 2008


On 16.05.2008 00:18, George V. Neville-Neil wrote:
> gnn         2008-05-15 20:18:44 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/kern             uipc_sockbuf.c 
>     sys/sys              socketvar.h 
>     usr.bin/netstat      inet.c main.c netstat.1 netstat.h 
>   Log:
>   Update the kernel to count the number of mbufs and clusters
>   (all types) used per socket buffer.
>   
>   Add support to netstat to print out all of the socket buffer
>   statistics.
>   
>   Update the netstat manual page to describe the new -x flag
>   which gives the extended output.
>   
>   Reviewed by:    rwatson, julian
>   
>   Revision  Changes    Path
>   1.177     +2 -0      src/sys/kern/uipc_sockbuf.c
>   1.164     +12 -2     src/sys/sys/socketvar.h
>   1.83      +37 -9     src/usr.bin/netstat/inet.c
>   1.89      +5 -1      src/usr.bin/netstat/main.c
>   1.59      +24 -1     src/usr.bin/netstat/netstat.1
>   1.54      +1 -0      src/usr.bin/netstat/netstat.h

After this commit netstat -Lan show wired output:

Current listen queue sizes (qlen/incqlen/maxqlen)
Proto Listen         Local Address
Proto Recv-Q Send-Q  Local Address          Foreign Address       (state)
tcp4  0/0/10         127.0.0.1.25
tcp4  0/0/128        *.22
tcp4  0/0/128        *.80
tcp4  0/0/86         127.0.0.1.5432

Line:
Proto Recv-Q Send-Q  Local Address          Foreign Address       (state)
should not be shown with -L flag

--- inet.c.orig 2008-11-14 18:54:24.000000000 +0300
+++ inet.c      2008-11-14 18:56:40.000000000 +0300
@@ -407,19 +407,21 @@
                         if (Lflag)
                                 printf("%-5.5s %-14.14s %-22.22s\n",
                                     "Proto", "Listen", "Local Address");
-                       printf((Aflag && !Wflag) ?
-                              "%-5.5s %-6.6s %-6.6s  %-18.18s %-18.18s" :
-                              "%-5.5s %-6.6s %-6.6s  %-22.22s %-22.22s",
-                              "Proto", "Recv-Q", "Send-Q",
-                              "Local Address", "Foreign Address");
-                       if (xflag)
-                               printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %s\n",
-                                      "R-MBUF", "S-MBUF", "R-CLUS", "S-CLUS",
-                                      "R-HIWA", "S-HIWA", "R-LOWA", "S-LOWA",
-                                      "R-BCNT", "S-BCNT", "R-BMAX", "S-BMAX",
-                                      "(state)");
-                       else
-                               printf("(state)\n");
+                       else {
+                               printf((Aflag && !Wflag) ?
+                                   "%-5.5s %-6.6s %-6.6s  %-18.18s %-18.18s" :
+                                   "%-5.5s %-6.6s %-6.6s  %-22.22s %-22.22s",
+                                   "Proto", "Recv-Q", "Send-Q",
+                                   "Local Address", "Foreign Address");
+                               if (xflag)
+                                       printf("%-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %-6.6s %s\n",
+                                           "R-MBUF", "S-MBUF", "R-CLUS", "S-CLUS",
+                                           "R-HIWA", "S-HIWA", "R-LOWA", "S-LOWA",
+                                           "R-BCNT", "S-BCNT", "R-BMAX", "S-BMAX",
+                                           "(state)");
+                               else
+                                       printf("(state)\n");
+                       }
                         first = 0;
                 }
                 if (Lflag && so->so_qlimit == 0)

-- 
  Anton Yuzhaninov


More information about the cvs-src mailing list