From owner-svn-src-all@FreeBSD.ORG Tue Feb 15 09:30:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B2AD106566B; Tue, 15 Feb 2011 09:30:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F36848FC1F; Tue, 15 Feb 2011 09:30:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1F9UVuO024699; Tue, 15 Feb 2011 09:30:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1F9UVMT024696; Tue, 15 Feb 2011 09:30:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201102150930.p1F9UVMT024696@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 15 Feb 2011 09:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218704 - stable/7/sys/compat/linprocfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 15 Feb 2011 09:30:32 -0000 Author: bz Date: Tue Feb 15 09:30:31 2011 New Revision: 218704 URL: http://svn.freebsd.org/changeset/base/218704 Log: MFC r218114: Update interface stats counters to match the current format in linux and try to export as much information as we can match. Requested on: Debian GNU/kFreeBSD list (debian-bsd lists.debian.org) 2010-12 Tested by: Mats Erik Andersson (mats.andersson gisladisker.se) Modified: stable/7/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/7/sys/compat/linprocfs/linprocfs.c Tue Feb 15 09:28:07 2011 (r218703) +++ stable/7/sys/compat/linprocfs/linprocfs.c Tue Feb 15 09:30:31 2011 (r218704) @@ -1008,19 +1008,42 @@ linprocfs_donetdev(PFS_FILL_ARGS) char ifname[16]; /* XXX LINUX_IFNAMSIZ */ struct ifnet *ifp; - sbuf_printf(sb, "%6s|%58s|%s\n%6s|%58s|%58s\n", - "Inter-", " Receive", " Transmit", " face", - "bytes packets errs drop fifo frame compressed", - "bytes packets errs drop fifo frame compressed"); + sbuf_printf(sb, "%6s|%58s|%s\n" + "%6s|%58s|%58s\n", + "Inter-", " Receive", " Transmit", + " face", + "bytes packets errs drop fifo frame compressed multicast", + "bytes packets errs drop fifo colls carrier compressed"); IFNET_RLOCK(); TAILQ_FOREACH(ifp, &ifnet, if_link) { linux_ifname(ifp, ifname, sizeof ifname); - sbuf_printf(sb, "%6.6s:", ifname); - sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ", - 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL); + sbuf_printf(sb, "%6.6s: ", ifname); + sbuf_printf(sb, "%7lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ", + ifp->if_ibytes, /* rx_bytes */ + ifp->if_ipackets, /* rx_packets */ + ifp->if_ierrors, /* rx_errors */ + ifp->if_iqdrops, /* rx_dropped + + * rx_missed_errors */ + 0UL, /* rx_fifo_errors */ + 0UL, /* rx_length_errors + + * rx_over_errors + + * rx_crc_errors + + * rx_frame_errors */ + 0UL, /* rx_compressed */ + ifp->if_imcasts); /* multicast, XXX-BZ rx only? */ sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n", - 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL); + ifp->if_obytes, /* tx_bytes */ + ifp->if_opackets, /* tx_packets */ + ifp->if_oerrors, /* tx_errors */ + 0UL, /* tx_dropped */ + 0UL, /* tx_fifo_errors */ + ifp->if_collisions, /* collisions */ + 0UL, /* tx_carrier_errors + + * tx_aborted_errors + + * tx_window_errors + + * tx_heartbeat_errors */ + 0UL); /* tx_compressed */ } IFNET_RUNLOCK();