Commit Graph

79 Commits

Author SHA1 Message Date
mrg 2026b7285b update my email address. 2024-02-04 05:43:05 +00:00
mrg 50f07ffd8e avoid crashes when proc_from_thread() returns NULL.
XXX: pullup-10, ...
2023-12-14 07:18:44 +00:00
simonb 3476380879 Remove extraneous comma after pool info 2023-10-22 14:44:09 +00:00
mrg 369cd1d703 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.
2023-10-21 06:30:23 +00:00
lukem c4b7a9e794 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.
2023-06-03 09:09:01 +00:00
mrg fc98c49922 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
2022-07-15 06:39:06 +00:00
christos 9777eb9aeb go back to right-aligning the titles for CPU and WCPU. 2021-04-16 13:02:47 +00:00
mrg 72ccf7c95b apply -fcommon to sources that still rely upon it. 2021-04-13 01:11:05 +00:00
christos 57f83fe0d8 - 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.
2021-04-03 19:25:38 +00:00
rin a8c74629f6 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!
2020-11-17 10:35:10 +00:00
mrg 9ded70a5ef expand a buffer size to properly handle full-size 64 bit values 2019-10-13 07:42:27 +00:00
mrg de11d87641 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."
2019-10-13 07:28:04 +00:00
christos a45df3f4cb simplify and explain 2019-04-27 14:10:01 +00:00
christos 260d5f320c for "countable" lwp names, try to display name*<count> instead of truncating. 2019-04-26 19:39:19 +00:00
maya 79176afac1 Fix typo s/fron/from/
From dfive on freenode, thanks!
2018-11-05 17:44:09 +00:00
kre d4305dc776 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.
2018-10-30 21:15:09 +00:00
sevan 1ff6a451ed Document the WCPU field. 2018-08-26 21:31:34 +00:00
snj 3120750dcb rats in my attic, mice in my top. i've had enough of these damn rodents. 2018-06-06 02:12:47 +00:00
eadler 94ea5fdc4c 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.
2018-06-03 05:29:27 +00:00
eadler 6aed99669b 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
2018-06-02 22:30:19 +00:00
kamil ea3d16d0e0 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>
2018-05-31 10:14:21 +00:00
kamil 3ff7937744 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>
2018-05-31 09:20:05 +00:00
sevan cc576e1d8e 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.
2017-02-01 09:26:39 +00:00
abhinav e74c9f1425 Fix couple of typos:
s/summay/summary
	s/highligting/highlighting
2017-01-12 18:37:09 +00:00
leot 98fbbaab51 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>
2016-12-28 18:16:30 +00:00
leot 2b0c6991fb Implement the `c' command in "interactive mode" that displays only commands
that match a specified string.

Reviewed by and thanks to <Riastradh>
2016-12-26 12:46:31 +00:00
dholland 0ca1e3e00e 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.
2016-08-27 18:48:30 +00:00
christos c89d254f72 PR/5068: Ingo Schwarze: Don't use the .af (alter format) request to display
a named register.
2016-01-23 22:10:44 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
christos 160897fee5 use more markup 2015-01-23 02:58:40 +00:00
christos 02160989ff Don't die if we resize to smaller than Y_LINES. The display could do better,
but it recovers if we grow.
2014-05-13 20:06:41 +00:00
christos 751bae8fd5 remove unused variables 2013-10-20 03:02:26 +00:00
roy af358e5553 Allow interactive displays if the termcap entry does not have the `li'
setting but we can calculate the lines from ioctl.
2013-10-01 11:39:37 +00:00
christos a4a10d58ae mandoc can now print numbered registers. 2013-03-21 21:43:22 +00:00
christos 40b61ad4dd 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!
2013-03-21 02:04:05 +00:00
christos b32a30787e revert previous, this is a mandoc issue (does not handle .if and .nr) 2013-03-21 01:39:04 +00:00
christos 2c041bfd20 PR/47675: Nick Hudson: top(1) man page missing default number of seconds 2013-03-21 00:27:44 +00:00
para 2277afb1ef explicitly include sys/resource.h 2013-01-03 10:12:36 +00:00
sborrill e02c5b57f9 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@
2012-03-23 14:46:05 +00:00
sborrill 076ec7d41f Mention that 1 can be used as an interactive command. 2012-03-23 13:32:51 +00:00
christos cc349219b4 PR/45739: Moritz Wilhelmy: top(1) segfaults on WINCH with unknown terminal 2011-12-24 22:29:48 +00:00
njoly e7df974e10 Adjust UID header position, to be aligned with the datas. 2011-10-08 08:45:37 +00:00
joerg ba0add90b0 Disable noreturn checks for remaining external code 2011-09-16 16:41:20 +00:00
christos 27b39b96e0 document that display.c uses non-literal format strings 2011-08-14 12:48:02 +00:00
christos 1d62298ca7 Swap the command and the thread name in the thread view and let the command
be as long as it wants. (Vladimir Kirillov)
2011-04-15 02:05:53 +00:00
christos 8d7359cabb PR/43562: Witold Jan Wnuk: top: CPU percentages overlap labels 2010-07-03 13:18:57 +00:00
is adbe495929 Avoid steps and other artefacts in head for more than 9 CPUs. 2010-06-30 11:08:12 +00:00
rmind c0c9bed8ab Fix previous, so it builds on some ports. 2010-05-31 18:14:59 +00:00
rmind 8b95f823bf 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.
2010-05-31 03:18:33 +00:00
christos 58f9040724 implement fullcmd mode. Now we need to modernize the machine specific code
to handle displays > 80 columns to make this work effectively.
2010-05-12 22:09:36 +00:00