From owner-freebsd-current Sat Jan 4 13:49:24 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2890537B401; Sat, 4 Jan 2003 13:49:21 -0800 (PST) Received: from arpa.com (arpa.com [199.245.173.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89BF543ED4; Sat, 4 Jan 2003 13:49:20 -0800 (PST) (envelope-from trent@arpa.com) Received: from localhost (localhost [127.0.0.1]) by arpa.com (Postfix) with ESMTP id D8258996; Sat, 4 Jan 2003 15:49:14 -0600 (CST) Received: by arpa.com (Postfix, from userid 1041) id 0D1D6A3A; Sat, 4 Jan 2003 15:49:14 -0600 (CST) Date: Sat, 4 Jan 2003 15:49:13 -0600 From: Trent Nelson To: phk@freebsd.org Cc: freebsd-current@freebsd.org Subject: Re: systat -ifstat patch Message-ID: <20030104214913.GA11874@arpa.com> References: <20030104161950.GA56080@arpa.com> <3193.1041713447@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <3193.1041713447@critter.freebsd.dk> User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS snapshot-20020531 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 04, 2003 at 09:50:47PM +0100, phk@freebsd.org wrote: > This looks pretty useful. Thanks! I think so, so have most other people I've spoken to. > As far as I can see you have some genuine fixes in there: > > >--- /shared/data/trent/src/src/usr.bin/systat/cmds.c Wed Dec 12 00:13:37 2001 > >+++ /usr/src/usr.bin/systat/cmds.c Sat Jan 4 14:11:32 2003 > >@@ -119,6 +119,7 @@ > > goto done; > > alarm(0); > > (*curcmd->c_close)(wnd); > >+ curcmd->c_flags &= ~CF_INIT; > > wnd = (*p->c_open)(); > > if (wnd == 0) { > > error("Couldn't open new display"); > > We should probably commit them in a separate commit first. I agree. That particular bug caused me a lot of grief this morning before I tracked it down. None of the other displays were affected 'cause they didn't have to allocate any structures dynamically. I've attached cmds.c.patch to this e-mail. > >diff -uBN /shared/data/trent/src/src/usr.bin/systat/convtbl.c /usr/src/usr.bin/systat/convtbl.c > >--- /shared/data/trent/src/src/usr.bin/systat/convtbl.c Thu Jan 1 01:00:00 1970 > >+++ /usr/src/usr.bin/systat/convtbl.c Sat Jan 4 00:13:11 2003 > >@@ -0,0 +1,98 @@ > > This is only used for the ifstat page, right ? Should/Could bits > of the other code use it as well ? Yup, it's currently only used for the ifstat display. No other displays did automatic scaling so I had to write it from scratch. The only possible contender for using this code would be vmstat's disk usage stats on the bottom left of the screen -- but I think that would just unnecessarily clutter the display more than it already is. What would be nice is a new diskstat display that is the same as ifstat, except you display transfer rates for drives on the system. I think a lot of people would find this useful (possibly even more so than the ifstat display). What do you think? > > .\" @(#)systat.1 8.2 (Berkeley) 12/30/93 > >-.\" $FreeBSD: src/usr.bin/systat/systat.1,v 1.36 2002/12/27 12:15:35 schweikh Exp $ > >+.\" $FreeBSD: src/usr.bin/systat/systat.1,v 1.23.2.9 2002/12/29 16:35:40 schweikh Exp $ > > This looks worrisome to me, and some of the deltas look more so: Erm. Eek. I think I copied the -stable systat.1 into my -current sources. I fixed this in the new patch, which can be found at http://arpa.com/~trent. My bad. (``systat-ifstat-current.patch'' also now has the modification to cmds.c taken out and placed separately in ``cmds.c.patch''.) > Otherwise I think it looks good. Glad to hear it. > Poul-Henning Kamp Regards, Trent. --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cmds.c.patch" Index: cmds.c =================================================================== RCS file: /home/ncvs/src/usr.bin/systat/cmds.c,v retrieving revision 1.4 diff -u -r1.4 cmds.c --- cmds.c 12 Dec 2001 00:13:37 -0000 1.4 +++ cmds.c 4 Jan 2003 14:11:32 -0000 @@ -119,6 +119,7 @@ goto done; alarm(0); (*curcmd->c_close)(wnd); + curcmd->c_flags &= ~CF_INIT; wnd = (*p->c_open)(); if (wnd == 0) { error("Couldn't open new display"); --MGYHOYXEY6WxJCY8-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message