From owner-svn-src-all@FreeBSD.ORG Wed Mar 19 03:33:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DE2F219; Wed, 19 Mar 2014 03:33:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 209657F9; Wed, 19 Mar 2014 03:33:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2J3XWPw008448; Wed, 19 Mar 2014 03:33:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2J3XWOU008447; Wed, 19 Mar 2014 03:33:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201403190333.s2J3XWOU008447@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 19 Mar 2014 03:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263331 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Mar 2014 03:33:33 -0000 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);