From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 16 17:07:58 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B041410; Tue, 16 Dec 2014 17:07:58 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72C34D54; Tue, 16 Dec 2014 17:07:58 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 69846B97B; Tue, 16 Dec 2014 12:07:57 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Subject: Re: top -d1 behavior Date: Tue, 16 Dec 2014 12:03:44 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <54723E7E.8080509@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201412161203.44257.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 16 Dec 2014 12:07:57 -0500 (EST) Cc: Allan Jude , Fernando =?utf-8?q?Apestegu=C3=ADa?= X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 17:07:58 -0000 On Sunday, November 23, 2014 4:57:33 pm Fernando Apestegu=C3=ADa wrote: > > Neither seem like what the user would expect. >=20 > Agreed. But this is mostly unexpected (and can lead scripts to fail): Actually, I think having it output the states since boot would be more consistent with other tools like iostat/vmstat/etc. They report states on the first iteration that are states since boot. For example: % iostat 1 tty ada0 ada1 cd0 cpu tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id 8 225 20.41 12 0.24 20.56 12 0.24 2.79 0 0.00 3 0 2 0 95 0 6230 60.00 6 0.35 64.80 10 0.62 0.00 0 0.00 9 0 91 0 0 0 6195 64.00 5 0.31 51.43 7 0.35 0.00 0 0.00 11 0 89 0 1 Can you test this test patch to see if it gives you what you expect from top -d1? Index: contrib/top/top.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- top.c (revision 275828) +++ top.c (working copy) @@ -176,7 +176,7 @@ char *argv[]; int preset_argc =3D 0; char **av; int ac; =2D char dostates =3D No; + char dostates =3D Yes; char do_unames =3D Yes; char interactive =3D Maybe; char warnings =3D 0; =2D-=20 John Baldwin