]> granicus.if.org Git - procps-ng/log
procps-ng
12 years agosysctl: deprecate parameters
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>
12 years agodocs: inform about pkill and --inverse option
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>
12 years agoMerge remote-tracking branch 'sami/2012wk6'
Craig Small [Sun, 12 Feb 2012 10:56:05 +0000 (21:56 +1100)]
Merge remote-tracking branch 'sami/2012wk6'

12 years agotop: extend the Copyright (c) dates to include 2012
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>
12 years agotop: reorganize some fields management logic
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>
12 years agotop: standardize names of all 'helper' functions
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>
12 years agotop: use CPU_ZEROTICS to embrace the Nehalem logic
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

12 years agotop: postpone the switch from Kb to Mb in summary display
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>
12 years agolibprocps: remove linux 2.7.0 check
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>
12 years agowatch: inform about optional argument for -d switch
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>
12 years agopkill: remove -v match inversion option
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>
12 years agopgrep: allow signal definition to be anywhere in command line
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>
12 years agopgrep: use c style comments
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>
12 years agostrutils: reindent the file
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>
12 years agoskill: fix argument parsing regression
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>
12 years agotests: fix dejagnu pwdx and vmstat checks
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>
12 years agotop: fixup logic for Nehalem cpu 'idle' threshold
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

12 years agotop: reduce use of 'clear_screen' to absolute minimum
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

12 years agotop: tweak the new 'reduce % CPU distortions' algorithm
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.

12 years agotop: reduce % CPU distortions when a core was turned off
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

12 years agotop: tolerate loss of smp cpus, improve CPU_t management
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>.

12 years agotop: treat additional keys like the find_string() keys
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.

12 years agotop: improve USE_X_COLHDR effect when colors toggled off
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

12 years agotop: properly handle an improper $HOME environment variable
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.

12 years agolibprocps: open file should be closed, not freed
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>
12 years agovmstat: open file should be closed, not freed
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>
12 years agopmap: ensure arg1 is not null, and set qualifers to match with usage [smatch scan]
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>
12 years agopgrep: fix potential null derefences [smatch scan]
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>
12 years agosysctl: fix potential null derefence [smatch scan]
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>
12 years agoskill: ensure optarg is not null [smatch scan]
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>
12 years agowatch: remove unreachable code
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>
12 years agopwdx: free memory before exit
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>
12 years agosysctl: fix coding style
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>
12 years agodocs: add to pgrep.1 count return value information
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>
12 years agodocs: remove tcp_default_win_scale from sysctl.conf sample
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>
12 years agolibprocps: hide private symbols
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>
12 years agoMerge remote-tracking branch 'sami/vapier'
Craig Small [Tue, 24 Jan 2012 11:36:28 +0000 (22:36 +1100)]
Merge remote-tracking branch 'sami/vapier'

12 years agops: include error.h
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>
12 years agoproc: pull in ctype.h where needed
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>
12 years agouse helpers from c.h
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>
12 years agowatch: include sys/wait.h for waitpid
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>
12 years agoinclude error.h for error() and friends
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>
12 years agoskill: exclude debugging strings from nls
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>
12 years agotload: remove unnecessary goto
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>
12 years agodocs: aligh top.1 header with other procps-ng utils
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>
12 years agodocs: add exit values to watch.1
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>
12 years agotload: check write() return value
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>
12 years agopkill: enable displaying what is killed
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>
12 years agopgrep: fix compiler warning
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>
12 years agopkill: fix error printing
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>
12 years agops: unify cases and remove trailing dots in messages
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>
12 years agoother: make AUTHORS file obsolete
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>
12 years agodocs: remove old information from HACKING
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>
12 years agops: add catastrophic_failure()
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>
12 years agoother: tell in ChangeLog where to see changes
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>
12 years agotop: avoid %cpu distortions when toggling task/thread modes
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

12 years agotop: force newline for unexpected signal abnormal exit
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.

12 years agovmstat: slabinfo (-m option) test disabled if not readable
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.

12 years agosysctl -p has no space
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

12 years agoLinux version for non-linux systems
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.

12 years agoChange restrict to __restrict in public includes
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.

12 years agowatch needs a conditonal LDADD
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.

12 years agobuild-sys: use dist-xz
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>
12 years agoother: indent FAQ file
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>
12 years agoother: update CodingStyle
Sami Kerola [Sat, 7 Jan 2012 22:57:07 +0000 (23:57 +0100)]
other: update CodingStyle

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoother: update BUGS file
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>
12 years agoother: update TODO
Sami Kerola [Sat, 7 Jan 2012 17:02:41 +0000 (18:02 +0100)]
other: update TODO

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 years agoother: move files to Documentation/ directory
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>
12 years agobuild-sys: use git version as package version
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>
12 years agow: indicate unknown host when -f is used
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>
12 years agopwdx: re-create invalid process id check
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>
13 years agoUpdated NEWS with new items for procps-ng 3.3.2 v3.3.2
Craig Small [Fri, 6 Jan 2012 05:48:09 +0000 (16:48 +1100)]
Updated NEWS with new items for procps-ng 3.3.2

13 years agodocs: add preload paths to sysctl.conf.5
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>
13 years agodocs: clarify slabtop sort criteria listing
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>
13 years agoslabtop: total slabs & caches header fix
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>
13 years agodocs: watch manual update about -e option behaviour change
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>
13 years agops: corrections to messages
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>
13 years agopgrep: correction to usage output
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>
13 years agowatch: correct differences option, eliminate duplicate help text
Jim Warner [Wed, 4 Jan 2012 20:10:09 +0000 (14:10 -0600)]
watch: correct differences option, eliminate duplicate help text

