From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 17 22:27:42 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 41098CBC; Wed, 17 Dec 2014 22:27:42 +0000 (UTC) Received: from mail-wg0-x22b.google.com (mail-wg0-x22b.google.com [IPv6:2a00:1450:400c:c00::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C669F936; Wed, 17 Dec 2014 22:27:41 +0000 (UTC) Received: by mail-wg0-f43.google.com with SMTP id l18so25372wgh.2; Wed, 17 Dec 2014 14:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=+6+beEliBdFzvVkKeiWBR1dMZzDoHqB5cHWOskQI7sc=; b=tH4Ym7zW0UV8XfhLh5PxWnV0KaNtCTeK+lYMXiYIudlZjpTDdEgb2RfTxh7LEDxteH Y8qqrW920pLI7hxtESidyWZE4nxlKhVTfz1POX+B7k1AUqCBSVwH8+Y1K6rvueBFDvIW qaLkDJft5k4dApVw1ohqMCZDTmkAGKqGuxL3rByTAgVs4h1Of44ETl8Cf3YlaHfc8PQt 3PYMa+ZzJNJOth043XuYcdUPujw6uw4Ql5/WBH3Id/eGTlHxShRZA3NM4NozS/D4kNTe qvlE0U3wNEMY5iWUCWgKO4SDQAWa0/+w6I0leJTHFicypkzWpnpD2+5DhQE8LqUWBsqW 6KSA== MIME-Version: 1.0 X-Received: by 10.194.234.40 with SMTP id ub8mr78734209wjc.100.1418855260241; Wed, 17 Dec 2014 14:27:40 -0800 (PST) Received: by 10.180.198.52 with HTTP; Wed, 17 Dec 2014 14:27:40 -0800 (PST) In-Reply-To: <201412161203.44257.jhb@freebsd.org> References: <54723E7E.8080509@freebsd.org> <201412161203.44257.jhb@freebsd.org> Date: Wed, 17 Dec 2014 23:27:40 +0100 Message-ID: Subject: Re: top -d1 behavior From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Hackers , Allan Jude 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: Wed, 17 Dec 2014 22:27:42 -0000 On Tue, Dec 16, 2014 at 6:03 PM, John Baldwin wrote: > On Sunday, November 23, 2014 4:57:33 pm Fernando Apestegu=C3=ADa wrote: >> > Neither seem like what the user would expect. >> >> 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? Yes it does. I thought however that the discussion was over :) so I filed a PR[1] to at least warn in the man page about the special behavior for this case. I would rather fix top and leave the man page as it is. Cheers. [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D195717 > > 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 > --- top.c (revision 275828) > +++ top.c (working copy) > @@ -176,7 +176,7 @@ char *argv[]; > int preset_argc =3D 0; > char **av; > int ac; > - char dostates =3D No; > + char dostates =3D Yes; > char do_unames =3D Yes; > char interactive =3D Maybe; > char warnings =3D 0; > > -- > John Baldwin