Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2014 18:11:02 +0100
From:      =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= <fernando.apesteguia@gmail.com>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   top -d1 behavior
Message-ID:  <CAGwOe2Zp2cHhCb%2Br_m5HZYJFyc=3DDsPEi7v_7ZVxJ0fkO1jEA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi hackers,

While writing a small script for a friend, I run into a peculiar top behavior:

top -d1 shows only one 'iteration' of the information screen, but in
it, the CPU percentages line is not well formed: there are 5 columns
with the '%' symbol, but no values are shown. This only happens for
-d1 and this behavior is deliberately done in the sources (see
'dostates' variable).

Also we are using pc_cp_time from struct pcpu as the output for the
kern.cp_time sysctl (used by top to know the time spent by the cpu in
every state), and we are using the same fields in linprocfs for the
'stat' file in linux emulation (so a linux top version would read and
print out those values).

My point is: why are we doing this? If we remove that constraint, top
would show the values for -d1. I don't know if they would be really
accurate, but not printing anything doesn't seem a nice behavior
either (especially when this is not documented in the man page)

Thanks in advance.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGwOe2Zp2cHhCb%2Br_m5HZYJFyc=3DDsPEi7v_7ZVxJ0fkO1jEA>