Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Dec 2014 12:03:44 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Allan Jude <allanjude@freebsd.org>, Fernando =?utf-8?q?Apestegu=C3=ADa?= <fernando.apesteguia@gmail.com>
Subject:   Re: top -d1 behavior
Message-ID:  <201412161203.44257.jhb@freebsd.org>
In-Reply-To: <CAGwOe2amb-6%2BHHhkFOkgE7xk7HSNgAgf5o2S2p4Kw%2Btgigifnw@mail.gmail.com>
References:  <CAGwOe2Zp2cHhCb%2Br_m5HZYJFyc=3DDsPEi7v_7ZVxJ0fkO1jEA@mail.gmail.com> <54723E7E.8080509@freebsd.org> <CAGwOe2amb-6%2BHHhkFOkgE7xk7HSNgAgf5o2S2p4Kw%2Btgigifnw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412161203.44257.jhb>