Commit Graph

290 Commits

Author SHA1 Message Date
Jim Warner
3600f652e8 documentation: fix man pages due to refactor for wchan
This patch will bring three of our man pages into line
with the recent refactor of the libprocps wchan logic.

[ and also eliminates more damn eol whitespace which ]
[ snuck in our repo with the commit referenced below ]

Reference(s):
http://www.freelists.org/post/procps/WCHAN,11
commit cf4788c28d

Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-06-19 19:09:21 +10:00
Jim Warner
93666da62c top: adapt to a simplified library interface for wchan
This patch was made necessary by those library changes
in support of recently revised/simplified wchan logic.

Reference(s):
http://www.freelists.org/post/procps/WCHAN,11

Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-06-19 19:09:20 +10:00
Jim Warner
932f54b19d top: correct an alphabetic field error in man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-06-19 19:09:20 +10:00
Craig Small
505f257a8c library: remove procps_version functions
It doesn't make any sense to have the binary version strings
embedded into the library. The version strings are defined
already either in the Makefile or in include/c.h
2015-06-18 22:37:24 +10:00
Jim Warner
d8aee1a809 top: update man document to support the LXC containers
[ in addition to the primary 'lxc' business, i found ]
[ numerous apostrophes used instead of that back-tic ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-06-14 15:36:06 +10:00
Jim Warner
2ba7aa8b7d top: add support exploiting new library LXC containers
Reference(s):
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1424253
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1424253

Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-06-14 15:36:06 +10:00
Filipe Brandenburger
c1c73c0d00 build-sys: merge automake subdirs into toplevel
This will be required for subdir-objects, otherwise automake will have
problems with more than one Makefile.am having rules to build the same
files.

Tested that it builds and both `make check` and `make distcheck` work.

Tested `make install` and compared the tree with the one installed
before this commit, both installed the binaries to the same locations.
The binaries are also in the same location in the build tree (for
instance, ps/pscommand is still there.)

Checked the binaries for the correct libraries linked into them. Binary
sizes matched before and after this change.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2015-05-01 23:19:31 -07:00
Filipe Brandenburger
90cc5460aa build-sys: add $(top_srcdir) to include search dir
This is required for out-of-tree build to work, since many source files
include e.g. proc/*.h which is not under the include/ directory.

Tested that `make distcheck` starts working after this patch.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2015-05-01 17:09:55 -07:00
Tobias Stoeckmann
c7abb6a6ed top: correct a small typo in manual page
Reference(s)
http://www.freelists.org/post/procps/PATCH-typo-in-top1

Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-04-07 20:46:15 +10:00
Jim Warner
e107f5d63b top: miscellaneous accumulated changes to program code
This commit just tweaks top in the following respects:

. for alphabetic integrity, change 'INSP_hdr...' names

. eliminate the -Wsometimes-uninitialized warning that
was found under OSX Yosemite (llvm 6.0/clang-600.0.56)

. update program 'comments' reflecting copyright dates

Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-04-07 20:46:15 +10:00
Jim Warner
8bcdd2145d top: miscellaneous accumulated changes to man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-04-07 20:46:15 +10:00
Jim Warner
da06b8fa59 top: tweak forest view protections for forking anomaly
A recent commit eliminated the potential for a storage
violation with forest view mode. It occurred when some
program (erroneously?) created a lengthy forking loop.
However, the associated commit message was misleading.

The message implied that an unexpected order following
a sort on start_time was the cause of storage overruns
and a 'char' used to track nesting level only distorts
the display when it goes negative. Actually, the truth
is really just the opposite. Any start_time sort quirk
causes no harm while that 'char' can yield corruption.

Should some child end up sorted ahead of its parent by
way of an extremely unlikely shared start_time the end
result is such a child will be displayed unnested just
like init or kthreadd along with all its own children.

However, if nesting levels exceeded 255 (and became 0)
a massive array overrun could be triggered when such a
task and *all* its children were added to an array for
the second time. Exactly how much storage was violated
depended on the number of children that zeroed process
had spawned (hinted at via either SIGSEGV or SIGABRT).

The earlier commit limited nested levels to 100 so the
root cause of the storage violation was already fixed.
The potential for distorted nesting levels due to sort
on start_time would seem to remain. But it's extremely
unlikely that 2 tasks would share the same start_time.

Even so, a new #define has been introduced which makes
top impervious to the order of tasks such that a qsort
is no longer necessary (providing an init/systemd task
exists & was harvested as the first task by readproc).
It can be utilized if distorted nesting ever becomes a
real issue. But since there is a 5-10% performance hit
with that, we'll continue using start_time as default.

References(s):
commit ce70017eb1

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-10-29 17:00:03 +01:00
Jim Warner
ce70017eb1 top: provide some protection against forking anomalies
This commit will eliminate a very nasty bug associated
with top's forest view mode.  It addresses a potential
SIGSEGV/SIGABRT that was only encountered when another
program (erroneously?) creates a lengthy forking loop.

If the growing list of nested children is sufficiently
fast such that proc_t start_time is duplicated between
children then the sort upon which top relies might not
produce the expected order. That, in turn, could cause
the forest_adds function to initially miss some child.

But that missed child would be caught by forest_create
and eventually would cause our array boundary overrun.
Such overrun occurs when some child of that originally
*missed* child is found and a duplicate add attempted.

In correcting this bug we'll also use this opportunity
to prohibit a borrowed proc_t padding byte (char) from
going negative. If the nesting level exceeded 127, the
effect was an "unnesting" with the snprintf width then
viewed as flag+width also yielding left justification.

Henceforth, we'll limit nesting to 100 with subsequent
children shown as " +  ", not the usual " `- " prefix.

References(s):
https://bugzilla.redhat.com/show_bug.cgi?id=1153642
http://www.freelists.org/post/procps/Bug-in-the-forrest-view,6

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-10-27 17:18:47 +01:00
Jim Warner
b0767bd391 top: ensure previously saved rcfile honored completely
When startup defaults were changed users with existing
rcfiles would likely find their previous configuration
was not being honored in all respects. The disparities
involved Graphs modes and Summary/Task memory scaling.

This patch simply restores what was always intended as
the proper behavior for previously saved config files.

References(s):
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762928
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762947
. new startup defaults
commit 8ef6cd91fc

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-09-29 08:22:13 +10:00
Jim Warner
8adf4acc03 top: final tweak to recent changes for new graph modes
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-08-11 16:39:51 +02:00
Jim Warner
e92b692932 top: swat a potential buglet affecting new graph modes
This patch will cure a potential aberration associated
with a terminal's size (SIGWINCH) and top's new graphs
modes. The symptoms were a dangling tilde (~) plus the
potential loss of a graph's right-most visual content.

The condition was only apparent when a %Cpu approached
100% usage. Also the apparent loss of content affected
the 'block' graph only. With 'bar' graphs, that affect
became the loss of proper right-most bar graph colors.

The cause was determined to be a combination of: 1) an
unnecessary snprintf precision specification; and 2) a
rounding quirk for any graphs which displayed distinct
types of information (as for user/syst, used/unavail).
These could then combine to produce an extra bar/block
which, in turn, resulted in the truncation of a pseudo
termcap attribute used by the show_special() function.

What was originally interpreted as an intractable race
condition turns out to be just a self inflicted wound.

Reference(s):
http://www.freelists.org/post/procps/top-Possible-bug-in-the-graphs,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-08-08 22:14:21 +02:00
Fredrik Fornwall
dfe1f7d104 top: replace <values.h> with <limits.h> plus <float.h>
This fixes a compilation problem on Android which lacks values.h.

Reference(s):
https://gitorious.org/procps/procps/merge_requests/26

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-08-08 22:14:21 +02:00
Jim Warner
5380ef9022 top: adapt global memory support to new library format
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-31 15:10:42 +02:00
Jaromir Capik
cbba7ad7a7 top: exclude reclaimable slabs from used 2014-07-22 14:07:45 +02:00
Jim Warner
c437faf8d3 library: evolve MenAvailable algorithm on older kernel
Let's not report zero for kb_main_available when older
kernels don't have MemAvailable. Instead, if we simply
duplicate the 'free' amount we can avoid all ancillary
problems, such as those involving top's graphing mode.

Reference(s):
http://www.freelists.org/post/procps/kb-main-available-etc,3

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-21 16:17:52 +02:00
Jim Warner
7391699b07 top: correct one grammatical error in the man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-18 20:49:58 +02:00
Jim Warner
d310a18fc2 top: exploit new kb_main_available, make Jaromir happy
This patch will trade a former pessimistic calculation
of free physical memory for a more optimistic one that
uses the newly added kb_main_available library export.

But in case one might wish to return to the old former
method, there's a new #define that was made available.

[ the new calculation will affect graphing mode only ]

Reference(s):
http://www.freelists.org/post/procps/systemd-support-to-library,9

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-18 20:49:57 +02:00
Jim Warner
9500dc198c top: trade Page_size for that newly exposed page_bytes
Might as well use the newly exposed sysinfo.h variable
'page_bytes' rather than our own. Plus, in the process
we can avoid incurring yet one more function call hit.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-18 20:49:57 +02:00
Jaromir Capik
6dbe8fd18e docs: top.1 minor fix
RES - memory task has used -> is using
2014-07-17 13:08:29 +02:00
Jim Warner
6cd8691720 top: fix potential 'nan', should a system have no Swap
Gosh, just because most of us might run with some swap
file allocated, not every system might. I only wish my
testing methodology was as sophisticated as Jaromir's.

Reference(s):
http://www.freelists.org/post/procps/latest-top-enhancements,7

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-07 18:43:52 +02:00
Jim Warner
1dd0c4d07f top: as with ps, distinguish between 'T' and 't' state
Wow, even the linux/Documentation/filesystems/proc.txt
document doesn't provide us with that level of detail.

Thank you, Jaromir, for your additional clarification!

Reference(s):
commit 411d218793

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-07 18:43:52 +02:00
Jim Warner
a7741055f1 top: add another translation hint for graphs alignment
This should be the last of this kind of crap. I'll get
to work on some means to no longer burden a translator
with lengths requirements. Ideally each word should be
allowed to stand alone and the minimum/maximum lengths
handled programmatically when our ol' top is executed.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-07 18:43:52 +02:00
Jim Warner
206570e8c4 top: with new startup defaults, tweak the man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-07 18:43:52 +02:00
Jim Warner
c75586f523 top: eliminated unreferenced macros & an error message
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-07 18:43:52 +02:00
Jim Warner
8ef6cd91fc top: retire old stale startup defaults in favor of new
For over a decade top has used a startup configuration
mimicking the original redhat top. This decision dates
back to when the forked Sourceforge version was trying
to win over users in battles with that ancient kludge.

Will anybody deny that those defaults are coyote ugly?

Well, it is time that top presented a more modern look
at startup, providing that no saved rcfile exists. But
just in case some distro prefers that old, comfortable
look, there's the '--disable-modern-top' build option.

[ Pssst. With the widened memory fields it turns out ]
[ the 'Mem' default window had become almost useless ]
[ on an 80x24 terminal since %CPU & COMMAND were out ]
[ of view. So some other defaults were tweaked a bit ]
[ whether or not --disable-modern-top was specified. ]

Reference(s)
http://www.freelists.org/post/procps/tops-graph-mode-saga-continues,3

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-01 21:30:46 +10:00
Jim Warner
2199af404a top: maximize recent locale aware numeric enhancements
When startup argument parsing was recently enhanced to
account for LC_NUMERIC settings, some user input logic
dealing with numbers fails to exploit that capability.

This patch extends such enhancements to a running top.

Reference(s):
commit f7b84f45c7
http://www.freelists.org/post/procps/topwatch-floating-point-input,2

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-07-01 21:30:45 +10:00
Jim Warner
96c330e3b3 top: afford each window its own cpu/memory graph modes
When those new cpu/memory graphs modes were introduced
they had global impact. In other words, the modes that
were chosen for a 'current' window affect Summary Area
appearance for every other window as well, even though
each window sets unique View_STATES/View_MEMORY flags.

I do not know how widespread the use of top's separate
window provisions is, but I do know that documentation
promises every window (field group) provides "a unique
separately configurable summary area". And even though
that promise does not include memory scaling (separate
'E' command) the graph modes are integral to 't' & 'm'
and those were already observed on a per window basis.

So this patch just takes the cpu and memory graph mode
values out of global scope in the configuration file &
gives each window its own unique pair of graph values.

Reference(s):
commit 1d171ec741

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-28 23:46:40 +10:00
Jim Warner
805532ac32 top: fix translation hint to preserve graphs alignment
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-28 23:46:40 +10:00
Jim Warner
f7b84f45c7 top: tweak argument parsing for some locale situations
Boy I hate locale stuff. For code I thought was pretty
robust, Jaromir sure proved that it wasn't. Anyway, me
thinks this commit closes some gaps and will cause top
to behave appropriately under various locale settings.

It does *not* permit top to respond to the ',' and '.'
floating point separator without regard to the locale.
It does, however, enforce proper LC_NUMERIC responses.

Let's look on this commit as an interim solution until
Jaromir can create that proposed 'fp_decode' function.
Who knows, he might even borrow some of our mkfloat().

[ An aside: the coreutils sleep and timeout programs ]
[ claim to permit floating point arguments. However, ]
[ neither one will accept the comma separator should ]
[ the locale be a country that in fact uses a comma. ]

[ In other words, with this commit we are way ahead! ]

Reference(s):
http://www.freelists.org/post/procps/topwatch-floating-point-input
http://www.freelists.org/post/procps/topwatch-floating-point-input,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-25 13:58:31 +02:00
Jim Warner
cec1976511 top: let's not pretend top can catch SIGKILL & SIGSTOP
While there was no harm done setting a handler for the
above two signals, they are in fact uncatchable. Thus,
whenever we ran with valgrind we're politely reminded.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-25 13:58:30 +02:00
Jim Warner
db6381ae04 top: scale length for new graphs to a terminal's width
When the beginning of the Mem/Swap graphs was variable
scaling them to the current terminal's width was a bit
of a costly nightmare. So the graph size was fixed and
subject to truncation. However now that the start of a
graph can be easily predicted, I've revisited scaling.

As it turns out, any cost is minimal & mostly incurred
at an opportune time, at SIGWINCH or user interaction.
Plus, most of the apparent arithmetic is actually just
a means of documenting and will disappear thru compile
time constants in the ultimate generated machine code.

Note: those graphs will now behave just like any other
Summary Area element - they will scale from full sized
down to a terminal width of 80 columns, at which point
those displayed graphs are then subject to truncation.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-24 20:38:30 +10:00
Jim Warner
41ab7f005e top: with new bar graphs, make 'b' toggle unrestricted
While the 'b' toggle remains window based (vs. global)
it should no longer require that the window be visible
and either the 'x' or 'y' toggles to be on. Previously
those requirements were intended to remind a user that
there must be something for this command to highlight.

With the introduction of graph modes (specifically the
the bar graph) the 'bold/reverse' toggle has important
implications beyond highlighting some columns or rows.

The %Cpu(s) graph and Mem portion of the memory graphs
are designed to offer a visual clue as to the separate
elements comprising them. But that separation could be
lost under some X color schemes or when top is running
without color (in monochrome mode) and the block graph
is selected. But, if the graph is then changed to bars
any separation always becomes visible whenever the 'b'
toggle is turned off. Portions then show in 'reverse'.

So from now on we'll check nothing, we'll just toggle.

[ Besides, with all the code thrown at restricting a ]
[ 'b' toggle use, it might have all been for naught. ]
[ That toggle could still be set/unset using the 'Z' ]
[ command and the color mapping screen. Geez Louise! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-24 20:38:30 +10:00
Jim Warner
d8a8822b5f top: reflect current graph modes state in man document
This patch just beefs up the man documentation for the
new graphs modes while also reflecting the most recent
program changes, prompted by the feedback shown below.

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

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-24 20:35:20 +10:00
Jim Warner
b8614adcb5 top: make '#define GRAPHS_ALIGN' an immutable solution
My original graph modes implementation made no attempt
to align the Cpu & Mem/Swap graphs. I thought, rather,
that such alignment could be best achieved by the user
using top's 'E' memory scaling command toggle. In that
way Mem/Swap prefixes could be reduced by 3 positions,
bringing the beginning '[' into line with the %Cpu(s).

If that proved to be too cumbersome a #define could be
enabled making the Mem/Swap prefix static while adding
a few padding bytes to the %Cpu line(s) for alignment.
It was those waisted bytes that were the most concern.

What I had not counted on was the fact that the memory
lines themselves might become misaligned & that became
likely with more physical memory present. That too can
be cured with the 'E' command but as scaling is raised
we soon reach a meaningless total such as '0.003' even
though the displayed % remains valid (and unchanging).

So this commit implements unconditionally what used to
be conditional. But, instead of waisting padding bytes
we'll put that space to good use with a new 'total %'.

Reference(s):
http://www.freelists.org/post/procps/latest-top-enhancements,1
commit 1d171ec741

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-24 20:35:20 +10:00
Jim Warner
f33d49c6cf top: shorten some lines by changing a few declarations
My first blush graphs modes implementation went just a
tad overboard on identifier lengths. As a result, some
program lines were getting quite long. So, this commit
will simply shorten some excessively long identifiers.

Reference(s):
http://www.freelists.org/post/procps/latest-top-enhancements
commit 1d171ec741

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-24 20:35:20 +10:00
Jim Warner
77376e5c67 top: add graphs modes for cpu and memory, man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-22 21:39:55 +10:00
Jim Warner
1d171ec741 top: add graphs modes for cpu and memory, program code
This patch makes 't' (View_STATES) & 'm' (View_MEMORY)
commands into 4-way toggles. The two new modes provide
for two different graphs of the cpu and/or memory use.

These new capabilities are similar to those offered by
the 'htop' program. However they're aesthetically more
pleasing (to me) plus the scalings are more authentic.

Poor ol' top has long been troubled by the comparisons
offered up by the 'htop' program. Many of those things
were only true of the original redhat top while others
are no longer true of this current top program. So let
me use this commit msg to begin to correct the record.

Corrected comparisons between 'htop' & 'top' programs:
------------------------------------------------------
+ htop does not start faster, actually reverse is true
+ top offers scrolling vertically and horizontally too
. (and top offers better <Home> and <End> key support)
+ unassigned keystrokes don't subject top to any delay
. (but htop suffers that annoying ncurses <Esc> delay)
+ in top one need not type the PID to kill the process
+ in top one need not type the PID to renice a process

Some things the 'htop' program was not bragging about:
------------------------------------------------------
+ top can outperform the htop program by a wide margin
+ htop + SIGWINCH = corrupted display + restart likely
+ htop cannot preserve its screen data at suspend/exit
+ the htop column management scheme is very cumbersome
+ htop allows columns to be duplicated again and again
+ htop displays only full command lines, not pgm names
. (and that 'Command' column must always be displayed)
. (and it must always remain as the last column shown)
+ htop does not provide for any sort of command recall
+ htop's search feature does not highlight any matches
+ there is no 'find next' outside of htop search modes
+ htop does not allow Header or Process memory scaling
+ htop provides no flexibility on column justification
+ htop does not provide the means to change col widths
+ htop provides less control over colors configuration
+ htop always overwrites the rcfile with any UI change

Someday, maybe we'll provide a better comparison as an
addendum for (or replacement of) that README.top file.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-22 21:39:55 +10:00
Jim Warner
318919094d top: rearrange Mem & Swap lines and standardize 'used'
In anticipation of upcoming memory graphing provisions
the abbreviations 'Mem' and 'Swap' are being made into
individual translatable strings in order to be reused.

Additionally, the Mem 'used' amount will now no longer
included the 'buffers' and 'cached' values. Thus, each
Mem category becomes unique. This is the approach used
by tools such as 'htop' or the gnome 'System Monitor'.

Lastly, with that change to the 'used' category it has
been repositioned after 'free' on the Mem & Swap lines
making a comparison between 'total' and 'free' easier.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-06-22 21:39:55 +10:00
Jim Warner
23ebb9f44d top: tweak hotplugged response and frame refresh logic
For some time now, top has refrained from updating the
current number of cpus and memory totals with each and
every refresh cycle. Rather, to lessen overhead costs,
such values are updated periodically (5 min & 3 secs).

The delay in updating the cpu count was only important
with the addition of a cpu, since any loss is detected
immediately. And the large interval was chosen because
of the costs once associated with a glibc sysconf call
and an unlikely scenario of physically adding the cpu.

But the ease with which cpus can be taken offline then
placed back online under linux suggests that 5 minutes
may be too high. So, without addressing the likelihood
of that act, top is now more responsive in these ways:

1) that 5 minute interval has been reduced to 1 minute
2) any key, not just Enter/Space, refreshes cpus & mem

Note: we leave the man document as is, suggesting that
only the Enter/Space keys force an update for hotplug.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-05-28 06:53:19 +10:00
Jim Warner
1e8d0a323b top: add missing summary area info to the man document
Way back for release 3.2.6 of the original procps top,
a patch was introduced to explain abbreviations in the
summary area showing cpu state percentages. Ever since
that time the the 'id/idle' category has been missing.

This patch simply corrects that oversight, having been
noticed after a review of the outstanding Ubuntu bugs.

Reference(s):
. deficiency yet unresolved (May 2010)
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/574624
. patch incorporated into 'ng' (Feb 2011)
commit ee5fd1dce1
. cpu states doc requests (Jun 2005, Jan 2004)
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=312157
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=228899

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-05-28 06:53:19 +10:00
Jim Warner
444fa7102b top: miscellaneous accumulated changes to man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-05-13 16:39:49 +02:00
Jim Warner
0caa6d6e67 top: miscellaneous accumulated changes to program code
. prevent any input recall overrun if window downsized
. adjust translation notes for true column hdr maximum

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-05-13 16:39:49 +02:00
Jim Warner
bef6b0f025 top: standardize <Esc> key support with prompted input
In release 3.3.6, some commands were equipped with the
concept of a 'default pid'. The initial implementation
meant that the intuitive <Esc> key would not always be
treated as one would expect under any well behaved UI.

This patch ensures the expected <Esc> key behavior of:
terminating user input while still making possible the
necessary distinction between 'no input' & 'defaults'.

Reference(s):
http://www.freelists.org/post/procps/top-Escape-doesnt-abort-kill-command

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-04-28 20:56:48 +02:00
Jim Warner
fe37ad15cd top: avoid a 'nan' when the delay interval is very low
The granularity of /proc/uptime is fixed at hundredths
of a second. And, since we can cycle faster than that,
we are exposed to 'nan' when calculating elapsed time.

This commit will protect us from that outcome when the
delay interval has been set to an extremely low value.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-04-28 20:56:48 +02:00
Jim Warner
2f4f175c59 top: swap opening quotes for back-tics in man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-04-28 20:56:48 +02:00