From owner-cvs-src@FreeBSD.ORG Mon Dec 29 00:25:34 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0279B16A4CE; Mon, 29 Dec 2003 00:25:34 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2978543D41; Mon, 29 Dec 2003 00:25:33 -0800 (PST) (envelope-from bde@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id hBT8PW0B014329; Mon, 29 Dec 2003 00:25:32 -0800 (PST) (envelope-from bde@repoman.freebsd.org) Received: (from bde@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id hBT8PW6o014328; Mon, 29 Dec 2003 00:25:32 -0800 (PST) (envelope-from bde) Message-Id: <200312290825.hBT8PW6o014328@repoman.freebsd.org> From: Bruce Evans Date: Mon, 29 Dec 2003 00:25:32 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.bin/netstat mbuf.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2003 08:25:34 -0000 bde 2003/12/29 00:25:32 PST FreeBSD src repository Modified files: usr.bin/netstat mbuf.c Log: Use floating point instead of unsigned long longs in percentage calculations. Long longs should never be used, since they break compiling with C90 compilers and don't necessarily work any better than longs for avoiding overflow. Print percentages with another digit of precision since they can be small and this is easy to do now that the format is floating point. Restored some more of the old -m output: Print the percentage of allocated memory that is in use. This is the amount of memory in active mbufs and mbuf clusters relative to the total amount of memory soft-allocated for mbufs and mbuf clusters. Print the percentage of allocated memory that is wired (cached). The old mbuf allocator never freed memory so printing this value wasn't useful. A previous version of netstat for the new allocator printed the in-use amount as a percentage of the wired amount. Fixed some nearby style bugs (excessive parenthesization and a redundant return). Reviewed by: alfred Revision Changes Path 1.39 +13 -13 src/usr.bin/netstat/mbuf.c