Commit Graph

65 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
91edf89810 remove trailing spaces in top batch mode
Signed-off-by: Jan Görig <jgorig@redhat.com>
2011-06-01 13:58:06 +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
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
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
58f47c6614 terabytes 2006-01-22 07:57:13 +00:00
albert
38d36b4960 top can show loose tasks now 2005-06-21 19:20:39 +00:00
albert
55b3e73334 $TOPRC, eliminate status() fn, avoid /proc/*/stat more 2004-08-30 17:30:41 +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
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
d611d4e66f any leftover changes 2003-09-17 17:14:32 +00:00
albert
e54c8239b1 new Linux 2.6.0-test4 CPU stats shown 2003-09-08 01:39:49 +00:00
albert
6dbef339c2 fix 4 GB wrap-around in top 2003-09-06 05:11:04 +00:00
albert
6ba229fa4c alignment 2003-08-11 01:59:53 +00:00
albert
3e67b58ec2 satisfy GPL section 2a and LGPL section 2b name+date requirement 2002-12-15 00:30:17 +00:00
albert
36ff49a29e the u arg, U arg, u key, and U key 2002-12-10 03:01:17 +00:00
albert
dc5cb1da28 likely to improve performance 2002-12-08 22:51:09 +00:00
albert
967acac8b7 for Jim 2002-12-07 22:36:21 +00:00
albert
f1c02989c7 topz-Phase1.patch 2002-12-06 06:53:29 +00:00
albert
0d04de5f6c broken but interesting 2002-12-05 03:00:42 +00:00
albert
b48907a9d7 add_missing_fields 2002-12-05 01:47:36 +00:00
albert
c7e7b44284 not done yet 2002-12-04 22:48:30 +00:00
albert
b84406584f mostly done ('f' screen needs work) 2002-11-30 15:56:53 +00:00
albert
7860e77d90 prep #1, some structs 2002-11-30 01:22:01 +00:00
albert
f165d14c56 old sort keys, etc. 2002-11-29 16:01:04 +00:00
albert
d614bf02e6 revert the Nov2002 c99 attempt 2002-11-28 23:09:48 +00:00
albert
852f486cd9 topz-SomeMore.patch 2002-11-27 09:13:42 +00:00
albert
98895d57c1 Jim needs restrictions 2002-11-27 00:24:01 +00:00
albert
d0d827dffe B toggle, fix t toggle, windowed batch, 3x to 6x faster, out-of-bounds RT as "RT" 2002-11-24 22:04:03 +00:00
albert
82799b0fea less bold 2002-11-10 10:58:11 +00:00
albert
cbe15808d0 cleaner and 9% faster 2002-11-08 00:31:28 +00:00
albert
85fc8beb41 misc 2002-10-30 06:06:44 +00:00
albert
dc792e9d58 remove Rik library support 2002-10-22 18:12:27 +00:00
albert
e7017ab912 1st 3.0.5 patch: wide top display 2002-10-21 04:50:41 +00:00
albert
c956c3dbf3 version checking clean-up 2002-10-18 21:15:49 +00:00
albert
80a7f3ff35 SMP fix, speed, hide IO-wait, dumb/VT510 terms 2002-10-18 21:07:49 +00:00
albert
ca1b842d0e fix a few Alpha troubles 2002-10-12 20:32:24 +00:00
albert
1f13637522 UGH_ITS_4_RH, //atic stuff, man page codes 2002-10-12 19:15:53 +00:00
albert
0ab188d8c4 default sort 2002-10-11 23:30:29 +00:00
albert
3615538e2e new default display 2002-10-11 22:45:09 +00:00
albert
c37937afbb 2.2.xx non-SMP lacks cpu0 in /proc/stat 2002-10-11 20:42:50 +00:00