Craig Small [Sat, 3 Mar 2012 02:46:49 +0000 (13:46 +1100)]
Merge remote-tracking branch 'sami/2012wk7' into sami-merge
Craig Small [Sat, 3 Mar 2012 01:05:07 +0000 (12:05 +1100)]
Fix string literals in fprintf and friends
Both these are from [-Werror=format-security]
sig.c:262:5: error: format not a string literal and no format arguments
global.c:517:3: error: format not a string literal and no format arguments
Craig Small [Sat, 3 Mar 2012 00:49:48 +0000 (11:49 +1100)]
ps abort causes problems in testsuite
Under certain circumstances, using abort() when either make check
or make distcheck puts ps into an infinite loop around the
function catastrophic_failure() in ps and the C library raise
and abort functions.
Using exit removes this problem and does almost the same thing.
Craig Small [Fri, 2 Mar 2012 12:05:28 +0000 (23:05 +1100)]
fixed uptime check regexp
Jim Warner [Thu, 1 Mar 2012 05:59:59 +0000 (23:59 -0600)]
top: honor the restrictive, crufty old top rcfile
At one time, new top silently defaulted when an rcfile
was found to be incompatible. This is exactly what
the old top did. However, after some discussion it
was decided top should alert the user and thereby
save the system administrator some headaches.
Now, some are upset over the fatal error, proving you
can't please everybody. But in all fairness, given
the difficulty of customizing old top, any reluctance
to delete an old saved rcfile is understandable.
To ease transition to this new top, old style rcfiles
will now be honored and converted to the new format.
And if not disabled at ./configure time via CFLAGS,
a user will be warned when an old style rcfile is
about to be overwritten using the 'W' command.
Lastly, the config validation logic was enhanced to
help ensure both types of rcfile haven't been edited
manually and possibly made unuseable.
Reported-By: sergio <mailbox@sergio.spb.ru>
Bug-Debian: http://bugs.debian.org/651213
Reported-By: martin f krafft <madduck@debian.org>
Bug-Debian: http://bugs.debian.org/651863
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Wed, 29 Feb 2012 06:00:00 +0000 (00:00 -0600)]
top: fix a regression associated with USE_X_COLHDR
When sort column header emphasis was extended to a
monochrome screen, the ability to emphasize selections
on the Fields Management screen was lost when colors
were not being displayed.
This patch corrects that bug by using the capclr_hdr
terminfo string instead of capclr_msg.
Reference:
commit
0c6aa6af4190be60853acced8023470c3d1910c1
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sat, 11 Feb 2012 17:11:11 +0000 (11:11 -0600)]
build-sys: rename the 'tools' subdirectory to 'misc'
The newer tools/ subdirectory shares a common prefix
with the previously existing top/ subdirectory and
thereby hinders shell command completion.
There was already a minor conflict between testsuite/
and top/. This patch renames the tools/ subdirecory
to avoid an even greater conflict.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sat, 11 Feb 2012 08:02:02 +0000 (02:02 -0600)]
top: relocate a prototype to prevent compiler warning
Until the 'locate/search' provisions were added,
top avoided the need for any function prototypes
through careful source file organization. But
the addition of the find_string function required
a prototpe for task_show, lest a massive file
reorganization be undertaken.
This commit moves the actual protype out of top.h
and places it adjacent to the caller in order to
avoid a warning when top_nls.c is compiled.
References:
commit
270e8e7eeb66b47569940f537cdad4ab46cd36be
commit
d6e6a9aa38092e55f976a398899635105dd89893
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sat, 11 Feb 2012 07:01:01 +0000 (01:01 -0600)]
top: isolate #defines actually present in confiure.ac
All top.h defines were lumped together as:
'Development/Debugging defines'
This commit establishes this new category:
'Defines represented in configure.ac'
And that new category now contains OOMEM_ENABLE,
which enables the SuSE out-of-memory additions
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sat, 11 Feb 2012 00:18:18 +0000 (18:18 -0600)]
top: remove residual logic for obsolete functionality
At one time the 'open_psdb_message' library call was
supported with the concept of a postponed message
which would display after top startup completed.
In turn, that required logic to strip the '\n' which
was embedded (inappropriately) in any such message.
Nowdays top treats such a returned error as fatal so
there is no need for the 'strim' function which is
being removed with this commit.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Fri, 10 Feb 2012 21:15:15 +0000 (15:15 -0600)]
top: update latest CPU % distortions understanding
We originally approached the potential problem of
% CPU distortions as unique to Nehalem type cpus.
The latest information suggests that it may have
been due to a kernel anomaly that has since been
corrected.
Yet even without such a cpu, wide disparities in
tics allocation among all available cpus have
sometimes been observed -- spikes as it were in
the normal pattern. This has happened under both
version 2.26.38-13 and 3.0.0-15 kernels.
The small amount of additional code addressing the
original problem carries very little overhead. It
is being retained to afford protection against any
future tic accounting aberrations.
In this commit, supporting programmer comments have
been divorced from any particular cpu type. Also,
another variable and manifest constant will now be
eliminated when CPU_ZEROTICS is defined.
References:
commit
02508b3d76af5bc33c7e559b84d3e5e123cdf2ac
http://www.freelists.org/post/procps/CStates-handling-new-switch,50
Jim Warner [Fri, 10 Feb 2012 16:10:10 +0000 (10:10 -0600)]
top: fix regression created when fields mgmt reorg'd
When the calibrate_fields function was broken up for
mainainability, an obscure regression was introduced.
For the resulting bug to affect the display, all of
the following conditions would have to be met:
. USE_X_COLHDR was not defined
. column highlighting had been turned on
. many, perhaps all, fields were displayable
. the user then typed the <End> key
. and the current sort column just happened to
be immediately to the left of the left-most
visible field
This patch corrects for that remote possibility.
Reference:
commit
d0e16acf156b066d56415b1b7ccbfad4ae1526d8
Signed-off-by: Jim Warner <james.warner@comcast.net>
Gilles Espinasse [Sat, 25 Feb 2012 09:01:02 +0000 (10:01 +0100)]
Fix a remaining util-linux word in autogen
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Sami Kerola [Mon, 13 Feb 2012 20:21:43 +0000 (21:21 +0100)]
sysctl: deprecate parameters
According to arp(7) manual page base_reachable_time and retrans_time
are obsolete since kernel 2.6.12. Based on that the print all listing
will not show these two parameters, and attempt to set them will fail.
Reported-by: Alexandre Cavalcante Alencar <alexandre.alencar@gmail.com>
Bug-Debian: http://bugs.debian.org/599556
Reference: http://www.mail-archive.com/bk-commits-head@vger.kernel.org/msg03396.html
Reference: http://www.opensubscriber.com/message/linux-kernel@vger.kernel.org/
7344177.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Mon, 13 Feb 2012 20:18:54 +0000 (21:18 +0100)]
docs: inform about pkill and --inverse option
The short option for --inverse is disabled for pkill, but long option
works just in case someone will find that piece of functionality usable.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=558044#67
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Craig Small [Sun, 12 Feb 2012 10:56:05 +0000 (21:56 +1100)]
Merge remote-tracking branch 'sami/2012wk6'
Jim Warner [Thu, 9 Feb 2012 06:00:00 +0000 (00:00 -0600)]
top: extend the Copyright (c) dates to include 2012
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 9 Feb 2012 04:22:22 +0000 (22:22 -0600)]
top: reorganize some fields management logic
The calibrate_fields function had grown too large and
was adversly impacting maintainence. So half of the
logic was split out into a new function.
Now, maintainence of column headers and the required
library flags is organized as follows:
. adj_geometry (calibrate_fields helper)
provides low-level support for sigwinch, memory
. build_headers (calibrate_fields helper)
constructs the headers and library flags
. calibrate_fields
establishes which fields will be displayed
( note the alpha order mentioned in a prior commit )
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Tue, 7 Feb 2012 17:11:11 +0000 (11:11 -0600)]
top: standardize names of all 'helper' functions
The top program is carefully organized into sections
and those sections are carefully placed so as to avoid
the need for prototypes. *
Additionally, names of functions are carefully chosen
to maintain alphabetical order within each section.
The names of most 'helper' functions, which are always
placed immediately above the calling functions, often
only met the spirit of the alphabetical law, not the
actual letter of that law.
This commit alters the names of such helper functions
so as to mainatin strict ascii alphabetical order
within each section.
* the single exception to prototypes is find_string,
which calls the task_show function, and would have
prompted a massive reorganization.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Tue, 7 Feb 2012 05:59:59 +0000 (23:59 -0600)]
top: use CPU_ZEROTICS to embrace the Nehalem logic
The recently added logic dealing with "missing" tics
is mutually exclusive with logic associated with a
define called CPU_ZEROTICS.
This commit expands the use of that define to exclude
such Nehalem logic as appropriate.
It also extends programmer notes in top.h to include
an attribution for initiating the topic of potential
Nehalem type % CPU distortions, acknowledging:
Jaromir Capik, <jcapik@redhat.com>
References
commit
ce1410a51a624a91816fcc8c232c8a4d60b09638
commit
9e7dd43ab7b2e68177cefd49b3c07311ea79bc1a
commit
a9041a5526eddc631b94bac86c09a47e60a3b4e1
James Cloos [Mon, 6 Feb 2012 05:00:00 +0000 (00:00 -0500)]
top: postpone the switch from Kb to Mb in summary display
The mem and swap lines have enough room to show eight significant
digits, so switch to showing MB when >=100MB, not >=10MB.
The extra detail is valuable; it should not be elided.
Signed-off-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Jim Warner <james.warner@comcast.net>
Sami Kerola [Sat, 11 Feb 2012 20:22:06 +0000 (21:22 +0100)]
libprocps: remove linux 2.7.0 check
Checking for linux kernel version 2.7.0 is meaningless now when 3.0.0
is out.
Reported-By: Christian Hofstaedtler
Bug-Debian: http://bugs.debian.org/635553
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 11 Feb 2012 20:00:05 +0000 (21:00 +0100)]
watch: inform about optional argument for -d switch
The -d, --differences switch(s) can use optional argument that was
not documented earlier.
Reported-By: Marian Sigler <m@qjym.de>
Bug-Debian: http://bugs.debian.org/597021
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 11 Feb 2012 19:33:17 +0000 (20:33 +0100)]
pkill: remove -v match inversion option
The option -v does not make much sense in pkill context.
Reported-By: "Jason A. Spiro" <jasonspiro4@gmail.com>
Bug-Debian: http://bugs.debian.org/558044
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 11 Feb 2012 19:02:54 +0000 (20:02 +0100)]
pgrep: allow signal definition to be anywhere in command line
I as user often try to pkill something, notice that program did not
die and pkill again with signal -9. Before this commit previous one
could not add signal at the end of command line, as the signal
definition had to be first argument, which was annoying.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 11 Feb 2012 19:02:16 +0000 (20:02 +0100)]
pgrep: use c style comments
The c++ comments e.g. // should not be used in c code. Additionally
white spaces are converted to tabs as a small clean up.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Thu, 9 Feb 2012 21:57:13 +0000 (22:57 +0100)]
strutils: reindent the file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Thu, 9 Feb 2012 21:53:29 +0000 (22:53 +0100)]
skill: fix argument parsing regression
Command skill accepted earlier command name as argument. This did
not work since commit
991b8a94f0354a128085c7411713e17282c4e04a.
Reported-By: "Anne C. Hanna" <orion@ugcs.caltech.edu>
Bug-Debian: http://bugs.debian.org/659038
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Thu, 9 Feb 2012 20:18:14 +0000 (21:18 +0100)]
tests: fix dejagnu pwdx and vmstat checks
The pwdx check expected error message, which where in use for only
short period of time. The old message was put in place in commit
9d47cb0c38137581a46951fb7c6fa2a1dc8c24cf
The vmstat issue was triggered by 'sr0' cdrom device, which gives
following unexpected output. Fix simply ignores partitions which has
zero activity. Besides such partitions probably would not apply as
good candidate of -p option anyway.
$ vmstat -p sr0
Partition was not found
Reported-By: Moritz Muehlenhoff <jmm@debian.org>
Bug-Debian: http://bugs.debian.org/656508
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Jim Warner [Thu, 9 Feb 2012 05:59:59 +0000 (23:59 -0600)]
top: fixup logic for Nehalem cpu 'idle' threshold
Due to a poorly constructed temporary fprintf
used during development, an earlier commit went
a little too far in its computations. The net
result was the code looked nice but actually
accomplished nothing.
It is the /proc/stat line 1 (summary line)
whose tics must be used in establishing the
threshold boundary. And that calculation
need be performed just once per frame.
This commit ensures one threshold calculation
per delay interval no matter how many cpus
are ultimately displayed.
It also corrects scalability by factoring in
the total number of online processors.
Reference:
commit
9e7dd43ab7b2e68177cefd49b3c07311ea79bc1a
Jim Warner [Tue, 7 Feb 2012 21:15:15 +0000 (15:15 -0600)]
top: reduce use of 'clear_screen' to absolute minimum
Along the way to width override support (-w switch),
this top began clearing the screen far more often
than his predecessor. In fact, it happend with each
user keystroke.
This commit dramatically reduces those occurances.
The screen will now be cleared only when an actual
SIGWINCH is received.
Thanks for identifying this flaw belongs to:
James Cloos, cloos@jhcloos.com
References:
http://www.freelists.org/post/procps/Merge-request
Blame:
c2dcbef4826806f85b7ad6de2d9fe99bc390d603
Author: Jim Warner <james.warner@comcast.net>
Date: Thu May 26 11:33:32 2011 +0200
subject: added output width/height override support to top, + misc
Jim Warner [Tue, 7 Feb 2012 16:10:10 +0000 (10:10 -0600)]
top: tweak the new 'reduce % CPU distortions' algorithm
The original approach to potential % CPU distortion due
to Nehalem type cores being turned off completely when
idle worked ok until the user typed something.
At that point, elapsed tics would no longer equal the
calculated value producing an undesirable 100% idle
condition until the next update or <Enter/Space> key.
This commit employs actual elapsed tics in determining
whether a cpu should be considered idle and thus makes
top's individual cpu display immune to user keystrokes.
Jim Warner [Fri, 3 Feb 2012 06:00:00 +0000 (00:00 -0600)]
top: reduce % CPU distortions when a core was turned off
This patch provides for cpu cores which can be turned
off completely when idle (Nehalem, etc.) thus registering
very few or no tics since the last update cycle.
When CPU_ZEROTICS is not defined (the default), any
displayed cpu with less than a certain amount of total
tics will show as 100% idle. That amount is tempered
by the delay interval and total number of cpus.
This commit also satisfies the Debian 'top_nohz' patch
(11/24/09) in a slightly more efficient manner. That
patch concerned kernels built with CONFIG_NO_HZ.
Reference:
http://www.freelists.org/post/procps/CStates-handling-new-switch,4
Jim Warner [Wed, 1 Feb 2012 06:00:00 +0000 (00:00 -0600)]
top: tolerate loss of smp cpus, improve CPU_t management
Prior to this patch, top was able to handle any hotplugged
cpus *added* to the system in two distinct ways.
1) Newly added cpus would be detected by sysinfo_refresh
calling the library's cpuinfo function, which occurs
at most every 5 minutes.
2) The user could force a refresh using either the
<Enter> or <Space> keys.
Unfortunately, the *loss* of a cpu would produce an early
exit due to a /proc/stat read failure. Such a failure
can be produced in the following way:
sudo echo 0 > /sys/devices/system/cpu/cpu??/online
This commit allows top to tolerate the loss of cpus.
It also provides for more efficient CPU_t management,
especially for massively parallel cpu environments.
Note: Changes to the cpu compliment can produce a single
cycle distortion of cpu percentages. Such distortion is
most visible when each cpu is being displayed. It can
be eliminated with a forced refresh via <Enter>/<Space>.
Jim Warner [Mon, 23 Jan 2012 20:44:13 +0000 (14:44 -0600)]
top: treat additional keys like the find_string() keys
With the introduction of the 'locate string' provisions,
the precedent for calling tertiary helper functions from
secondary do_key helper functions was established.
This commit simply migrates some additional keys out of
the do_key function itself and into the more generalized
key table.
Jim Warner [Thu, 19 Jan 2012 20:33:34 +0000 (14:33 -0600)]
top: improve USE_X_COLHDR effect when colors toggled off
Normally, when the chosen sort column is displayed via the
'x' command toggle the entire column is highlighted. And
while this version of top substantially reduced the cost
of such highlighting, a small pathlength increase remained.
The USE_X_COLHDR define was an experimental alternative which
eliminated all recurring runtime costs for such emphasis by
highlighting the column header, not the entire column.
The previous implementation required colors to be turned on
(the 'z' toggle) for such highlighting to be visible. This
commit extends column header emphasis to include monochrome
displays as well.
Reference:
http://www.freelists.org/post/procps/post-nls-merge,6
Jim Warner [Fri, 13 Jan 2012 22:07:40 +0000 (16:07 -0600)]
top: properly handle an improper $HOME environment variable
Since its inception, this top has improperly handled an
empty HOME environment variable. Under those conditions
a path to the root directory would have been constructed.
That caused no real harm upon startup since the display
defaults would have been employed. However, except for
root, it would have been impossible to save the rc file.
This commit keeps the promise made in the documentation.
Sami Kerola [Sun, 5 Feb 2012 22:14:32 +0000 (23:14 +0100)]
libprocps: open file should be closed, not freed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Feb 2012 21:58:24 +0000 (22:58 +0100)]
vmstat: open file should be closed, not freed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Feb 2012 20:43:36 +0000 (21:43 +0100)]
pmap: ensure arg1 is not null, and set qualifers to match with usage [smatch scan]
pmap.c:436 main(59) error: we previously assumed 'arg1' could be null (see line 427)
pmap.c:136:3: warning: return discards 'const' qualifier from pointer target type [enabled by default]
pmap.c:142:4: warning: return discards 'const' qualifier from pointer target type [enabled by default]
pmap.c:150:2: warning: return discards 'const' qualifier from pointer target type [enabled by default]
pmap.c:300:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Feb 2012 20:10:53 +0000 (21:10 +0100)]
pgrep: fix potential null derefences [smatch scan]
pgrep.c:137 split_list(19) error: potential null derefence 'list'.
pgrep.c:540 select_procs(106) error: potential null derefence 'list'.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Feb 2012 20:02:34 +0000 (21:02 +0100)]
sysctl: fix potential null derefence [smatch scan]
sysctl.c:560 PreloadSystem(29) error: potential null derefence 'cfgs'.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Feb 2012 19:54:58 +0000 (20:54 +0100)]
skill: ensure optarg is not null [smatch scan]
skill.c:549 skillsnice_parse(87) error: we previously assumed 'optarg' could be null (see line 539)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Feb 2012 19:48:33 +0000 (20:48 +0100)]
watch: remove unreachable code
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Feb 2012 19:44:39 +0000 (20:44 +0100)]
pwdx: free memory before exit
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Wed, 25 Jan 2012 08:18:38 +0000 (09:18 +0100)]
sysctl: fix coding style
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Wed, 25 Jan 2012 08:17:49 +0000 (09:17 +0100)]
docs: add to pgrep.1 count return value information
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Tue, 24 Jan 2012 21:34:12 +0000 (22:34 +0100)]
docs: remove tcp_default_win_scale from sysctl.conf sample
The variable net.ipv4.tcp_default_win_scale has not been part of
kernel since 2.6.9 (Oct 2004).
Reference: http://oss.sgi.com/archives/netdev/2004-08/msg01589.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Tue, 24 Jan 2012 20:54:01 +0000 (21:54 +0100)]
libprocps: hide private symbols
Clean the global list of symbols contain only functions and variables which
are being called from library. The removed symbols are internal for the
library, which means they can be changed without changes to programs using
the library. This clean up should help incoming libprocps clean up work.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Craig Small [Tue, 24 Jan 2012 11:36:28 +0000 (22:36 +1100)]
Merge remote-tracking branch 'sami/vapier'
Mike Frysinger [Tue, 24 Jan 2012 05:44:05 +0000 (00:44 -0500)]
ps: include error.h
This code currently uses error_at_line() from error.h, so pull it in.
Long term, this might get moved to c.h as a local helper on err.h,
but I have no idea.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger [Tue, 24 Jan 2012 05:41:39 +0000 (00:41 -0500)]
proc: pull in ctype.h where needed
Fix the build warnings:
sig.c:227:5: warning: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]
sig.c:231:3: warning: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger [Tue, 24 Jan 2012 05:40:28 +0000 (00:40 -0500)]
use helpers from c.h
A few files still use the C library helpers from err.h, so migrate
them to the local c.h helpers.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger [Tue, 24 Jan 2012 05:36:15 +0000 (00:36 -0500)]
watch: include sys/wait.h for waitpid
Fixes build warning:
watch.c:682:3: warning: implicit declaration of
function 'waitpid' [-Wimplicit-function-declaration]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger [Tue, 24 Jan 2012 05:34:51 +0000 (00:34 -0500)]
include error.h for error() and friends
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Sami Kerola [Sun, 22 Jan 2012 00:23:10 +0000 (01:23 +0100)]
skill: exclude debugging strings from nls
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 21 Jan 2012 22:29:02 +0000 (23:29 +0100)]
tload: remove unnecessary goto
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 21 Jan 2012 15:49:47 +0000 (16:49 +0100)]
docs: aligh top.1 header with other procps-ng utils
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 21 Jan 2012 15:41:31 +0000 (16:41 +0100)]
docs: add exit values to watch.1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 21 Jan 2012 15:24:33 +0000 (16:24 +0100)]
tload: check write() return value
Exit at rare events when writing to tty is unsuccessful.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 21 Jan 2012 12:24:02 +0000 (13:24 +0100)]
pkill: enable displaying what is killed
Add new command line options -e, --echo to display what is
killed. Cost of this change is greater run time memory footprint,
because an union had to be changed to struct to allow name and
pid printing which what I as an user would expect to see in
verbose kill output.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 21 Jan 2012 01:14:21 +0000 (02:14 +0100)]
pgrep: fix compiler warning
pgrep.c:786:4: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 21 Jan 2012 01:09:48 +0000 (02:09 +0100)]
pkill: fix error printing
Print correct pid number of process that was where not killed
because of kill was not successful. Incorrect behaviour before
this fix is bello.
-- snip
$ ps -elf | grep dh[c]
1 S root 1409 1 0 80 0 - 1782 poll_s 02:01 ? 00:00:00 dhclient wlan0
$ pkill dhc
pkill: killing pid 1 failed: Operation not permitted
-- snip
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Fri, 13 Jan 2012 21:38:47 +0000 (22:38 +0100)]
ps: unify cases and remove trailing dots in messages
Strings with lower caps & no trailing dots have greater change to
have multiple occurences, meaning less effort for translators, than
strings with them.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Tue, 10 Jan 2012 21:03:12 +0000 (22:03 +0100)]
other: make AUTHORS file obsolete
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Tue, 10 Jan 2012 20:51:06 +0000 (21:51 +0100)]
docs: remove old information from HACKING
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Tue, 10 Jan 2012 20:47:11 +0000 (21:47 +0100)]
ps: add catastrophic_failure()
The catastrophic_failure function tries to make bug reporting useful
by telling in which line error occured, and drops core.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Mon, 9 Jan 2012 18:50:20 +0000 (19:50 +0100)]
other: tell in ChangeLog where to see changes
We do not want to maintain ChangeLog, people should look git log
instead.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Jim Warner [Mon, 9 Jan 2012 17:26:45 +0000 (11:26 -0600)]
top: avoid %cpu distortions when toggling task/thread modes
This commit addresses a long standing buglet (debian #441166) which
surfaces when the display mode is switched between task and threads.
An extra procps refresh is now forced upon such a transition which
parallels the approach used at startup for the exact same reason.
Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=441166
Jim Warner [Sun, 8 Jan 2012 15:54:05 +0000 (09:54 -0600)]
top: force newline for unexpected signal abnormal exit
This commit just restores the pre-nls behavior, which was lost
in the migration to nls string tables support.
Jim Warner [Fri, 6 Jan 2012 14:49:21 +0000 (08:49 -0600)]
vmstat: slabinfo (-m option) test disabled if not readable
The dejagnu tests for slabtop are skipped when "/proc/slabinfo" is
unreadable due to permissions. This commit provides the same check
for vmstat under its -m (slabinfo) option.
Craig Small [Fri, 13 Jan 2012 12:59:26 +0000 (23:59 +1100)]
sysctl -p has no space
The man page has examples like sysctl -p filename. Optional arguments
using getopt cannot have a space between the option and argument.
So the correct format is sysctl -pfilename
Craig Small [Mon, 9 Jan 2012 10:57:44 +0000 (21:57 +1100)]
Linux version for non-linux systems
On non-linux systems, uts.version provides the version of that
specific kernel (FreeBSD or Hurd version, for example) and not the
emulated procfs pseudo version.
On those systems we need to directly read /proc/version and parse the
string. This change replaces Debian patches gnu-kbsd-version and
complain_unmounted_proc patches.
Craig Small [Mon, 9 Jan 2012 10:44:51 +0000 (21:44 +1100)]
Change restrict to __restrict in public includes
procps automake defines restrict which means the binaries for procps
binaries compile. However external programs may not of defined
restrict which means they will not complie if they include files found
in /usr/include/proc.
Includes from libc6 use __restrict and if is good enough for
them, its good enough for us.
Craig Small [Mon, 9 Jan 2012 10:40:53 +0000 (21:40 +1100)]
watch needs a conditonal LDADD
Makes Debian patch makefile_watch_ncurses redundant.
watch was being linked to NCURSES_LIBS when it should of been
WATCH_NCURSES_LIBS which can be ncursesw with 8bit enabled.
Sami Kerola [Sun, 8 Jan 2012 21:09:50 +0000 (22:09 +0100)]
build-sys: use dist-xz
Even as conservative project as coreutils has switched to xz distributions so
neither should we have any reason to use gz and waste space & bandwidth.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 7 Jan 2012 23:05:05 +0000 (00:05 +0100)]
other: indent FAQ file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 7 Jan 2012 22:57:07 +0000 (23:57 +0100)]
other: update CodingStyle
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 7 Jan 2012 17:14:35 +0000 (18:14 +0100)]
other: update BUGS file
Change information submission address to be procps@freelists.org and
instruct people to send patches in 'git am' friendly format.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 7 Jan 2012 17:02:41 +0000 (18:02 +0100)]
other: update TODO
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 7 Jan 2012 16:57:07 +0000 (17:57 +0100)]
other: move files to Documentation/ directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sat, 7 Jan 2012 16:51:22 +0000 (17:51 +0100)]
build-sys: use git version as package version
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Mon, 26 Dec 2011 18:07:41 +0000 (19:07 +0100)]
w: indicate unknown host when -f is used
The option -f used too print `-' to FROM column when host was not
known. This commit changes behaviour back to what it was earlier.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Mon, 26 Dec 2011 17:42:05 +0000 (18:42 +0100)]
pwdx: re-create invalid process id check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Craig Small [Fri, 6 Jan 2012 05:48:09 +0000 (16:48 +1100)]
Updated NEWS with new items for procps-ng 3.3.2
Sami Kerola [Thu, 5 Jan 2012 20:27:15 +0000 (21:27 +0100)]
docs: add preload paths to sysctl.conf.5
The patch also has other maintenance fixes, such as man header fixes,
high lighting corrections and add bug report address.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Thu, 5 Jan 2012 19:11:34 +0000 (20:11 +0100)]
docs: clarify slabtop sort criteria listing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Thu, 5 Jan 2012 18:39:41 +0000 (19:39 +0100)]
slabtop: total slabs & caches header fix
Commit
0ac63f5bc173b09fc41fbab8776025d18621b93e messed up header
print order; the Total Slabs and Total Caches where reported in place
of each other.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Thu, 5 Jan 2012 11:23:46 +0000 (12:23 +0100)]
docs: watch manual update about -e option behaviour change
Relates to: commit
7ac61b3fa112e242bb5d52bac35ad82fb5f85f11
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
Sami Kerola [Thu, 5 Jan 2012 11:11:04 +0000 (12:11 +0100)]
ps: corrections to messages
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
Sami Kerola [Thu, 5 Jan 2012 08:36:12 +0000 (09:36 +0100)]
pgrep: correction to usage output
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
Jim Warner [Wed, 4 Jan 2012 20:10:09 +0000 (14:10 -0600)]
watch: correct differences option, eliminate duplicate help text
Sami Kerola [Wed, 4 Jan 2012 19:11:33 +0000 (20:11 +0100)]
watch: halt screen at exit on error
This change allows user to see what was the last message before exit
on error, and when where the last update.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Wed, 4 Jan 2012 18:23:19 +0000 (19:23 +0100)]
watch: include strutils.h
Without the header strtod_or_err() returned random value.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Jim Warner [Wed, 4 Jan 2012 13:53:35 +0000 (07:53 -0600)]
ps: change PACKAGE_BUGREPORT to procps@freelists.org
Jim Warner [Wed, 4 Jan 2012 13:11:53 +0000 (07:11 -0600)]
ps: update url for BUILD_WITH_WHINE error message
Jim Warner [Wed, 4 Jan 2012 14:05:58 +0000 (08:05 -0600)]
top: add PACKAGE and LOCALEDIR to ATEOJ_RPTSTD output
Craig Small [Wed, 4 Jan 2012 22:37:58 +0000 (09:37 +1100)]
For free -b make the variable a long long
Bug-Debian: http://bugs.debian.org/654368
On systems with very large amonut of RAM when they use the -b or --bytes
option on free you get overflow and free shows a negative amount of
memory, which is obviously wrong.
Craig Small [Tue, 3 Jan 2012 23:07:31 +0000 (10:07 +1100)]
Check for 0 repeat count and tests in free
free checks for -c 0 now too.
testsuite has new checks for the checks.
Craig Small [Tue, 3 Jan 2012 22:53:51 +0000 (09:53 +1100)]
free -c option uses strutils
The handling of the -c (count) option in free uses the standard string
handling and error utils. The program also checks for negative counts
and errors on these.