13 years agowatch: halt screen at exit on error
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>
13 years agowatch: include strutils.h
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>
13 years agops: change PACKAGE_BUGREPORT to procps@freelists.org
Jim Warner [Wed, 4 Jan 2012 13:53:35 +0000 (07:53 -0600)]
ps: change PACKAGE_BUGREPORT to procps@freelists.org

13 years agops: update url for BUILD_WITH_WHINE error message
Jim Warner [Wed, 4 Jan 2012 13:11:53 +0000 (07:11 -0600)]
ps: update url for BUILD_WITH_WHINE error message

13 years agotop: add PACKAGE and LOCALEDIR to ATEOJ_RPTSTD output
Jim Warner [Wed, 4 Jan 2012 14:05:58 +0000 (08:05 -0600)]
top: add PACKAGE and LOCALEDIR to ATEOJ_RPTSTD output

13 years agoFor free -b make the variable a long long
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.

13 years agoCheck for 0 repeat count and tests in free
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.

13 years agofree -c option uses strutils
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.

13 years agofixed e and x options in watch
Craig Small [Tue, 3 Jan 2012 22:18:16 +0000 (09:18 +1100)]
fixed e and x options in watch

The -e option would print a confusing error message. This is because
most error messages in watch are one word.  This fix makes a more
sensible message about what went wrong.

The -x option exited before the endwin() function was called, so if the
child process died the terminal was left in a funky state. endwin is now
called just before the exit(8) for the -x option.

13 years agobuild-sys: correct all Makefile.am files for LOCALEDIR, etc
Jim Warner [Mon, 2 Jan 2012 15:08:58 +0000 (09:08 -0600)]
build-sys: correct all Makefile.am files for LOCALEDIR, etc

Some of the latest changes to Makefile.am files are missing.

This patch restores the LOCALEDIR variable, among others,
and dispenses with the include directives in the ps/ and top/
subdirectories since they're no longer needed.

13 years agotop: update some programmer documentation (no logic, just comments)
Jim Warner [Thu, 29 Dec 2011 17:50:32 +0000 (11:50 -0600)]
top: update some programmer documentation (no logic, just comments)

This commit corrects some outdated programmer comments.

Additionally, certain nls justifications might become
increasingly obscure with the passage of time so some
previous nls commit text has been added as comments.

13 years agops: update man document for redesigned help provisions
Jim Warner [Fri, 30 Dec 2011 23:01:15 +0000 (17:01 -0600)]
ps: update man document for redesigned help provisions

13 years agops: generalize help text logic, add related translator hints
Jim Warner [Mon, 2 Jan 2012 07:33:34 +0000 (01:33 -0600)]
ps: generalize help text logic, add related translator hints

This commit represents an experiment in nls help text support.

The word --help itself been made translatable along with the
help section names and their abbreviations.  Thus, the work of
the translators will ultimately alter program run-time behavior.

Perhaps someday all "long" options can behave in a similar way
which could offer a considerable benefit to other languages.
Instead of translationg just option descriptions, the long
forms of those options could also be transalated.

This commit also:
 . includes the section abbreviations in --help output
 . isolates all --help support in the ps/help.c module
 . provides (hopefully) meaningful Translator guidance
 . removes --help support from the ps/common.h header
 . removes --help support from the ps/parser.c module
 . eliminates tabs in line with the style of other ps modules
 . eliminates the need for the include/c.h header file

13 years agops: exclude debugging only code from participation in nls support
Jim Warner [Mon, 7 Nov 2011 16:21:41 +0000 (10:21 -0600)]
ps: exclude debugging only code from participation in nls support

This commit is prmarily concerned with elimnating deugging only
code from the nls template file.

It also eliminates any remaing useless trailing whitespace.

13 years agops: minor reformatting and trailing whitespace elimination
Jim Warner [Tue, 27 Dec 2011 22:22:43 +0000 (16:22 -0600)]
ps: minor reformatting and trailing whitespace elimination

This patch mostly reorganizes include files and eliminates
some useless trailing whitespace.

It also adopts the standard procps-ng unconditional approach
to nls initialization.

13 years agops: trade cumbersome GNU attributes with less wordy alternatives
Jim Warner [Mon, 2 Jan 2012 07:26:45 +0000 (01:26 -0600)]
ps: trade cumbersome GNU attributes with less wordy alternatives

13 years agoChanged the err and warns to macros
Craig Small [Tue, 3 Jan 2012 07:48:43 +0000 (18:48 +1100)]
Changed the err and warns to macros

err and warn are BSD format but they are not recommended by library
developers.  However their consiseness is useful!

The solution is to use some macros that create xerr etc which then
just map to the error() function.  The next problem is error() uses
program_invocation_name so we set this to program_invovation_short_name

This is a global set but seems to be the convention (or at least errors
are on the short name only) used everywhere else.

13 years agoMade the c and nls include explicit
Craig Small [Mon, 2 Jan 2012 06:46:17 +0000 (17:46 +1100)]
Made the c and nls include explicit

These two includes need the path otherwise the make distcheck fails.
I suspect its actually a ps/Makefile.am problem

13 years agoUpdated testsuite files for new NLS output
Craig Small [Mon, 2 Jan 2012 06:39:41 +0000 (17:39 +1100)]
Updated testsuite files for new NLS output

13 years agotranslations: group usage texts
Sami Kerola [Tue, 27 Dec 2011 20:46:16 +0000 (21:46 +0100)]
translations: group usage texts

Reference: http://www.freelists.org/post/procps/backporting,5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
13 years agow: fix broken -o (old-style) short form option
Jim Warner [Wed, 28 Dec 2011 07:27:27 +0000 (01:27 -0600)]
w: fix broken -o (old-style) short form option