Home | History | Annotate | only in /src/external/bsd/top
History log of /src/external/bsd/top
RevisionDateAuthorComments
 1.2 17-Jul-2008  lukem branches: 1.2.2; 1.2.6;
Move usr.bin/top/Makefile -> bin/Makefile, and tweak accordingly:
- bin (instead of usr.bin) follows ../README
- no point having a sub-subdir for a single reachover (bin vs bin/top),
although we could debate the pros & cons of that endlessly.
 1.1 16-Jul-2008  christos add build glue and local fixes
 1.2.6.2 19-Oct-2008  haad Sync with HEAD.
 1.2.6.1 17-Jul-2008  haad file Makefile was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.2.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.2.1 17-Jul-2008  wrstuden file Makefile was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.14 18-Sep-2025  mrg introduce a couple of new turn-off-gcc-warning variables and use them.

GCC 14 has a new annoying calloc() checker that we turn off in a bunch
of places, and there are a few more dangling-pointer issuse that come up,
but seem bogus.
 1.13 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.12 13-Apr-2021  mrg apply -fcommon to sources that still rely upon it.
 1.11 13-Oct-2019  mrg introduce some common variables for use in GCC warning disables:

GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints. many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
 1.10 23-Jan-2016  christos branches: 1.10.16;
Define _KERNTYPES for things that need it.
 1.9 21-Mar-2013  christos mandoc can now print numbered registers.
 1.8 21-Mar-2013  christos The man page has numbered registers and conditionals and cannot be handled
by mandoc, so make it use groff. Unfortunately since we don't install cat
pages, this does not work. At least it works for html!
 1.7 16-Sep-2011  joerg Disable noreturn checks for remaining external code
 1.6 14-Aug-2011  christos document that display.c uses non-literal format strings
 1.5 03-Feb-2010  roy Userland now builds and uses terminfo instead of termcap.

OK: core@, jdc@
 1.4 05-May-2009  christos WARNS=4
 1.3 13-Dec-2008  chris branches: 1.3.2;
Add -lutil to allow linking to find the e-functions.
 1.2 19-Oct-2008  apb branches: 1.2.2;
Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.1 17-Jul-2008  lukem branches: 1.1.2;
Move usr.bin/top/Makefile -> bin/Makefile, and tweak accordingly:
- bin (instead of usr.bin) follows ../README
- no point having a sub-subdir for a single reachover (bin vs bin/top),
although we could debate the pros & cons of that endlessly.
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 17-Jul-2008  wrstuden file Makefile was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.2.2.2 19-Oct-2008  haad Sync with HEAD.
 1.2.2.1 19-Oct-2008  haad file Makefile was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.3.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.10.16.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.1 17-Jul-2008  lukem branches: 1.1.2; 1.1.6;
Move usr.bin/top/Makefile -> bin/Makefile, and tweak accordingly:
- bin (instead of usr.bin) follows ../README
- no point having a sub-subdir for a single reachover (bin vs bin/top),
although we could debate the pros & cons of that endlessly.
 1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.6.1 17-Jul-2008  haad file config.h.in was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.2.1 17-Jul-2008  wrstuden file config.h.in was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file Changes was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file Changes was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file FAQ was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file FAQ was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file INSTALL was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file INSTALL was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file LICENSE was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file LICENSE was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file Makefile.in was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file Makefile.in was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file Porting was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file Porting was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file README was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file README was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file Y2K was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file Y2K was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file ap_snprintf.c was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file ap_snprintf.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file boolean.h was added on branch haad-dm on 2008-10-19 22:40:52 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file boolean.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.3 05-May-2009  christos WARNS=4
 1.2 12-Dec-2008  christos branches: 1.2.2;
- handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file color.c was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file color.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.2.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2 05-May-2009  christos WARNS=4
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.10;
import latest top
 1.1.1.1.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file color.h was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file color.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.8 06-Jun-2018  snj rats in my attic, mice in my top. i've had enough of these damn rodents.
 1.7 23-Mar-2012  sborrill branches: 1.7.30;
