svn commit: r263331 - head/usr.bin/netstat
Gleb Smirnoff
glebius at FreeBSD.org
Wed Mar 19 03:33:33 UTC 2014
Author: glebius
Date: Wed Mar 19 03:33:32 2014
New Revision: 263331
URL: http://svnweb.freebsd.org/changeset/base/263331
Log:
Now, after r263102 we have ifi_oqdrops in if_data, restore printing of
output queue drops in netstat(1).
No driver, neither kernel fills this field in if_data, yet.
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Modified:
head/usr.bin/netstat/if.c
Modified: head/usr.bin/netstat/if.c
==============================================================================
--- head/usr.bin/netstat/if.c Wed Mar 19 01:43:03 2014 (r263330)
+++ head/usr.bin/netstat/if.c Wed Mar 19 03:33:32 2014 (r263331)
@@ -249,7 +249,7 @@ intpr(int interval, void (*pfunc)(char *
printf(" %10.10s","Obytes");
printf(" %5s", "Coll");
if (dflag)
- printf(" %s", "Drop");
+ printf(" %s", "Drop");
putchar('\n');
}
@@ -358,7 +358,8 @@ intpr(int interval, void (*pfunc)(char *
if (bflag)
show_stat("lu", 10, IFA_STAT(obytes), link|network);
show_stat("NRSlu", 5, IFA_STAT(collisions), link);
- /* XXXGL: output queue drops */
+ if (dflag)
+ show_stat("LSlu", 5, IFA_STAT(oqdrops), link);
putchar('\n');
if (!aflag)
@@ -438,6 +439,7 @@ struct iftot {
u_long ift_id; /* input drops */
u_long ift_op; /* output packets */
u_long ift_oe; /* output errors */
+ u_long ift_od; /* output drops */
u_long ift_co; /* collisions */
u_long ift_ib; /* input bytes */
u_long ift_ob; /* output bytes */
@@ -473,6 +475,7 @@ fill_iftot(struct iftot *st)
st->ift_ib += IFA_STAT(ibytes);
st->ift_op += IFA_STAT(opackets);
st->ift_oe += IFA_STAT(oerrors);
+ st->ift_od += IFA_STAT(oqdrops);
st->ift_ob += IFA_STAT(obytes);
st->ift_co += IFA_STAT(collisions);
}
@@ -551,7 +554,8 @@ loop:
show_stat("lu", 5, new->ift_oe - old->ift_oe, 1);
show_stat("lu", 10, new->ift_ob - old->ift_ob, 1);
show_stat("NRSlu", 5, new->ift_co - old->ift_co, 1);
- /* XXXGL: output queue drops */
+ if (dflag)
+ show_stat("LSlu", 5, new->ift_od - old->ift_od, 1);
putchar('\n');
fflush(stdout);
More information about the svn-src-head
mailing list