]> granicus.if.org Git - procps-ng/log
procps-ng
12 years agoNEWS: updated with additional changes for next release
Jim Warner [Sat, 22 Dec 2012 06:00:00 +0000 (00:00 -0600)]
NEWS: updated with additional changes for next release

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agopmap avoid SEGV potential with new X/XX detail options
Jim Warner [Sat, 22 Dec 2012 06:00:00 +0000 (00:00 -0600)]
pmap avoid SEGV potential with new X/XX detail options

While permissions suggests that /proc/#/smaps contents
are world-readable, in practice this file might not be
available to a non-root process. Whether this is a bug
in the kernel or an intentional design decision really
makes no difference. This commit will protect pmap -X.

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Reference(s):
commit faec340719de6db8f64c468cf1dec84ffdd914a3
Author: Dimitrios Apostolou <jimis@gmx.net>
Date:   Thu Sep 27 22:08:04 2012 +1000

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: just touch up some comments for esthetic purposes
Jim Warner [Thu, 20 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: just touch up some comments for esthetic purposes

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: extend command line sort field override provision
Jim Warner [Thu, 20 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: extend command line sort field override provision

In a effort to anticipate a potential future wishlist,
the recent '-o' sort override command line switch will
now support an override of the sort direction as well.

By prepending a '+' or '-' to any valid field name the
user will be able to guarantee a specific desired sort
direction. The '+' forces a high-to-low (normal) order
while a '-' reverses that to yield a low-to-high sort.

Without this addition users would be left to the mercy
of whatever was last specified for Curwin as reflected
in the rcfile or top's default of a high-to-low order.

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: extend scaled process memory range to include PiB
Jim Warner [Tue, 18 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: extend scaled process memory range to include PiB

The recent change to task area memory scaling was just
a little short of optimum in its consistency and upper
limits. In fact, top could only scale memory fields up
to a maximum of 99.9999 TiB (with VIRT a little more).

While that seems like more than enough it was actually
artificially low, due to an unnecessary decimal place.

So, this commit standardizes both precision and widths
to achieve a minimum amount of scaling beyond the user
requested target plus reclaim some horizontal spacing.

. VIRT & DATA are now 7 bytes wide (not eight and six)
. other memory fields are 6 wide (were formerly seven)
. as before, KiB shows whole numbers only (no decimal)
. MiB, for its precision, shows a single decimal place
. all other memory ranges display three decimal places

The net result is a more homogeneous display with less
forced scaling and the recovery of three lost columns.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s);
http://www.freelists.org/post/procps/top-enhancements-i-hope,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: extend scaled summary memory range to include EiB
Jim Warner [Tue, 18 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: extend scaled summary memory range to include EiB

This commit increases the upper limit for summary area
memory scaling to 9999.999 Exbibytes. It also enhances
the man page through a helpful table for equivalences.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
http://www.freelists.org/post/procps/top-regression-reports
http://www.freelists.org/post/procps/top-enhancements-i-hope,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: enable foreign users under 'u'/'U' task filtering
Jim Warner [Tue, 18 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: enable foreign users under 'u'/'U' task filtering

This commit will allow user filtering as long as there
is a valid number representing a potential user ID. It
will serve, for example, chroot environments where the
specific user may be unknown to a host, or vice versa.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
http://www.freelists.org/post/procps/top-enhancements-i-hope,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: do not catch SIGHUP, when operating in batch mode
Jim Warner [Tue, 18 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: do not catch SIGHUP, when operating in batch mode

This commit was adapted from the openSUSE patch, whose
original comments appear between the --- marker below.

It should be noted, however, that the original changes
were ineffective (wasted) because 'Batch' mode had not
yet been set when signals were being checked and their
handlers established. Thus, SIGHUP was never bypassed.

(of course, only our comments are perfectly justified)

------------------------------------------------------
Do not setup SIGHUP signal handler if we are in the batch mode

Top enables a signal handler for the SIGHUP signal (loss of terminal).  While
this makes sense for top's default interactive mode, it doesn't make any sense
for batch mode. If you run top in nohup just to collect data over time and
disconnect top finishes which is not what one would expect.
------------------------------------------------------

Reference(s):
http://www.freelists.org/post/procps/top-enhancements-i-hope,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: limit task cpu % based on total number of threads
Jim Warner [Tue, 18 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: limit task cpu % based on total number of threads

Everyone has either accepted this potential distortion
or patched top to eliminate it. Now, the time has come
to regain some consistency when calculating that %CPU.

We'll now limit such values to: 100.0 * total threads.
And, it took way too long to address this little flaw.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
http://www.freelists.org/post/procps/top-regression-reports
http://www.freelists.org/post/procps/top-regression-reports,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: make rcfile immune from a potential locale change
Jim Warner [Mon, 17 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: make rcfile immune from a potential locale change

The delay interval is kept in the rcfile in a floating
point format and is thus susceptible to changes in the
locale between invocations. So values written as #,###
could not be read if a new locale uses decimal points.

This commit takes control of our own decimal point and
will henceforth make top immune to locale switcharoos.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
http://www.freelists.org/post/procps/top-has-a-localedpendent-config-file-toprc
http://lists.opensuse.org/opensuse-bugs/2012-12/msg01466.html

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add the ability to suppress zeros in most columns
Jim Warner [Sat, 15 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: add the ability to suppress zeros in most columns

With the increased width and precision of memory and %
columns, the proliferation of 0's when there's nothing
to report seems like a distraction versus useful data.

This commit introduces the '0' toggle which can either
display or suppress those zeros. And, like the scaling
states this new state is also preserved in the rcfile.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: provide the means to adjust scaled process memory
Jim Warner [Fri, 14 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: provide the means to adjust scaled process memory

This commit is an unrequested outgrowth of the earlier
change dealing with summary area memory field scaling.
That user selectable scaling provision is now extended
to include 6 (at present) task oriented memory fields.

The new companion 'e' (lower case) interactive command
has been added and, like the 'E' command, it can cycle
each of the currently displayed memory columns between
KiB through TiB. There are, however, some differences.

Where '+' indicates summary area truncation at a given
radix, task memory fields are automatically scaled for
their column. Thus, not all rows use the same scaling.

And, while summary area field widths were not changed,
the task memory columns were widened in order to offer
more meaningful data when the radix was increased. The
precision is automatically increased in step with each
radix: MiB displays 2 decimal places, GiB 3 and TiB 4.

To compliment that additional precision, both the %CPU
and %MEM fields were widened by 1 column and now offer
precision up to 3 decimal places. But, unique to %CPU,
widening could already have occurred due to the number
of processors in some massively parallel boxes. At any
rate, total extra width for both memory and percentage
fields could amount to twenty (precious) columns more.

So for both the memory and % fields the original width
(along with loss of precision) can be restored via new
compiler conditionals which this commit also provides.

p.s. and it will be rcfile preserved for any restarts!

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
http://www.freelists.org/post/procps/top-regression-reports

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: provide the means to adjust scaled summary memory
Jim Warner [Fri, 14 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: provide the means to adjust scaled summary memory

Earlier this year, the switch from KiB to Mib as shown
in top's summary area was postponed to those occasions
when KiB exceeded 8 digits. In hindsight that may have
moved top in the wrong direction, given the difficulty
of digesting such large numbers of digits at a glance.

This commit adds a new 'E' interactive command used to
cycle the displayed memory amounts ranging from KiB to
TiB. Thus, users can choose the radix they wish shown.

p.s. and it will be rcfile preserved for any restarts!

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
http://www.freelists.org/post/procps/top-regression-reports

commit 95f22017309f0025c724258335cf586b1d939e68
Author: James Cloos <cloos@jhcloos.com>
Date:   Mon Feb 6 00:00:00 2012 -0500

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: provide command line sort field override switches
Jim Warner [Thu, 13 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: provide command line sort field override switches

This commit adds two new command line switches dealing
with the potential need to automate/script the setting
of top's current sort field independent of the rcfile.

The -o (lower case) switch requires a lone valid field
name as an argument, from among the 42 currently used.
Then, it overrides the config file's Curwin->sortindx.

And since field names are now translatable, they could
diverge from those reflected in the documentation. So,
a 2nd switch of -O (upper case) is also provided which
outputs all names as translated and understood by top.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
Bug-Redhat: https://bugzilla.redhat.com/871844
http://www.freelists.org/post/procps/PATCH-Allow-core-file-generation-by-ps-command-rhbz871825-rhbz512857,9
http://www.freelists.org/post/procps/PATCH-Allow-core-file-generation-by-ps-command-rhbz871825-rhbz512857,15
http://www.freelists.org/post/procps/PATCH-Allow-core-file-generation-by-ps-command-rhbz871825-rhbz512857,16

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: follow ps lead, allow core dumps where applicable
Jim Warner [Wed, 12 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: follow ps lead, allow core dumps where applicable

Reference(s):
Bug-Redhat: https://bugzilla.redhat.com/871825
commit c1f10d11bc7fbab3af54a2b16e6db721b7e44f5c
http://www.freelists.org/post/procps/PATCH-Allow-core-file-generation-by-ps-command-rhbz871825-rhbz512857

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: follow ps lead, treat SIGUSR1/SIGUSR2 as harmless
Jim Warner [Wed, 12 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: follow ps lead, treat SIGUSR1/SIGUSR2 as harmless

Reference(s):
commit f62fd63d9e01bb06e9b699b4c0cebaf163718283
http://www.freelists.org/post/procps/PATCH-procps-states-a-bug-is-hit-when-receiving-a-signal-871824

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: remove undocumented alias ('V') for version ('v')
Jim Warner [Tue, 11 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: remove undocumented alias ('V') for version ('v')

This is doubtless not quite the solution envisioned by
the submitter, but 'V' should probably never have been
used as an alias for 'v' now that we have forest-view.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s):
Bug-Redhat: https://bugzilla.redhat.com/848290

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add pseudo type to the inspect demo '=' provision
Jim Warner [Mon, 10 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: add pseudo type to the inspect demo '=' provision

When 'type' was added to the alternate status line for
the '=' key, the need for the demonstration 'type' was
overlooked. This commit avoids the '(null)' potential.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Reference(s);
commit 3b2b9a95e6ee628ac957851d8fa1cd343e8f0c01

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agoAllow core file generation by ps command (rhbz#871825, rhbz#512857)
Jaromir Capik [Wed, 12 Dec 2012 14:37:42 +0000 (15:37 +0100)]
Allow core file generation by ps command (rhbz#871825, rhbz#512857)

Since the ps command handles signals with it's own handler, it doesn't create
core files when something wrong happens. The attached patch restores the ps
command ability to create core files by calling the default handler once we
print our custom message. The original RH's workaround masked SIGABRT and
SIGSEGV signals and that would conflict with the original intention of the
custom signal handler and also with the filtering patch I sent in my previous
email. Moreover, this solution generates core for all relevant signals (SIGFPE,
etc.).

Bug-Redhat: http://bugzilla.redhat.com/871825
Bug-Redhat: http://bugzilla.redhat.com/512857
Reference: http://www.freelists.org/post/procps/PATCH-Allow-core-file-generation-by-ps-command-rhbz871825-rhbz512857

Signed-off-by: Craig Small <csmall@enc.com.au>
12 years agops.test: see truncated user/group names as valid
Wouter van Kesteren [Mon, 10 Dec 2012 15:11:04 +0000 (16:11 +0100)]
ps.test: see truncated user/group names as valid

With ps now truncating the names instead of chaning to UIDs for long
usernames, the check needs to be updated too

12 years agoFix for : procps states a bug is hit when receiving a signal (rhbz#871824, rhbz#441656)
Jaromir Capik [Wed, 12 Dec 2012 11:02:52 +0000 (12:02 +0100)]
Fix for : procps states a bug is hit when receiving a signal (rhbz#871824, rhbz#441656)

Bug-Redhat: http://bugzilla.redhat.com/871824
Bug-Redhat: http://bugzilla.redhat.com/441656

12 years agoFixing negative ETIME field in ps (rhbz#871819, rhbz#433266)
Jaromir Capik [Wed, 12 Dec 2012 10:56:27 +0000 (11:56 +0100)]
Fixing negative ETIME field in ps (rhbz#871819, rhbz#433266)

12 years agotop: highlight all regular search string(s) when found
Jim Warner [Sat, 8 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: highlight all regular search string(s) when found

With the recent inspect search highlight provisions in
place, the lack of highlighting in task based searches
has grown from being only irritating to a real defect.

Thus, this commit introduces parallel functionality to
those searches initiated within a visible task window.
And just as separate inspect searches are possible for
each selection, per window task searches are provided.

However, it should be noted that there are differences
between task based searches and inspect type searches:

* There is no concept of out-of-view data when dealing
. with task rows -- if the data can't bee seen, it has
. not, in fact, been constructed from a proc_t struct.

* While inspect data is output at the character level,
. up to now all task display data was only potentially
. output and it was always based on a complete string.

* With task search highlighting, rows now containing a
. match must be output in pieces and, therefore, can't
. be optimized away like other rows which haven't been
. been altered. This is because top cannot predict the
. the contents of a search string or, how many matches
. might occur in a given row. Short search strings and
. many matches would raise buffer needs geometrically.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: refine inspect logic for already in-place matches
Jim Warner [Thu, 6 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: refine inspect logic for already in-place matches

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add inspect entry 'type' to alternate status line
Jim Warner [Thu, 6 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: add inspect entry 'type' to alternate status line

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: correct an inspect spelling error with nls impact
Jim Warner [Wed, 5 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: correct an inspect spelling error with nls impact

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: fix pid value displayed when kill default applies
Jim Warner [Wed, 5 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: fix pid value displayed when kill default applies

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: provide inspect selections with separate searches
Jim Warner [Tue, 4 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: provide inspect selections with separate searches

This commit extends Inspect provisions for 'find/next'
to each individual selection. Thus a user can maintain
multiple active searches without having to reissue the
locate command whenever the current selection changes.

To emphasize this feature the View screen now displays
the current active locate string or 'N/A' if inactive.
Such a reminder is important when no found matches are
present on the 1st display page, given that they would
otherwise be apparent via the additional highlighting.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: highlight all inspect search string(s) when found
Jim Warner [Mon, 3 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: highlight all inspect search string(s) when found

We have modeled the Inspect search provisions on those
provided by the 'less' pager. With this commit we take
the next step and provide for highlighting any strings
matched (and in view). Of course, top will continue to
adjust the beginning column so as to bring out-of-view
matches into view, while highlighting visible matches.

However, top won't emulate every 'less' behavior since
the following are seen as flaws in the user interface.

* when viewing true binary data, less makes no attempt
. to smooth the right margin by truncating unprintable
. symbols, thus creatng ragged unappealing right edges

* when viewing true binary data, less will always fail
. search requests regardless of surrounding characters

* less refuses to bring out-of-view found matches into
. view by adjusting the left-most column, if necessary

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: generalize handling of questionable rcfile issues
Jim Warner [Sun, 2 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: generalize handling of questionable rcfile issues

Previously top would warn users if an older version of
an rcfile was about to be overwritten. That's assuming
that RCFILE_NOERR was not defined. This left, however,
other potential rcfile issues or questions unattended.

For example, if a faulty 'inspect' redirected echo had
overwritten all window entries or if the inspect entry
was not 'pipe' or 'file' (actually, just a 'p' or 'f')
then top would silently accept it but look no further.

With this commit top will try to process every inspect
entry, while preserving unrecognized entries. Plus all
other non-fatal rcfile errors will now alert a user to
the potential overwrite when the 'W' command is given.

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: correct input anomaly if 'key repeat' is too fast
Jim Warner [Sat, 1 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: correct input anomaly if 'key repeat' is too fast

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: fix isolated inspect spelling error, man document
Jim Warner [Sat, 1 Dec 2012 06:00:00 +0000 (00:00 -0600)]
top: fix isolated inspect spelling error, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: give inspect search algorithm a significant boost
Jim Warner [Wed, 28 Nov 2012 06:00:00 +0000 (00:00 -0600)]
top: give inspect search algorithm a significant boost

The Inspect find algorithm has always been challenging
given the possibility that 'rows' might contain binary
data. Be that as it may, two small changes have proven
to dramatically improve the performance of such scans.

The first involves the case wherein if no match on the
'substring' portion of a row was found, then a pointer
representing the substring was increased by the length
of the search string, not the better/longer substring.
Thus, portions of the substring were always rescanned!

The second performance boost was achieved in this way:
pre-scanning each raw row for just the first character
in the search string now determines if a full match is
even possible. Therefore, repeated unproductive strstr
calls on individual substrings within that row will be
avoided. In a nutshell, 1 'if' with '}' did the trick!

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: give inspect display page algorithm a small boost
Jim Warner [Wed, 28 Nov 2012 06:00:00 +0000 (00:00 -0600)]
top: give inspect display page algorithm a small boost

This commit improves display performance when the user
has scrolled horizontally past the end of a top 'row'.

We can avoid the need to memset our buffer with spaces
and putp those spaces individually by exploiting logic
that already exists. If one '\n' character is inserted
into the buffer instead, the next terminfo string sent
will be Cap_clr_eol achieving exactly the same effect!

(now that we know a '.' + 2 spaces is squeezed to one)
(everything's perfectly justified, but it's just luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: use the type size_t more consistently for inspect
Jim Warner [Wed, 28 Nov 2012 06:00:00 +0000 (00:00 -0600)]
top: use the type size_t more consistently for inspect

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agoNEWS: updated with changes for the new release (3.3.6)
Jim Warner [Sun, 25 Nov 2012 06:00:07 +0000 (00:00 -0600)]
NEWS: updated with changes for the new release (3.3.6)

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add a flexible 'Inspect' capability, man document
Jim Warner [Sun, 25 Nov 2012 06:00:06 +0000 (00:00 -0600)]
top: add a flexible 'Inspect' capability, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add a flexible 'Inspect' capability
Jim Warner [Sun, 25 Nov 2012 05:00:05 +0000 (00:00 -0500)]
top: add a flexible 'Inspect' capability

This commit introduces an extremely powerful, flexible
brand new capability.  Now, users can pause the normal
iterative display and inspect the contents of any file
or output from any script, command, or even pipelines.

It's invoked via the 'Y' interactive command which, in
turn, is supported with simple user supplied additions
as new entries in the top personal configuration file.

A separate new 'Inspect' window supports scrolling and
searching, similar to the main top display.  Except it
extends existing 'L'/'&' (locate/locate-next) commands
so that an out-of-view match automatically adjusts the
horizontal position bringing such data into view.  And
it provides for multiple successive same line matches.

Also, the basic 'more/less' navigation keys are active
in this new 'Inspect' window, to ease user transition.

There are no program changes required when entries are
added to or deleted from the rcfile.  And there are no
known limits to the complexity of a script, command or
pipeline, other than the unidirectional nature imposed
by the 'popen' function call which top cannot violate.

Since it's impossible to predict exactly what contents
will be generated, top treats all output as raw binary
data.  Any control characters display in '^C' notation
while all other unprintable characters show as '<AB>'.

The biggest problem encountered was with the find/next
capability since that strstr guy was really diminished
given the possibility that numerous 'strings' could be
encountered *within* many of top's raw, binary 'rows'.

Oh, and another problem was in maintaining the perfect
left & right text justification of this commit message
along with all of the commit summaries.  Some of those
summaries (like this very one) are of course, slightly
shorter, to make room for the 'man document' addition.

Enjoy!

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: kill/nice provide for a default pid, man document
Jim Warner [Sun, 25 Nov 2012 05:00:04 +0000 (00:00 -0500)]
top: kill/nice provide for a default pid, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: kill/nice provide for a default pid
Jim Warner [Sun, 25 Nov 2012 05:00:03 +0000 (00:00 -0500)]
top: kill/nice provide for a default pid

As an aid to the above 2 commands, and as a prelude to
an upcoming 'inspect other output' capability, the act
of selecting a process for either has been simplified.

Positioning a task as the first one displayed, via the
up/down arrow keys, will now establish it as a default
selection for the appropriate command.  Thus, that pid
will then be incorporated in a subsequent input prompt.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: quiet lintian with escaped dashes in man document
Jim Warner [Sun, 25 Nov 2012 05:00:00 +0000 (00:00 -0500)]
top: quiet lintian with escaped dashes in man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: include under nls support an overlooked error msg
Jim Warner [Sun, 25 Nov 2012 05:00:01 +0000 (00:00 -0500)]
top: include under nls support an overlooked error msg

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agoAdd -c count option to pkill
Craig Small [Wed, 21 Nov 2012 11:11:17 +0000 (22:11 +1100)]
Add -c count option to pkill

Possibly by a side-effect but pkill -c option used to work which would
print the number of killed processes.  This small change restores this
functionality.

Bug-Debian: http://bugs.debian.org/693783

Signed-off-by: Craig Small <csmall@enc.com.au>
12 years agoUpdated news for 3.3.5
Craig Small [Tue, 6 Nov 2012 12:01:08 +0000 (23:01 +1100)]
Updated news for 3.3.5

12 years agops: cut out code unused code
Sami Kerola [Fri, 2 Nov 2012 17:50:59 +0000 (17:50 +0000)]
ps: cut out code unused code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agowatch: fix compiler warnings
Sami Kerola [Fri, 2 Nov 2012 17:50:58 +0000 (17:50 +0000)]
watch: fix compiler warnings

watch.c:255:14: warning: no previous declaration for 'get_time_usec' [-Wmissing-declarations]
watch.c:303:6: warning: no previous declaration for 'output_header' [-Wmissing-declarations]
watch.c:364:5: warning: no previous declaration for 'run_command' [-Wmissing-declarations]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agovmstat: fix compiler warnings
Sami Kerola [Fri, 2 Nov 2012 17:50:57 +0000 (17:50 +0000)]
vmstat: fix compiler warnings

vmstat.c:817:7: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
vmstat.c:708:7: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopmap: fix compiler warnings
Sami Kerola [Fri, 2 Nov 2012 17:50:56 +0000 (17:50 +0000)]
pmap: fix compiler warnings

pmap.c:80:7: warning: declaration of 'mapbuf' shadows a global declaration [-Wshadow]
pmap.c:63:13: warning: shadowed declaration is here [-Wshadow]
pmap.c:137:37: warning: declaration of 'mapbuf' shadows a global declaration [-Wshadow]
pmap.c:63:13: warning: shadowed declaration is here [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agosysctl: fix compiler warnings
Sami Kerola [Fri, 2 Nov 2012 17:50:55 +0000 (17:50 +0000)]
sysctl: fix compiler warnings

sysctl.c:293:5: warning: no previous declaration for 'is_deprecated' [-Wmissing-declarations]
sysctl.c:472:58: warning: declaration of 'pattern' shadows a global declaration [-Wshadow]
sysctl.c:67:14: warning: shadowed declaration is here [-Wshadow]
sysctl.c:650:7: warning: variable 'SwitchesAllowed' set but not used [-Wunused-but-set-variable]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoskill: fix compiler warnings
Sami Kerola [Fri, 2 Nov 2012 17:50:54 +0000 (17:50 +0000)]
skill: fix compiler warnings

skill.c:340:5: warning: no previous declaration for 'skill_sig_option' [-Wmissing-declarations]
skill.c:460:5: warning: no previous declaration for 'snice_prio_option' [-Wmissing-declarations]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agolib/fileutils: fix compiler warnings
Sami Kerola [Fri, 2 Nov 2012 17:50:53 +0000 (17:50 +0000)]
lib/fileutils: fix compiler warnings

./lib/fileutils.c:9:5: warning: no previous declaration for 'close_stream' [-Wmissing-declarations]
./lib/fileutils.c:23:6: warning: no previous declaration for 'close_stdout' [-Wmissing-declarations]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopgrep: fix compiler warnings
Sami Kerola [Fri, 2 Nov 2012 17:50:52 +0000 (17:50 +0000)]
pgrep: fix compiler warnings

pgrep.c:195:12: warning: 'fcntl_lock' defined but not used [-Wunused-function]
pgrep.c:575:5: warning: no previous declaration for 'signal_option' [-Wmissing-declarations]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopmap: remove memory leaks
Sami Kerola [Fri, 2 Nov 2012 17:50:51 +0000 (17:50 +0000)]
pmap: remove memory leaks

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agopmap: use correct types for memory allocation
Sami Kerola [Fri, 2 Nov 2012 17:50:50 +0000 (17:50 +0000)]
pmap: use correct types for memory allocation

Fixes error which did not happen always.  Changes of being affected by
the bug where greater the more there where pids defined as pmap argument.
The debian bug referral can almost certainly reproduce the problem,
especially when tried multiple times in row.

pmap: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr)
(((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct
malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >=
(unsigned long)((((__builtin_offsetof (struct malloc_chunk,
fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) -
1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) ==
0)' failed.

Reported-by: lee <lee@yun.yagibdah.de>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688180
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoAdd missing fileutils test files
Craig Small [Wed, 31 Oct 2012 11:47:48 +0000 (22:47 +1100)]
Add missing fileutils test files

Reference: http://www.freelists.org/post/procps/procpsng-version-334-released,7

Signed-off-by: Craig Small <csmall@enc.com.au>
12 years agofix sysctl.conf inclusion in dist tarballs
Mike Frysinger [Mon, 29 Oct 2012 22:47:05 +0000 (18:47 -0400)]
fix sysctl.conf inclusion in dist tarballs

If you configure w/out --enable-examples, then `make dist` doesn't
include sysctl.conf.  Configure flags should not affect the tarball
produced by `make dist`, so explicitly list the conf in EXTRA_DIST.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
12 years agoStop SIGFPE on vmstat at times v3.3.5
Craig Small [Tue, 30 Oct 2012 10:48:34 +0000 (21:48 +1100)]
Stop SIGFPE on vmstat at times

Certain setups can crash vmstat with a SIGFPE, this small patch
catches those events

Bug-Debian: http://bugs.debian.org/677903

12 years agoAdded debian patch for kfreebsd bug 674785
Craig Small [Tue, 30 Oct 2012 10:36:04 +0000 (21:36 +1100)]
Added debian patch for kfreebsd bug 674785

12 years agoBump the soname
Craig Small [Tue, 30 Oct 2012 10:34:40 +0000 (21:34 +1100)]
Bump the soname

12 years agow: do not truncate command when width is not known v3.3.4
Craig Small [Fri, 26 Oct 2012 08:06:16 +0000 (19:06 +1100)]
w: do not truncate command when width is not known

Merge remote-tracking branch 'sami/2012wk28'

12 years agotop: tweak scroll coordinates msg handling (again)
Jim Warner [Tue, 23 Oct 2012 03:22:22 +0000 (22:22 -0500)]
top: tweak scroll coordinates msg handling (again)

An earlier commit improved the scroll coordinates
message performance by offloading most of the work
to those occasions when column headers were rebuilt.

The only remaining per-frame costs were the addition
of some terminfo escapes and the Frame_maxtask count.

This commit further reduces those per-frame costs to
the absolute minimum.

Reference:
commit fbfaa868babb0974c799d45e208619412afbdfef

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: allow exit from 2nd level help via <Esc> key
Jim Warner [Mon, 22 Oct 2012 02:21:21 +0000 (21:21 -0500)]
top: allow exit from 2nd level help via <Esc> key

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agops: allow large list of groups
Eric Dumazet [Thu, 11 Oct 2012 17:02:10 +0000 (19:02 +0200)]
ps: allow large list of groups

Current linux kernels output no more than 32 groups
in /proc/{pid}/status.

Plan is to increase this limit.

This patch allows ps to not core dump if the buffer used to read status
file was too small.

# ps aux
Signal 11 (SEGV) caught by ps (procps-ng version 3.3.3).
ps:display.c:59: please report this bug

Also increases the size of the buffer from 1024 to 4096, since even with
32 groups we are close to the limit.

cat /proc/12731/status | wc
     39     128     961

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
12 years agopgrep delimeter to delimiter
Craig Small [Thu, 11 Oct 2012 10:34:50 +0000 (21:34 +1100)]
pgrep delimeter to delimiter

pgrep used delimiter and delimeter, the correct spelling is delimiter.
Thanks to Alexander Kobel for the heads-up.

Signed-off-by: Craig Small <csmall@enc.com.au>
12 years agotop: for performance, employ additional inlining
Jim Warner [Fri, 5 Oct 2012 20:15:15 +0000 (15:15 -0500)]
top: for performance, employ additional inlining

The 'refactor and enhance column width management'
recent redesign produced many subsequent benefits,
the latest of which is automatically sized fixed-width
non-scalable columns.

As expected, there was a cost associated with these
many enhancements.  That cost has now been identified
as a 1-4% performance degradation, depending on which
fields are being displayed.

This increased cost arises principally from current
drawing related function calls, whereas top-3.3.3 did
most of its drawing via macros effectively inlining
those duties.

This commit inlines the equivalent drawing functions,
thus eliminating the function call penalty, and places
this top on a par with top-3.3.3.  The trade off is a
modest additional 4k in executable size.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: 'X' command offers auto option, man document
Jim Warner [Wed, 3 Oct 2012 19:14:14 +0000 (14:14 -0500)]
top: 'X' command offers auto option, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: 'X' command offers auto option
Jim Warner [Wed, 3 Oct 2012 18:13:13 +0000 (13:13 -0500)]
top: 'X' command offers auto option

The recent introduction of a column widths override
(the 'X' command) provided for a user input amount
to be added to default field size which ranged from
5 to 10 bytes.

While that approach could prevent truncated data, the
different default sizes would almost certainly mean
some precious screen real estate was waisted.

This commit introduces the concept of dynamic widths
where top will add only enough to a field default to
prevent truncation for that specific field.

Now users have a choice between their explicit width
override or a width chosen by top to exactly match
display needs.  The former is immediate but likely
wastes some horizontal space while the latter is
iterative but will be sized precisely.

Original 'X' Command:
commit 384afa494a56d0460bc81576c18ae44978530de3
commit 47e1d063ac4256fd9c1b4efed5168d2c1670e065

Extensions to 'X' Command:
commit bbf8e44fb48e4aa4756cfa3b4405b27a791b8386
commit 7557f3f75463a720b1bd176e19afe3f9c590d5f6

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: map additional navigation keys, man document
Jim Warner [Mon, 1 Oct 2012 16:11:02 +0000 (11:11 -0500)]
top: map additional navigation keys, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: map additional navigation keys
Jim Warner [Mon, 1 Oct 2012 16:11:01 +0000 (11:11 -0500)]
top: map additional navigation keys

There were some gaps in the alternate navigation keys
top provided.  Additionally, some inconsistencies
existed in the supporting key table.

This commit adds the following new key equivalents,
mirroring the standard vim navigation keys:
. ctrl+alt+ k = pgup, ctrl+alt+ j = pgdown
. ctrl+alt+ h = home, ctrl+alt+ l = end

Also, the supporting table entries now consistently
follow these "directions":
. up/pgup, down/pgdown, left/home, right/end

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: avoid potential xterm state corruption
Jim Warner [Mon, 1 Oct 2012 15:00:00 +0000 (10:00 -0500)]
top: avoid potential xterm state corruption

To support the cursor navigation keys, after saving
the termios structure top issues 'smkx/keypad_xmit'
during startup.  However, some terminals appear to
treat that directive as persistent which leaves a
corrupted tty state after top exit.

This commit reverses the above terminal directive
via 'rmkx/keypad_local' just prior to restoring the
saved termios structure at program end.

For discovering this bug, and providing the 'rmkx'
clue to its solution, thanks to:
  Kirill A. Shutemov <kirill@shutemov.name>

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: for user justify feature, remember old-top needs
Jim Warner [Mon, 1 Oct 2012 04:59:59 +0000 (23:59 -0500)]
top: for user justify feature, remember old-top needs

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agokill -PID fixed
Craig Small [Tue, 2 Oct 2012 11:56:38 +0000 (21:56 +1000)]
kill -PID fixed

Bug-Debian: http://bugs.debian.org/688731

kill would not permit negative PIDs and thought they were options. kill
now explicitly checks for unknown options and if they are numeric
assumes they are negative PIDs.  The first negative PID stops any
further option processing.

Signed-off-by: Craig Small <csmall@enc.com.au>
12 years agotop: swat a bug introduced with recent width refactor
Jim Warner [Fri, 28 Sep 2012 21:39:35 +0000 (16:39 -0500)]
top: swat a bug introduced with recent width refactor

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: update NEWS with additional capabilities
Jim Warner [Tue, 25 Sep 2012 08:03:03 +0000 (03:03 -0500)]
top: update NEWS with additional capabilities

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: with new 'X' command, WCHAN becomes fixed-width
Jim Warner [Tue, 25 Sep 2012 07:02:02 +0000 (02:02 -0500)]
top: with new 'X' command, WCHAN becomes fixed-width

This 'Sleeping in function' field was made variable
width because the length of current kernel symbols
usually exceeded the former top's 9 character limit.

As a variable width field it would steal valuable
horizontal display positions from other, more likely,
displayed fields such as COMMAND or CGROUPS.

With the advent of the new 'X' toggle, no fixed-width
non-scalable field need suffer permanent truncation.
Thus, WCHAN is being made fixed width with a default
size of 10 characters.

Signed-off-by: Jim Warner <james.warner@comcast.net>
 top/top.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

12 years agotop: extend new 'X' command to include the TTY field
Jim Warner [Tue, 25 Sep 2012 06:01:01 +0000 (01:01 -0500)]
top: extend new 'X' command to include the TTY field

I have no idea what the maximum length of a terminal
name might be.  However, the library provides for up
to 128 characters (ouch).

So just to be safe, this commit extends the ability
to widen columns to embrace this field.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: optional wider non-scalable cols, man document
Jim Warner [Fri, 21 Sep 2012 07:02:02 +0000 (02:02 -0500)]
top: optional wider non-scalable cols, man document

12 years agotop: optional wider non-scalable cols
Jim Warner [Fri, 21 Sep 2012 06:01:01 +0000 (01:01 -0500)]
top: optional wider non-scalable cols

This commit accommodates those fields which may have
suffered truncation due to these default limits:
  . 5 digits for uid/gid type fields
  . 8 characters for user/group type fields

With a new interactive command, users can increase the
width of all such fields, or return to the defaults.

Note:
   There are no restrictions on the amount added to
   the defaults.  The user is free to vastly exceed
   screen limits which simply means such fields can
   never be displayed.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: column alignment under user control, man document
Jim Warner [Thu, 20 Sep 2012 07:02:02 +0000 (02:02 -0500)]
top: column alignment under user control, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: column alignment under user control
Jim Warner [Thu, 20 Sep 2012 06:01:01 +0000 (01:01 -0500)]
top: column alignment under user control

This commit affords user control over justification
for both column headings and the subordinate data.

Separate toggles are provided for control of numeric
data and string data.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: refactoring now allows column header nls support
Jim Warner [Wed, 19 Sep 2012 07:02:02 +0000 (02:02 -0500)]
top: refactoring now allows column header nls support

Now that column headings are independent of column
data format and require no carefully managed padding
bytes they are candidates for nls translation.

This commit migrates all column headings to the .pot
file with additional translator guidance in the form
of maximum sizes to avoid truncation.

It also places these new additions adjacent to their
associated descriptions, which were already present.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: refactor and enhance column width management
Jim Warner [Wed, 19 Sep 2012 06:01:01 +0000 (01:01 -0500)]
top: refactor and enhance column width management

This commit accomplishes the following objectives:
 * remove extra task_show parm added with 'Locate'
 * avoid column overflow with subsequent misalignment
 * eliminate spaces for column heading padding
 * decouple column headings from column data formats
 * eliminate all hardcoded column format specifiers
 * generalize the inter-column spacing management
 * remove Fieldstab.desc in favor of direct nls access
 * set the stage for nls support of column headings
 * set the stage for dynamic changes to justification

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: tidy up some miscellaneous user input logic
Jim Warner [Tue, 18 Sep 2012 06:01:01 +0000 (01:01 -0500)]
top: tidy up some miscellaneous user input logic

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: correct an old man document flaw
Jim Warner [Mon, 17 Sep 2012 06:01:01 +0000 (01:01 -0500)]
top: correct an old man document flaw

This flaw was revealed under 'man2htm' and dates back
to the first Gitorious revised top submission.

Reference:
commit fd62123562c2b71f292d3d3ee1a085709048b11a
Date:   Thu Mar 31 22:15:12 2011 +1100

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agolibrary: fix proc_t page fault delta counts alignment
Jim Warner [Sat, 15 Sep 2012 20:15:15 +0000 (15:15 -0500)]
library: fix proc_t page fault delta counts alignment

When the maj_delta and min_delta fields were added to
the proc_t, they necessitated some compiler generated
padding bytes.

With this slight reordering, those padding bytes are
no longer generated.  And since the original commit
already broke the library ABI, now is an opportune
time to correct that misalignment.

Reference:
commit 7753bd1004e65bde7fce4622c943401abc71f24a

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agops: favor truncation of long names over POSIX/UNIX standard
Jim Warner [Mon, 17 Sep 2012 20:30:45 +0000 (15:30 -0500)]
ps: favor truncation of long names over POSIX/UNIX standard

The UNIX and POSIX standards require that user and
group names be printed as decimal integers when there
is insufficient room.  This has led to a constant
stream of bug reports.

With this commit, long names will be truncated and
displayed with a trailing visual clue.

To avoid truncation. the UNIX and POSIX way to change
column width is to rename the column:
   ps -o pid,user=CumbersomeUserNames -o comm

The easy way is to directly specify the desired width:
   ps -o pid,user:19,comm

Reference:
http://www.freelists.org/post/procps/rhbz737215-ps-does-not-resolve-some-user-names

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agoTwo new options for pmap, -X and -XX
Dimitrios Apostolou [Thu, 27 Sep 2012 12:08:04 +0000 (22:08 +1000)]
Two new options for pmap, -X and -XX

Both options provide more information about a process using -X and -XX
flags. The data comes from /proc/PID/smaps so it may vary.

Signed-off-by: Craig Small <csmall@enc.com.au>
12 years agoSELinux spelling (rhbz#859900)
Jaromir Capik [Thu, 27 Sep 2012 11:46:46 +0000 (21:46 +1000)]
SELinux spelling (rhbz#859900)

We got a bug report, that our project doesn't spell "SELinux"
consistently/correctly. I've fixed that and the patch is attached.

Signed-off-by: Craig Small <csmall@enc.com.au>
12 years agotop: implement a new approach to forest view mode
Jim Warner [Sun, 26 Aug 2012 04:59:59 +0000 (23:59 -0500)]
top: implement a new approach to forest view mode

The TREE_RESCANS #define (formerly TREE_ONEPASS) has
been eliminated and the approach to forest view mode
redesigned.  The chance of dangling children has been
eliminated and overhead reduced.

We now order processes on start_time (non-display)
and are therefore immune to any pid, ppid or tgid
anomalies when pid values wrap.

The new algorithm also accommodates any distortions
caused by the 3.3 kernel 'hidepid' provisions --
something guaranteed to produce dangling children
under the former approach.

Related References:
commit a2086dfdf698f93de431349cf9a990fc5b95a768
commit cd608f462e587ee648f4bd0b798e77a52dd66c13
commit 41ed28aa5d2344e4838504a878a4db0afff8a6d8

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add major/minor page fault deltas, man document
Jim Warner [Sun, 8 Jul 2012 09:06:11 +0000 (04:06 -0500)]
top: add major/minor page fault deltas, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add major/minor page fault deltas
Jim Warner [Sun, 8 Jul 2012 09:02:58 +0000 (04:02 -0500)]
top: add major/minor page fault deltas

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agolibrary: adapt proc_t for top 'page fault delta' counts
Jim Warner [Thu, 5 Jul 2012 17:47:22 +0000 (12:47 -0500)]
library: adapt proc_t for top 'page fault delta' counts

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add new scrollable column ENVIRON, man document
Jim Warner [Sun, 1 Jul 2012 05:00:33 +0000 (00:00 -0500)]
top: add new scrollable column ENVIRON, man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: add new scrollable column ENVIRON
Jim Warner [Sun, 1 Jul 2012 05:00:22 +0000 (00:00 -0500)]
top: add new scrollable column ENVIRON

The recent introduction of scrollable variable width
columns makes a process 'environment' a potentially
useful addition to top's displayable fields.

This commit exploits the following new library flag:
   PROC_EDITENVRCVT

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agolibrary: add a single vector string choice for 'environ'
Jim Warner [Sun, 1 Jul 2012 05:00:11 +0000 (00:00 -0500)]
library: add a single vector string choice for 'environ'

In preparation for top scrollable environment display,
the new flag PROC_EDITENVRCVT was added to mirror the
existing single vector string handling for cgroup and
cmdline.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: revise default for forest view child scans
Jim Warner [Wed, 4 Jul 2012 09:04:04 +0000 (04:04 -0500)]
top: revise default for forest view child scans

In an effort to avoid dangling children when in forest
view mode, top defaulted to a complete rescan of every
proc_t for each child encountered.

That expense was never really cost justified and now
with the 3.3 kernel 'hidepid' provisions it no longer
can offer such protection.

With this commit, the TREE_ONEPASS define is changed
to TREE_RESCANS so as to reverse the default scan
behavior.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: miscellaneous minor tweaks (mostly spelling)
Jim Warner [Sat, 30 Jun 2012 05:00:55 +0000 (00:00 -0500)]
top: miscellaneous minor tweaks (mostly spelling)

This commit represents mostly spelling corrections
in comments.  It also includes a few very minor logic
changes/relocations.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: correct field order within Section 3a, man document
Jim Warner [Sat, 30 Jun 2012 05:00:44 +0000 (00:00 -0500)]
top: correct field order within Section 3a, man document

This section purported to list fields in alphabetical
order, but this was not always true.

With this commit, strict ascii collating sequence is
now observed.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: improve unsolicited user input validation
Jim Warner [Sat, 30 Jun 2012 05:00:33 +0000 (00:00 -0500)]
top: improve unsolicited user input validation

The logic associated with invalid keystrokes was
simplified through some minor reordering.

Signed-off-by: Jim Warner <james.warner@comcast.net>
12 years agotop: improve scroll coordinates message handling
Jim Warner [Sat, 30 Jun 2012 05:00:22 +0000 (00:00 -0500)]
top: improve scroll coordinates message handling

With the introduction of intra-column scrolling, the
scroll coordinates message was enhanced to give some
hint of positioning within a scrolled column.

Rather than rebuild this somewhat costly string from
scratch with each frame, we'll now do the bulk of the
work only when column headers are constructed.

The only remaining per frame costs will then be the
addition of a few terminfo escapes and the current
Frame_maxtask count.

Signed-off-by: Jim Warner <james.warner@comcast.net>