Switch off per-cpu states by default (i.e. display a single CPU line with a
mean average). Program behaviour now tallies with the man page, but more
importantly, the default behaviour is now sensible for modern multi-core
machines.

If you want the previous behaviour, please set TOP="-1" in your environment.

Fix multiple "1" options not toggling and thus allow settings in TOP
environmental variable to be reversed by a command line option.

Tweak description of "1" command in interactive mode.

OK christos@
 1.6 05-May-2009  christos branches: 1.6.6;
WARNS=4
 1.5 12-Dec-2008  christos branches: 1.5.2;
- handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.4 20-Jul-2008  christos branches: 1.4.2; 1.4.6;
put back -p, add sort order for pid, username, command. XXX: should add reverse
sorting order too.
 1.3 16-Jul-2008  christos allow fractional second values like lunix does.
 1.2 16-Jul-2008  christos add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.4.6.2 19-Oct-2008  haad Sync with HEAD.
 1.4.6.1 20-Jul-2008  haad file commands.c was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.4.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.4.2.1 20-Jul-2008  wrstuden file commands.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.5.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.6.6.1 17-Apr-2012  yamt sync with head
 1.7.30.1 25-Jun-2018  pgoyette Sync with HEAD
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file commands.h was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file commands.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.amd64.make was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.amd64.make was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.amd64.makeinstall was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.amd64.makeinstall was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.default.makeinstall was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.default.makeinstall was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.3 17-Nov-2020  rin Support aarch64eb in */config.guess.

Cherry-picked from upstream:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=commit;h=1c4398015583eb77bc043234f5734be055e64bea

Everything except external/apache2/llvm/dist/llvm/cmake/config.guess
is patched, which is under vendor tag and cannot be modified. I expect
that this file is not actually used as we use hand-crafted version of
configure script instead of cmake for building LLVM.

Note that external/apache2/llvm/autoconf/autoconf/config.guess has
already been committed on Oct. 20, but commit message disappeared as
cvs aborted due to "permission denied" when trying to modify the file
mentioned above. Sorry for confusing you.

Also note that GMP uses its own config.guess Patch for
external/lgpl3/gmp/dist/config.guess is provided by ryo@. Thanks!
 1.2 01-Feb-2017  sevan Update supporting files for components which rely on autoconf to allow systems
introducing since release of software to be recognised. This should hopefully
allow the builds to progress a littles further on systems such as the POWER8
which features a little endian 64-bit PowerPC CPU identified as ppc64le.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.46; 1.1.1.1.50;
import latest top
 1.1.1.1.50.1 21-Apr-2017  bouyer Sync with HEAD
 1.1.1.1.46.1 20-Mar-2017  pgoyette Sync with HEAD
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.guess was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.guess was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.h.in was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.h.in was added on branch wrstuden-revivesa on 2008-09-18 05:15:50 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.sparcv9.make was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.sparcv9.make was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.sparcv9.makeinstall was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.sparcv9.makeinstall was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.2 01-Feb-2017  sevan Update supporting files for components which rely on autoconf to allow systems
introducing since release of software to be recognised. This should hopefully
allow the builds to progress a littles further on systems such as the POWER8
which features a little endian 64-bit PowerPC CPU identified as ppc64le.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.46; 1.1.1.1.50;
import latest top
 1.1.1.1.50.1 21-Apr-2017  bouyer Sync with HEAD
 1.1.1.1.46.1 20-Mar-2017  pgoyette Sync with HEAD
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file config.sub was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file config.sub was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file configure was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file configure was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file configure.ac was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file configure.ac was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.10 13-May-2014  christos Don't die if we resize to smaller than Y_LINES. The display could do better,
but it recovers if we grow.
 1.9 03-Jul-2010  christos branches: 1.9.12; 1.9.22;
