Commit Graph

49 Commits

Author SHA1 Message Date
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
roy
98eb889579 Userland now builds and uses terminfo instead of termcap.
OK: core@, jdc@
2010-02-03 15:34:37 +00:00
rmind
40cf6f3659 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>.
2009-10-21 21:11:57 +00:00
njoly
f4e46459c3 Make process CPU value drop the decimal part when reaching 100%, like
WCPU.
2009-07-27 16:26:48 +00:00
christos
97773de03d PR/41358: YAMAMOTO Takashi: top -n is broken, don't return -1 early if
!smartterminal
2009-05-05 18:52:13 +00:00
christos
213e7ef10b WARNS=4 2009-05-05 18:49:49 +00:00
njoly
aaad3eb0f6 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.
2009-04-24 19:07:45 +00:00
mrg
fcc023545e - 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 :-)
2009-03-29 01:02:48 +00:00
ad
5e99d26fbe Adjust weight of SIDL down so idle kthreads don't eat up all of the
thread display
2009-03-08 16:26:03 +00:00
oster
ab54f8ad2b 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.
2009-02-27 17:38:14 +00:00
chris
aa5f67e8e7 Add -lutil to allow linking to find the e-functions. 2008-12-13 12:21:50 +00:00
tsutsui
791606eb62 Sync usage with man page. 2008-12-13 09:05:56 +00:00
christos
809d48d0cb back emalloc out, I don't want it. 2008-12-12 23:10:08 +00:00
christos
56a682bfb8 - handle memory allocations gracefully using e-functions instread of
core-dumping.
- if the display is too small bail out.
2008-12-12 23:09:08 +00:00
apb
96230fab84 Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
2008-10-19 22:05:19 +00:00
gmcgarry
5a8a518ea5 Both legs of conditional operator must return the same type. 2008-08-29 00:36:27 +00:00
cube
c32922f166 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.
2008-08-02 23:20:16 +00:00
christos
3e1a92fedd PR/39200: Geoff Wing: Fix memory stomping on multi-cpu machines. 2008-07-24 15:10:34 +00:00
christos
1fb97e154d - fix p for threads
- more sane ordering for thread command, username, and pid
2008-07-21 19:29:36 +00:00
christos
14f5b40f23 put back -p, add sort order for pid, username, command. XXX: should add reverse
sorting order too.
2008-07-20 18:52:06 +00:00
christos
d6a52d8265 add -1 to usage 2008-07-20 00:11:04 +00:00
lukem
6ea5514d2c 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.
2008-07-17 10:46:56 +00:00
christos
d50e0bba82 remove unnecessary defines 2008-07-16 14:29:11 +00:00
christos
a8f5847fc4 allow fractional second values like lunix does. 2008-07-16 14:27:26 +00:00
christos
72572e11a6 change the order that we build config.h 2008-07-16 11:30:36 +00:00
christos
5734987052 subst machine 2008-07-16 01:54:17 +00:00
christos
689a2f13d6 need to generate config.h dynamically 2008-07-16 01:51:56 +00:00
christos
f8e8331d64 more Makefile glue 2008-07-16 00:41:50 +00:00
christos
2b60e3f28a add build glue and local fixes 2008-07-16 00:36:14 +00:00
christos
10dd2532a5 import latest top 2008-07-16 00:20:32 +00:00