Commit Graph

144 Commits

Author SHA1 Message Date
Jan Görig
034612c480 Fixed per-process swap information in top and related cleanup.
Thanks to KOSAKI Motohiro and Jim.

Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=532668
2011-06-02 12:15:14 +02:00
Jim Warner
c2dcbef482 added output width/height override support to top, + misc
This source patch addresses the following:
 Enhancements
  . added -w command line switch, with optional argument
   ( offers complete control over width and height, in  )
   ( combination with env variables COLUMNS= and LINES= )
  . updated man document to reflect the new capability
  . reengineered Fields Management to be more flexible
    thus no longer requiring a normal sized tty
 Buglets fixed
  . forced View_SCROLL off when in 'Batch' mode
  . for narrow xterm, fixed return val in show_pmt
  . for narrow xterm, fixed cursor pos in linein
  . added a window specific end-of-line termcap ptr
   ( so clr_eol does not overwrite last printable char )
 Cosmetic changes
  . eliminated TTYGETENVYES define, incorporated as -w
  . eliminated RESIZE_LIMIT define, no longer needed
  . eliminated FIELD_CURSOR define, no longer possible
  . eliminated extra text on Fields Management screen
  . fixed miscellaneous man document typos/formatting

Signed-off-by: Jan Görig <jgorig@redhat.com>
2011-05-26 11:33:32 +02:00
Jim Warner
7b0fc19e9d enhanced libproc cgroup/cmdline support, exploited by top
Library Changes
. added PROC_EDITCMDLCVT flag
. added an internal (static) fill_cmdline_cvt function:
  - reads and "escapes" /proc/#/cmdline
  - returns result as a single string in a single vector
  - callers are guaranteed a cmdline (no more NULL)
. added vectorize_this_str function, exploited by
  fill_cgroup_cvt, fill_cmdline_cvt
. generalized read_cmdline function as read_unvectored, now
  exploited by fill_cgroup_cvt, fill_cmdline_cvt, read_cmdline
  ( cgroup and cmdline no longer need be converted to string )
  ( vectors before being transformed to final representation )
. fixed bug regarding skipped group numbers (when enabled)
. escape_str made responsible for all single byte translation
  with distinction between control chars + other unprintable