PR/43562: Witold Jan Wnuk: top: CPU percentages overlap labels
 1.8 30-Jun-2010  is Avoid steps and other artefacts in head for more than 9 CPUs.
 1.7 05-May-2009  christos PR/41358: YAMAMOTO Takashi: top -n is broken, don't return -1 early if
!smartterminal
 1.6 05-May-2009  christos WARNS=4
 1.5 27-Feb-2009  oster On a multi-cpu/core machine, running 'top' and pressing '1' resulted
in n-1 blank lines at the bottom of the display. On the same machine,
running 'top -1' and pressing '1' resulted in a garbled display that
would just get progressively worse. Invert the values returned by
display_setmulti() to correct both issues.
 1.4 12-Dec-2008  christos branches: 1.4.2;
- handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.3 24-Jul-2008  christos branches: 1.3.2; 1.3.6; 1.3.8;
PR/39200: Geoff Wing: Fix memory stomping on multi-cpu machines.
 1.2 16-Jul-2008  christos add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.3.8.3 07-Jan-2011  riz Pull up following revision(s) (requested by is in ticket #1507):
external/bsd/top/dist/display.c: revision 1.9
PR/43562: Witold Jan Wnuk: top: CPU percentages overlap labels
 1.3.8.2 21-Nov-2010  riz Pull up following revision(s) (requested by is in ticket #1422):
external/bsd/top/dist/display.c: revision 1.8
Avoid steps and other artefacts in head for more than 9 CPUs.
 1.3.8.1 02-Mar-2009  snj Pull up following revision(s) (requested by oster in ticket #531):
external/bsd/top/dist/display.c: revision 1.5
On a multi-cpu/core machine, running 'top' and pressing '1' resulted
in n-1 blank lines at the bottom of the display. On the same machine,
running 'top -1' and pressing '1' resulted in a garbled display that
would just get progressively worse. Invert the values returned by
display_setmulti() to correct both issues.
 1.3.6.2 19-Oct-2008  haad Sync with HEAD.
 1.3.6.1 24-Jul-2008  haad file display.c was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.3.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.2.1 24-Jul-2008  wrstuden file display.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.4.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.9.22.1 10-Aug-2014  tls Rebase.
 1.9.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3 05-May-2009  christos WARNS=4
 1.2 16-Jul-2008  christos branches: 1.2.2; 1.2.6; 1.2.10;
add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.2.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.6.2 19-Oct-2008  haad Sync with HEAD.
 1.2.6.1 16-Jul-2008  haad file display.h was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.2.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.2.1 16-Jul-2008  wrstuden file display.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file getopt.c was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file getopt.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.3 16-Jul-2008  christos branches: 1.3.2; 1.3.6;
allow fractional second values like lunix does.
 1.2 16-Jul-2008  christos add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.3.6.2 19-Oct-2008  haad Sync with HEAD.
 1.3.6.1 16-Jul-2008  haad file globalstate.h was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.3.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.2.1 16-Jul-2008  wrstuden file globalstate.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.4 20-Oct-2013  christos remove unused variables
 1.3 05-May-2009  christos branches: 1.3.6; 1.3.12;
WARNS=4
 1.2 12-Dec-2008  christos branches: 1.2.2;
- handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file hash.c was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file hash.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.2.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.3.12.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.6.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file hash.h was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file hash.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file hash.m4c was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file hash.m4c was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file hash.m4h was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file hash.m4h was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file install-sh was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file install-sh was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file layout.h was added on branch haad-dm on 2008-10-19 22:40:53 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file layout.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:51 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file loadavg.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file loadavg.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.4 05-May-2009  christos WARNS=4
 1.3 20-Jul-2008  christos branches: 1.3.2; 1.3.6; 1.3.10;
put back -p, add sort order for pid, username, command. XXX: should add reverse
sorting order too.
 1.2 16-Jul-2008  christos add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.3.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.3.6.2 19-Oct-2008  haad Sync with HEAD.
 1.3.6.1 20-Jul-2008  haad file machine.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.3.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.2.1 20-Jul-2008  wrstuden file machine.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.2 05-May-2009  christos WARNS=4
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.10;
import latest top
 1.1.1.1.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file message.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file message.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.2 12-Dec-2008  christos - handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file os.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file os.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.5 01-Oct-2013  roy Allow interactive displays if the termcap entry does not have the `li'
setting but we can calculate the lines from ioctl.
 1.4 24-Dec-2011  christos branches: 1.4.6;
PR/45739: Moritz Wilhelmy: top(1) segfaults on WINCH with unknown terminal
 1.3 05-May-2009  christos branches: 1.3.6;
WARNS=4
 1.2 29-Aug-2008  gmcgarry branches: 1.2.2; 1.2.6; 1.2.10;
Both legs of conditional operator must return the same type.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.2.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.6.2 19-Oct-2008  haad Sync with HEAD.
 1.2.6.1 29-Aug-2008  haad file screen.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.2.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.2.1 29-Aug-2008  wrstuden file screen.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.3.6.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.3.6.1 17-Apr-2012  yamt sync with head
 1.4.6.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2 05-May-2009  christos WARNS=4
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.10;
import latest top
 1.1.1.1.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file screen.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file screen.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.2 05-May-2009  christos WARNS=4
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.10;
import latest top
 1.1.1.1.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file sigconv.awk was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file sigconv.awk was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.12 05-Nov-2018  maya Fix typo s/fron/from/

From dfive on freenode, thanks!
 1.11 26-Aug-2018  sevan Document the WCPU field.
 1.10 12-Jan-2017  abhinav branches: 1.10.6; 1.10.12; 1.10.14;
Fix couple of typos:
s/summay/summary
s/highligting/highlighting
 1.9 28-Dec-2016  leot Document the `p' command in "interactive mode" that filters processes by pid.
While here add date to the `.TH' macro 3rd argument.

Reviewed by and thanks to <wiz>
 1.8 23-Jan-2016  christos branches: 1.8.2;
PR/5068: Ingo Schwarze: Don't use the .af (alter format) request to display
a named register.
 1.7 23-Jan-2015  christos use more markup
 1.6 21-Mar-2013  christos revert previous, this is a mandoc issue (does not handle .if and .nr)
 1.5 21-Mar-2013  christos PR/47675: Nick Hudson: top(1) man page missing default number of seconds
 1.4 23-Mar-2012  sborrill Mention that 1 can be used as an interactive command.
 1.3 20-Jul-2008  christos branches: 1.3.2; 1.3.4; 1.3.6;
put back -p, add sort order for pid, username, command. XXX: should add reverse
sorting order too.
 1.2 16-Jul-2008  christos add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.3.6.2 19-Oct-2008  haad Sync with HEAD.
 1.3.6.1 20-Jul-2008  haad file top.1.in was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.3.4.1 17-Apr-2012  yamt sync with head
 1.3.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.2.1 20-Jul-2008  wrstuden file top.1.in was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.8.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.8.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.10.14.1 10-Jun-2019  christos Sync with HEAD
 1.10.12.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.10.12.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.10.6.1 28-Aug-2018  martin Pull up following revision(s) (requested by sevan in ticket #992):

external/bsd/top/dist/top.1.in: revision 1.11
sbin/gpt/main.c: revision 1.12
sbin/amrctl/amrctl.c: revision 1.11
bin/df/df.c: revision 1.93
sbin/fsck_ext2fs/fsck_ext2fs.8: revision 1.21
sbin/fsck_ext2fs/main.c: revision 1.38
bin/ksh/ksh.Man: revision 1.26
bin/ln/ln.c: revision 1.40
bin/df/df.1: revision 1.48
bin/df/df.1: revision 1.49

Document the WCPU field.

Match SYNOPSIS with usage()

-G cannot be specified alongside -i or -P.
Heads up by <leot>

Add -l to SYNOPSIS

Update usage to include -w

Match sequence as per SYNOPSIS in manual

Remove reference to -c flag which was never implemented.

Remove references to -c flag which was never included.

Add the -T flag to usage()
 1.12 03-Jun-2018  eadler top(1): revert 1.11

This change breaks the expectations of users that would like a coredump
of top(1). Other similar applications such as vmstat(1) don't do this.
Since the change was just a courtesy, revert.
 1.11 02-Jun-2018  eadler top(1): chdir to / at init

This allows us to unmount whatever directory we happen to be in when we
started top(1).

ok phone
 1.10 31-May-2018  kamil Fix unitialized signal mask passed to sigaction(2) in top(1)

Detected with Memory Sanitizer during the integration of sanitizers with
the NetBSD basesystem.

Reported by <Yang Zheng>
 1.9 23-Mar-2012  sborrill branches: 1.9.24; 1.9.30;
Switch off per-cpu states by default (i.e. display a single CPU line with a
mean average). Program behaviour now tallies with the man page, but more
importantly, the default behaviour is now sensible for modern multi-core
machines.

If you want the previous behaviour, please set TOP="-1" in your environment.

Fix multiple "1" options not toggling and thus allow settings in TOP
environmental variable to be reversed by a command line option.

Tweak description of "1" command in interactive mode.

OK christos@
 1.8 05-May-2009  christos branches: 1.8.6;
WARNS=4
 1.7 13-Dec-2008  tsutsui branches: 1.7.2;
Sync usage with man page.
 1.6 12-Dec-2008  christos - handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.5 20-Jul-2008  christos branches: 1.5.2; 1.5.6;
put back -p, add sort order for pid, username, command. XXX: should add reverse
sorting order too.
 1.4 20-Jul-2008  christos add -1 to usage
 1.3 16-Jul-2008  christos allow fractional second values like lunix does.
 1.2 16-Jul-2008  christos add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.5.6.2 19-Oct-2008  haad Sync with HEAD.
 1.5.6.1 20-Jul-2008  haad file top.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.5.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.2.1 20-Jul-2008  wrstuden file top.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.7.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.8.6.1 17-Apr-2012  yamt sync with head
 1.9.30.1 25-Jun-2018  pgoyette Sync with HEAD
 1.9.24.1 09-Jun-2018  martin Pull up following revision(s) (requested by kamil in ticket #871):

external/bsd/top/dist/top.c: revision 1.10

Fix unitialized signal mask passed to sigaction(2) in top(1)

Detected with Memory Sanitizer during the integration of sanitizers with
the NetBSD basesystem.

Reported by <Yang Zheng>
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file top.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file top.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.3 05-May-2009  christos WARNS=4
 1.2 12-Dec-2008  christos branches: 1.2.2;
- handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file username.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file username.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.2.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2 05-May-2009  christos WARNS=4
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.10;
import latest top
 1.1.1.1.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file username.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file username.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.6 13-Oct-2019  mrg expand a buffer size to properly handle full-size 64 bit values
 1.5 27-Aug-2016  dholland branches: 1.5.14;
Be more careful/explicit with FP rounding when converting floating time
to timeval. Also, don't truncate the seconds part to int for y2038.

I've had this patch sitting around since 2010 and I completely forget
what motivated it.
 1.4 05-May-2009  christos WARNS=4
 1.3 12-Dec-2008  christos branches: 1.3.2;
- handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.2 16-Jul-2008  christos branches: 1.2.2; 1.2.6;
allow fractional second values like lunix does.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.2.6.2 19-Oct-2008  haad Sync with HEAD.
 1.2.6.1 16-Jul-2008  haad file utils.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.2.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.2.1 16-Jul-2008  wrstuden file utils.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.3.2.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.5.14.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.3 05-May-2009  christos WARNS=4
 1.2 16-Jul-2008  christos branches: 1.2.2; 1.2.6; 1.2.10;
allow fractional second values like lunix does.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.2.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.6.2 19-Oct-2008  haad Sync with HEAD.
 1.2.6.1 16-Jul-2008  haad file utils.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.2.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.2.2.1 16-Jul-2008  wrstuden file utils.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.2 05-May-2009  christos WARNS=4
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.10;
import latest top
 1.1.1.1.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file version.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file version.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.2 05-May-2009  christos WARNS=4
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6; 1.1.1.1.10;
import latest top
 1.1.1.1.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file version.h was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file version.h was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.3 12-Dec-2008  christos back emalloc out, I don't want it.
 1.2 12-Dec-2008  christos - handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_aix43.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_aix43.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_aix5.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_aix5.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_decosf1.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_decosf1.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_decosf1.man was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_decosf1.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_freebsd.c was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_freebsd.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_freebsd.man was added on branch haad-dm on 2008-10-19 22:40:54 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_freebsd.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_hpux10.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_hpux10.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_hpux10.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_hpux10.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_hpux7.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_hpux7.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_hpux8.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_hpux8.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:52 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_hpux9.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_hpux9.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_hpux9.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_hpux9.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_irix5.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_irix5.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_irixsgi.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_irixsgi.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_linux.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_linux.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_linux.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_linux.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_linuxthr.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_linuxthr.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_linuxthr.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_linuxthr.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_macosx.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_macosx.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_macosx.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_macosx.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.30 04-Feb-2024  mrg update my email address.
 1.29 14-Dec-2023  mrg avoid crashes when proc_from_thread() returns NULL.

XXX: pullup-10, ...
 1.28 22-Oct-2023  simonb Remove extraneous comma after pool info
 1.27 21-Oct-2023  mrg top: add network in & out bytes to the top display.

inspired by the macos top(1).

the first value displayed is the total in/out bytes since boot,
but each update is the amount since the prior update. the new
fetching code heavily based upon netstat/if.c.

old version:

Swap: 128G Total, 128G Free / Pools: 13G Used

new version:

Swap: 128G Total, 128G Free / Pools: 13G Used, / Network: 26M In, 804K Out

update the list of people who have contributed to m_netbsd.c.
 1.26 15-Jul-2022  mrg branches: 1.26.2;
add pool usage to the output, sharing the line with swap data.

looks like, eg:

Swap: 64G Total, 135M Used, 64G Free / Pools: 16G Used


future work: figure out the utilisation percentage like vmstat -m
 1.25 16-Apr-2021  christos go back to right-aligning the titles for CPU and WCPU.
 1.24 03-Apr-2021  christos - Bump field width for state to accommodate > 9 CPUs
- When star formatting to adjust the width, count the trailing number of
digits starting backwards instead of using strcspn because the lwp name
might contain other digits like wm0TxRx/10.
 1.23 27-Apr-2019  christos simplify and explain
 1.22 26-Apr-2019  christos for "countable" lwp names, try to display name*<count> instead of truncating.
 1.21 30-Oct-2018  kre sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match.... We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.
 1.20 31-May-2018  kamil branches: 1.20.2;
Fix read of unitialized array elements in top(1)

The cp_old array is allocated with malloc(3) and its pointer is passed to
percentages64().

In this function there happens a calculation of total_change, which value
depends on the value inside the unitialized cp_old[] array.

==26662==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x268a2c in percentages64 /usr/src/external/bsd/top/bin/../dist/machine/m_netbsd.c:1341:6
#1 0x26748b in get_system_info /usr/src/external/bsd/top/bin/../dist/machine/m_netbsd.c:478:6
#2 0x25518e in do_display /usr/src/external/bsd/top/bin/../dist/top.c:507:5
#3 0x253038 in main /usr/src/external/bsd/top/bin/../dist/top.c:975:2
#4 0x21cad1 in ___start (/usr/bin/top+0x1cad1)
SUMMARY: MemorySanitizer: use-of-uninitialized-value /usr/src/external/bsd/top/bin/../dist/machine/m_netbsd.c:1341:6 in percentages64
Exiting

Fix this issue by changling malloc(3) with calloc(3).

Detected with Memory Sanitizer during the integration of sanitizers with
the NetBSD basesystem.

Reported by <Yang Zheng>
 1.19 26-Dec-2016  leot branches: 1.19.6; 1.19.12;
Implement the `c' command in "interactive mode" that displays only commands
that match a specified string.

Reviewed by and thanks to <Riastradh>
 1.18 20-Oct-2013  christos branches: 1.18.8;
remove unused variables
 1.17 03-Jan-2013  para explicitly include sys/resource.h
 1.16 08-Oct-2011  njoly branches: 1.16.2; 1.16.8;
Adjust UID header position, to be aligned with the datas.
 1.15 15-Apr-2011  christos Swap the command and the thread name in the thread view and let the command
be as long as it wants. (Vladimir Kirillov)
 1.14 31-May-2010  rmind Fix previous, so it builds on some ports.
 1.13 31-May-2010  rmind Fix ps(1) and top(1) to show reasonable CPU numbers i.e. cpu_index() provided
by the kernel, instead of CPU order number, which is generally random.
 1.12 12-May-2010  christos implement fullcmd mode. Now we need to modernize the machine specific code
to handle displays > 80 columns to make this work effectively.
 1.11 21-Oct-2009  rmind Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.10 27-Jul-2009  njoly Make process CPU value drop the decimal part when reaching 100%, like
WCPU.
 1.9 05-May-2009  christos WARNS=4
 1.8 24-Apr-2009  njoly Drop the process WCPU decimal part when it reaches 100.0% (threaded
application on SMP system), to make it stay in the 5 expected columns.

ok by christos.
 1.7 29-Mar-2009  mrg - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.6 08-Mar-2009  ad Adjust weight of SIDL down so idle kthreads don't eat up all of the
thread display
 1.5 02-Aug-2008  cube branches: 1.5.2; 1.5.6; 1.5.8; 1.5.10;
Make sure format_next_{proc,lwp} return a pointer to a buffer at least
MAX_COLS long otherwise a '\0' might be printed in a random place of
memory.
 1.4 21-Jul-2008  christos - fix p for threads
- more sane ordering for thread command, username, and pid
 1.3 20-Jul-2008  christos put back -p, add sort order for pid, username, command. XXX: should add reverse
sorting order too.
 1.2 16-Jul-2008  christos add build glue and local fixes
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos import latest top
 1.5.10.1 13-May-2009  jym Sync with HEAD.

Second commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.5.8.1 01-Apr-2009  snj Pull up following revision(s) (requested by mrg in ticket #622):
bin/csh/csh.1: revision 1.46
bin/csh/func.c: revision 1.37
bin/ps/print.c: revision 1.111
bin/ps/ps.c: revision 1.74
bin/sh/miscbltin.c: revision 1.38
bin/sh/sh.1: revision 1.92 via patch
external/bsd/top/dist/machine/m_netbsd.c: revision 1.7
lib/libkvm/kvm_proc.c: revision 1.82
sys/arch/mips/mips/cpu_exec.c: revision 1.55
sys/compat/darwin/darwin_exec.c: revision 1.57
sys/compat/ibcs2/ibcs2_exec.c: revision 1.73
sys/compat/irix/irix_resource.c: revision 1.15
sys/compat/linux/arch/amd64/linux_exec_machdep.c: revision 1.16
sys/compat/linux/arch/i386/linux_exec_machdep.c: revision 1.12
sys/compat/linux/common/linux_limit.h: revision 1.5
sys/compat/osf1/osf1_resource.c: revision 1.14
sys/compat/svr4/svr4_resource.c: revision 1.18
sys/compat/svr4_32/svr4_32_resource.c: revision 1.17
sys/kern/exec_subr.c: revision 1.62
sys/kern/init_sysctl.c: revision 1.160
sys/kern/kern_exec.c: revision 1.288
sys/kern/kern_resource.c: revision 1.151
sys/sys/param.h: patch
sys/sys/resource.h: revision 1.31
sys/sys/sysctl.h: revision 1.184
sys/uvm/uvm_extern.h: revision 1.153
sys/uvm/uvm_glue.c: revision 1.136
sys/uvm/uvm_mmap.c: revision 1.128
usr.bin/systat/ps.c: revision 1.32
- - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes. this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.
- - adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.
- - add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)
- - patch sh, and csh to notice RLIMIT_AS. (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)
- - patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.
- - update irix, svr4, svr4_32, linux and osf1 emulations to support
this information. (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)
this addresses PR 7897. it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.
tested on i386 and sparc64, build tested on several other platforms.
thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
 1.5.6.2 19-Oct-2008  haad Sync with HEAD.
 1.5.6.1 02-Aug-2008  haad file m_netbsd.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.5.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.2.1 02-Aug-2008  wrstuden file m_netbsd.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.16.8.2 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.16.8.1 25-Feb-2013  tls resync with head
 1.16.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.2.1 23-Jan-2013  yamt sync with head
 1.18.8.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.19.12.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.19.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.19.6.1 09-Jun-2018  martin Pull up following revision(s) (requested by kamil in ticket #872):

external/bsd/top/dist/machine/m_netbsd.c: revision 1.20

Fix read of unitialized array elements in top(1)

The cp_old array is allocated with malloc(3) and its pointer is passed to=
percentages64().

In this function there happens a calculation of total_change, which value=
depends on the value inside the unitialized cp_old[] array.

WARNING: MemorySanitizer: use-of-uninitialized-value
/usr/src/external/bsd/top/bin/../dist/machine/m_netbsd.c:1341:6
/usr/src/external/bsd/top/bin/../dist/machine/m_netbsd.c:478:65
SUMMARY: MemorySanitizer: use-of-uninitialized-value
/usr/src/external/bsd/top/bin/../dist/machine/m_netbsd.c:1341:6 in percentages64
Exiting

Fix this issue by changling malloc(3) with calloc(3).

Detected with Memory Sanitizer during the integration of sanitizers with
the NetBSD basesystem.

Reported by <Yang Zheng>
 1.20.2.1 10-Jun-2019  christos Sync with HEAD
 1.26.2.2 18-Dec-2023  martin Pull up following revision(s) (requested by mrg in ticket #503):

external/bsd/top/dist/machine/m_netbsd.c: revision 1.27
external/bsd/top/dist/machine/m_netbsd.c: revision 1.28

top: add network in & out bytes to the top display.

inspired by the macos top(1).

the first value displayed is the total in/out bytes since boot,
but each update is the amount since the prior update. the new
fetching code heavily based upon netstat/if.c.

old version:
Swap: 128G Total, 128G Free / Pools: 13G Used

new version:
Swap: 128G Total, 128G Free / Pools: 13G Used, / Network: 26M In, 804K Out

update the list of people who have contributed to m_netbsd.c.
Remove extraneous comma after pool info
 1.26.2.1 18-Dec-2023  martin Pull up following revision(s) (requested by mrg in ticket #502):

external/bsd/top/dist/machine/m_netbsd.c: revision 1.29

avoid crashes when proc_from_thread() returns NULL.
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_netbsd.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_netbsd.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_sco5.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_sco5.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_sco5.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_sco5.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_sunos4.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_sunos4.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_sunos4.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_sunos4.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_sunos5.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_sunos5.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_sunos5.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_sunos5.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_svr4.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_svr4.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_svr4.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_svr4.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_svr5.c was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_svr5.c was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000
 1.1 16-Jul-2008  christos branches: 1.1.1;
Initial revision
 1.1.1.1 16-Jul-2008  christos branches: 1.1.1.1.2; 1.1.1.1.6;
import latest top
 1.1.1.1.6.2 19-Oct-2008  haad Sync with HEAD.
 1.1.1.1.6.1 16-Jul-2008  haad file m_svr5.man was added on branch haad-dm on 2008-10-19 22:40:55 +0000
 1.1.1.1.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.1.1.1.2.1 16-Jul-2008  wrstuden file m_svr5.man was added on branch wrstuden-revivesa on 2008-09-18 05:15:53 +0000

RSS XML Feed