. added escaped_copy function for already escaped strings
. reorganized parts of proc_t to restore formatting standards
  ( displacement changes shouldn't matter with new version # )
. former ZAP_SUSEONLY #define now OOMEM_ENABLE
. added to library.map: escaped_copy; read_cmdline

Top Program Changes
. exploited the new PROC_EDITCMDLCVT provision
. eliminated now obsolete #include "proc/escape.h"
. changed the P_WCH display format if no kernel symbol table
. fixed very old bug in lflgs for out-of-view sort fields
. former ZAP_SUSEONLY #define now OOMEM_ENABLE

Ps Program Changes
. exploited the new PROC_EDITCMDLCVT provision
. exploited the new escaped_copy function
. consolidated pr_args and pr_comm into pr_argcom

Signed-off-by: Jan Görig <jgorig@redhat.com>
2011-05-18 10:33:44 +02:00
Jim Warner
57031319d6 cgroup support migrated to libproc, plus miscellaneous re-formatting
This source patchset addresses the following:
Library Extension (readproc)
 . added PROC_EDITCGRPCVT flag
 . added an internal (static) fill_cgroup_cvt function:
   . reads AND parses /proc/#/cgroup
   . returns result as a single string in a single vector
   . thus no changes to proc_t structure or free memory logic
Program Enhancements (top)
 . removed parse_cgroup logic in favor of libproc
 . eliminated cgroup sort recurring overhead
 . converted WCHAN field to variable width
 . generalized variable width field logic in task_show
 . real-time notation under P col more distinctive as 'rt'
Program Cosmetic (top)
 . CGROUP now known as CGROUPS (plural)
 . moved jan's attribution from top.c to 'Notes' in top.h
 . numerous comments tweaked
Document Enhancements (top)
 . documented CGROUPS field (required renumbering all fields)
 . adapted narratives for the 3 current variable width fields
 . expanded real-time scheduling notes, 'RT' now shown as 'rt'

Signed-off-by: Jan Görig <jgorig@redhat.com>
2011-05-05 12:12:27 +02:00
Jan Görig
2a2fa20656 Fixed initialization and thread problems in top - changed by Jim 2011-04-18 16:06:54 +02:00
Craig Small
3ec6a27e8a cgroup support. rcfile errors default to fatal
This source patch addresses the following:
 Conceivable Buglets Avoided
  . added sanity checks for previous assumptions re: pid size, num cpus
  . changed response for rcfile errors to fatal, vs. silent default
 Enhancements
  . reorganized WIN_t struct for reduced padding and better readability
  . generalized code for multiple var-width cols (divorced from pflags)
  . absorbed jan gorig's cgroup patch, with attribution
 Cosmetic
  . reduced numerous #ifdef directives, especially in calibrate_fields
2011-04-15 09:24:29 +10:00
Craig Small
9bbaa0b3d2 several bug fixes, enhancements and formatting
The documentation portion of the patch addresses the following:
  README.top
    . corrected a minor typo
    . updated to reflect current patch level
  top.1
    . fixed potentially misinterpreted Me/ME strings
    . added '.Bd -literal' directives for indented fixed-width font
    . some comments changed from \# to .\" to avoid man2html problems

The source portion of the patch addresses the following:
  Buglets
    . header/task output length now consistent
    . fixed 2 obscure horizontal scrolling bugs
    . fixed potential bug regarding 'help' and 'current' window
    . messages and prompts are now also sensitive to terminal width
    . normalized buffer names/sizes now accommodate any SCREENMAX changes
  Features
    . made %CPU and 'i' mode handling more efficient
    . for input the Up/Dn arrows keys act as alternatives to Ins/Del keys
   . an optional USE_X_COLHDR define eliminates ALL 'x' toggle overhead
    . an optional ZAP_SUSEONLY define was added for Werner's modifications
  Cosmetic
    . defines and format for optional end-of-job reports standardized
2011-04-14 07:08:14 +10:00
Craig Small
fd62123562 New version of top from Jim 2011-03-31 22:15:12 +11:00
Jan Görig
9e6370a886 clear screen after fields selection
Author: Tomas Smetana <tsmetana@redhat.com>
Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=440694
2010-12-16 10:25:36 +01:00
Jan Görig
0232430bef Fix highlighting problem in top
Author: Paolo Pantaleo <paolopantaleo@gmail.com>
Bug-Debian: http://bugs.debian.org/351065
2010-12-16 10:21:47 +01:00
albert
93fd4a460e not ppc64 2009-12-10 11:37:48 +00:00
albert
6154f23d5a src==dst is illegal, failing on ppc64 2009-12-09 09:28:22 +00:00
albert
7dd414ac1b new /proc/meminfo fields 2008-03-24 04:41:26 +00:00
albert
c0f3df30ca watch: tolerate umlauts 2007-05-28 03:18:52 +00:00
albert
8e4bf3e115 top: normal exit code should be 0 2007-05-27 23:56:49 +00:00
albert
9049ffef32 ps man page 2006-09-10 06:25:56 +00:00
albert
9278134e49 top: show CPU time stolen from a virtual machine 2006-06-25 02:15:36 +00:00
albert
1e73c7b8bc bit of top hacking 2006-06-25 01:14:24 +00:00
albert
89ed9ba210 top: CPU usage column width fixes -- thanks Tony Ernst 2006-06-17 05:20:01 +00:00
albert
58f47c6614 terabytes 2006-01-22 07:57:13 +00:00
albert
73030f7346 top: crash on resize fixed -- thanks Michal Maruska #320289 2005-10-30 05:28:22 +00:00
albert
a402ba1848 fix %CPU max on 2..9 CPU SMP -- thanks Ga*tan LEURENT 2005-09-12 01:27:59 +00:00
albert
38d36b4960 top can show loose tasks now 2005-06-21 19:20:39 +00:00
albert
6e183316de no C99 variable declarations just yet 2005-01-26 07:55:52 +00:00
albert
33721d7e57 document #C to P change 2005-01-06 00:49:09 +00:00
albert
95cc4c37bb variable-width %CPU,PPID,PID 2005-01-06 00:13:12 +00:00
albert
aae3e72ab7 help and version message on stdout, with exit(0) #283541 2005-01-05 20:29:26 +00:00
albert
54ecbe0a8a consider "T" state as idle -- thanks Eric Laroche 2004-11-30 16:11:24 +00:00
albert
c961f2604a leftovers in the 3.2.4 release 2004-11-04 20:50:59 +00:00
albert
59fc9dd711 %cpu and other changes 2004-09-12 15:43:48 +00:00
albert
55b3e73334 $TOPRC, eliminate status() fn, avoid /proc/*/stat more 2004-08-30 17:30:41 +00:00
albert
4acae28535 misc 2004-08-18 02:22:13 +00:00
albert
266d5b708a wchan for multithreaded process is now ~0ull or "*" 2004-07-21 21:17:35 +00:00
albert
8dae75eb36 disable debug code 2004-07-19 04:41:56 +00:00
albert
8300609ba9 plenty -- see NEWS file and a diff 2004-07-15 01:17:15 +00:00
albert
d8921adf71 CodingStyle 2004-07-07 17:27:26 +00:00
albert
e8b5f776a3 tolerate sparse CPU numbering 2004-07-07 00:11:19 +00:00
albert
2b55ead81b CodingStyle 2004-07-06 20:05:30 +00:00
albert
eca2d501a2 CodingStyle 2004-07-06 19:13:38 +00:00
albert
04e7814f9c be crudely tolerant of crude tty emulators 2004-07-06 04:44:18 +00:00
albert
cce5c1c5a4 be crudely tolerant of crude tty emulators 2004-07-06 04:24:39 +00:00
albert
658b03bec6 alignment 2004-02-23 19:31:00 +00:00
albert
cb8bd84b21 CodingStyle left out of tarball. Tweak top. Leftovers? 2004-02-23 18:47:42 +00:00
albert
a760a2c22d "top -p1" then hit "=" did SIGSEGV; flags not regenerated right 2004-01-28 21:53:44 +00:00
albert
efd8648fc7 add slabtop, fix top ^Z terminal handling 2004-01-24 22:33:56 +00:00
albert
e6bf84b8f3 A, -, a, i, w, A, A, + problem and auto-margin problem #217559 2003-12-22 01:34:06 +00:00
albert
e583724fff H m -m -L -T are all working 2003-10-21 00:51:36 +00:00
albert
3a16c12ce3 top on wyse60, whitespace doc, thread fixes 2003-10-07 03:12:50 +00:00
albert
c462dcfad5 ps thread support 2003-09-20 08:29:55 +00:00
albert
d611d4e66f any leftover changes 2003-09-17 17:14:32 +00:00