]> granicus.if.org Git - procps-ng/log
procps-ng
9 years agowatch: treat <ESC>[m as <ESC>[0m
Jaromir Capik [Wed, 25 Feb 2015 17:40:53 +0000 (18:40 +0100)]
watch: treat <ESC>[m as <ESC>[0m

Known terminals call reset in case of empty ANSI sequence.
We should do the same, even when this is not defined by the
ANSI standard.

9 years agoUpdated translations
Craig Small [Sat, 24 Jan 2015 08:09:33 +0000 (19:09 +1100)]
Updated translations

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agopmap: print process even if smaps unreadable
Craig Small [Sat, 24 Jan 2015 07:53:29 +0000 (18:53 +1100)]
pmap: print process even if smaps unreadable

pmap would previously print the process name if
/proc/PID/smaps could be opened, even if subsequent
reads failed.  This actually occurs with other users
PIDs.

Kernel 3.18rc1 introduced a change where the file could
not been opened, meaning pmap -X 1 previously showed
the process name and nothing else but NOW shows nothing
make check failed because of this.

This change prints the process name even before trying to open
the file, returning it to previous behaviour.
Thanks to Vincent Bernat for some analysis.

References:
  https://bugs.debian.org/775624
  https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=29a40ace841cba9b661711f042d1821cdc4ad47c

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years ago'slabtop -o' with stdin not a tty would complain
Derek Fawcus [Thu, 15 Jan 2015 13:14:53 +0000 (13:14 +0000)]
'slabtop -o' with stdin not a tty would complain

When the command is executed in one shot mode (-o) with stdin
being something other than a terminal,  the tcgetattr() call
would fail,  and generate an error message. e.g.:

slabtop: terminal setting retrieval: Inappropriate ioctl for device
 Active / Total Objects (% used)    : 905319 / 915886 (98.8%)

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agoskill: fix command line with signal
Craig Small [Sat, 24 Jan 2015 06:11:11 +0000 (17:11 +1100)]
skill: fix command line with signal

If skill was used with a signal number then it would intepret
the command line with last option interpreted twice. This often
confused the program so it just would end up killing nothing.
So this would work:
skill -t pts/0
This would not:
skill -9 -t pts/0

The kill path (in the same file) uses the same logic that has
been introduced here.

References: https://www.freelists.org/post/procps/skill-command-does-not-work-in-debian-7-releases

Signed-off-by: Craig Small <csmall@enc.com.au>
10 years agoUpdate NEWS with merge 33
Craig Small [Wed, 3 Dec 2014 11:41:17 +0000 (22:41 +1100)]
Update NEWS with merge 33

Signed-off-by: Craig Small <csmall@enc.com.au>
10 years agoMerge commit 'refs/merge-requests/33' of git://gitorious.org/procps/procps into merge...
Craig Small [Sat, 8 Nov 2014 06:03:51 +0000 (17:03 +1100)]
Merge commit 'refs/merge-requests/33' of git://gitorious.org/procps/procps into merge-requests/33

10 years agodocs: adding latest french man translations
Jaromir Capik [Thu, 30 Oct 2014 15:49:10 +0000 (16:49 +0100)]
docs: adding latest french man translations

10 years agotop: tweak forest view protections for forking anomaly
Jim Warner [Tue, 28 Oct 2014 05:00:00 +0000 (00:00 -0500)]
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 ce70017eb1927be51f73cbe0a0b4babcc502607e

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agotop: provide some protection against forking anomalies
Jim Warner [Thu, 23 Oct 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agotop: ensure previously saved rcfile honored completely
Jim Warner [Sun, 28 Sep 2014 05:00:00 +0000 (00:00 -0500)]
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 8ef6cd91fc5df6372a93bc4a37cbad34ead9654e

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agodocs: adding latest man translations v3.3.10
Jaromir Capik [Tue, 23 Sep 2014 11:40:36 +0000 (13:40 +0200)]
docs: adding latest man translations

10 years agodocs: Fix typos in slabtop.1, sysctl.8 and uptime.1
Yuri Chornoivan [Tue, 16 Sep 2014 05:51:13 +0000 (08:51 +0300)]
docs: Fix typos in slabtop.1, sysctl.8 and uptime.1

10 years agobuild-sys: removing translated mans from Makefile.am
Jaromir Capik [Mon, 15 Sep 2014 17:55:13 +0000 (19:55 +0200)]
build-sys: removing translated mans from Makefile.am

The previous commit didn't work like expected.
It's better to call 'make translate-mans'
manually prior calling 'make dist'.

10 years agodocs: Committing new translations
Jaromir Capik [Mon, 15 Sep 2014 17:04:47 +0000 (19:04 +0200)]
docs: Committing new translations

10 years agobuild-sys: adding translated mans to dist
Jaromir Capik [Mon, 15 Sep 2014 16:57:40 +0000 (18:57 +0200)]
build-sys: adding translated mans to dist

10 years agodocs: Fix typos in sysctl.8 and sysctl.conf.5
Yuri Chornoivan [Sat, 13 Sep 2014 18:02:45 +0000 (21:02 +0300)]
docs: Fix typos in sysctl.8 and sysctl.conf.5

10 years agoconfigure.ac: re-enabling the ALL_LINGUAS related checks
Jaromir Capik [Mon, 15 Sep 2014 13:30:08 +0000 (15:30 +0200)]
configure.ac: re-enabling the ALL_LINGUAS related checks

10 years agoAdd translated mans to tarball
Craig Small [Fri, 12 Sep 2014 13:04:33 +0000 (23:04 +1000)]
Add translated mans to tarball

The source tarball now includes translated man pages and the
man-po po files.

Signed-off-by: Craig Small <csmall@enc.com.au>
10 years agowatch: typo in man (closign->closing)
Jaromir Capik [Fri, 12 Sep 2014 12:22:48 +0000 (14:22 +0200)]
watch: typo in man (closign->closing)

10 years agoMerge remote-tracking branch 'refs/remotes/origin/master'
Craig Small [Wed, 10 Sep 2014 11:21:26 +0000 (21:21 +1000)]
Merge remote-tracking branch 'refs/remotes/origin/master'

10 years agoman pot files added to dist
Craig Small [Wed, 10 Sep 2014 11:19:24 +0000 (21:19 +1000)]
man pot files added to dist

The dist tarball was missing the man-po/*.pot files. This change adds
them to the extra_dist target so they are in the distribution tarball.

10 years ago3.3.10 API
Jaromir Capik [Tue, 9 Sep 2014 16:35:44 +0000 (18:35 +0200)]
3.3.10 API

10 years agoNEWS: adding enhanced ANSI support in watch
Jaromir Capik [Tue, 9 Sep 2014 16:13:23 +0000 (18:13 +0200)]
NEWS: adding enhanced ANSI support in watch

10 years agowatch: avoid ansi manipulations in non-ansi mode
Jaromir Capik [Mon, 8 Sep 2014 16:28:08 +0000 (18:28 +0200)]
watch: avoid ansi manipulations in non-ansi mode

10 years agowatch: fixing uninitialized variable
Jaromir Capik [Mon, 8 Sep 2014 16:24:28 +0000 (18:24 +0200)]
watch: fixing uninitialized variable

10 years agowatch: fixing default color handling
Jaromir Capik [Mon, 8 Sep 2014 13:50:24 +0000 (15:50 +0200)]
watch: fixing default color handling

Previously the default background color was expected
to be always black and the default foreground color
was expected to be always white. This commit extends
the group of color pairs with pairs containing default
colors.

10 years agowatch: fixing future italic support
Jaromir Capik [Sat, 6 Sep 2014 08:54:34 +0000 (10:54 +0200)]
watch: fixing future italic support

10 years agowatch: enhancing ANSI color & style support
Jaromir Capik [Sat, 6 Sep 2014 08:46:27 +0000 (10:46 +0200)]
watch: enhancing ANSI color & style support

This commit adds support for background colors
and additional ANSI styles (faint, italic,
underlined, blinking, inversed).

10 years agopgrep: avoid SEGV when lightweight and list-full options are used together
Eero Häkkinen [Fri, 5 Sep 2014 21:35:16 +0000 (00:35 +0300)]
pgrep: avoid SEGV when lightweight and list-full options are used together
do not segfault

10 years agoAdd french and polish translation
Craig Small [Thu, 4 Sep 2014 11:22:20 +0000 (21:22 +1000)]
Add french and polish translation

10 years agoignore config.cache
Mike Frysinger [Thu, 28 Aug 2014 01:35:24 +0000 (21:35 -0400)]
ignore config.cache

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
10 years agosysctl: finalizing the GLOB_* flags check
Jaromir Capik [Thu, 28 Aug 2014 13:48:29 +0000 (15:48 +0200)]
sysctl: finalizing the GLOB_* flags check

This commit properly resolves the merge conflict
caused by the following two commits:
fb6d4e6cb42ffacfbe300021f062b5057ba7015d
f8128568d671d2c07b7d2faf0bc399fb9b7bd69e

10 years agoSupport libc's without GLOB_TILDE
Michael Forney [Tue, 1 Oct 2013 05:34:36 +0000 (05:34 +0000)]
Support libc's without GLOB_TILDE

GLOB_TILDE is a GNU extension and may not be present on all systems.

Note (jcapik): The original patch from Michael Forney didn't
apply cleanly due to my recent addition of the GLOB_BRACE flag
in the list of flags. I had to edit the patch to make it apply,
but that produces an inconsistent state. It's gonna be fixed
in the next commit.

10 years agoAlso emulate error_at_line if not present
Michael Forney [Tue, 1 Oct 2013 05:44:46 +0000 (05:44 +0000)]
Also emulate error_at_line if not present

10 years agoHandle 'none required' result from AC_SEARCH_LIBS
Michael Forney [Tue, 1 Oct 2013 02:36:58 +0000 (02:36 +0000)]
Handle 'none required' result from AC_SEARCH_LIBS

10 years agotload: fix lockup
Jim Brown IV [Sat, 7 Jun 2014 00:31:02 +0000 (17:31 -0700)]
tload: fix lockup

It looks like an off by one error was added to tload a couple years
ago while removing goto statements.  This causes tload to go into
an endless loop when the load is just under a scale change integer.
eg: .99, 1.99, 3.99, 7.99

to reproduce you can add, just under the loadavg at line 170 in tload.c:
av[0] = 1.99;

or get the load to that level separately.

The patch below makes the code more like the original, but without the
goto statements.  This can also be fixed by just changing line 183 in
tload.c from "if (0 < row)" -> "if (0 <= row)".

10 years agoUse <dirent.h> instead of <sys/dir.h>
Fredrik Fornwall [Sun, 6 Jul 2014 14:21:01 +0000 (16:21 +0200)]
Use <dirent.h> instead of <sys/dir.h>

Using <dirent.h> and struct dirent instead of <sys/dir.h> and struct direct
is preferred and works on Android which lacks sys/dir.h.

See:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/dirent.h.html

10 years agolibrary: fixing stdio.h include position in nsutils.c
Jaromir Capik [Tue, 26 Aug 2014 13:24:55 +0000 (15:24 +0200)]
library: fixing stdio.h include position in nsutils.c

The previous commit removes the stdio_ext.h header,
but the ns_read function calls snprintf that needs
stdio.h and therefore moving the stdio.h include
from the bottom test program to the top line.

10 years agolibrary: remove unused includes in nsutils.c
Fredrik Fornwall [Sun, 6 Jul 2014 14:10:34 +0000 (16:10 +0200)]
library: remove unused includes in nsutils.c

The <stdio_ext.h> include breaks building on platforms without that header and is unused in nsutils.c.

Also remove unused but harmless <error.h> include.

10 years agowatch: fixing uninitialized endptr in the previous commit
Jaromir Capik [Wed, 20 Aug 2014 17:14:13 +0000 (19:14 +0200)]
watch: fixing uninitialized endptr in the previous commit

And increasing the ANSI buffer size from 10 to 100.

10 years agowatch: Fix handling of ANSI color escapes for -c
Sean Silva [Fri, 18 Oct 2013 06:04:15 +0000 (02:04 -0400)]
watch: Fix handling of ANSI color escapes for -c

The previous code assumed that there would be 1 or 2 attributes to
apply. In fact, there can in general be any number (but typically
between 1 and 3). This commit generalizes the existing code to read
arbitrarily many attributes from the escape sequence.

10 years agofree: fixing the layout broken with the -w introduction
Jaromir Capik [Wed, 20 Aug 2014 11:21:22 +0000 (13:21 +0200)]
free: fixing the layout broken with the -w introduction

For some reason I thought the columns are left justified
and consequently modified the header incorrectly when
implementing the -w/--wide feature.
With this commit the column width was increased by 1
so that the default layout is 79 characters wide
and allows to display 11 digits per column.

10 years agoAdd -a/--list-full to --help output.
Beni Cherniavsky-Paskin [Tue, 12 Aug 2014 16:32:51 +0000 (19:32 +0300)]
Add -a/--list-full to --help output.

10 years agopmap: avoid depending on an uninitialised value.
Adam Sampson [Wed, 30 Apr 2014 13:20:21 +0000 (14:20 +0100)]
pmap: avoid depending on an uninitialised value.

It's possible for the first entry that this reads from /proc/*/smaps to
start with a map_desc-less line like this:

7fa71b77d000-7fa71c288000 rw-p 00000000 00:00 0

in which case sscanf will only read up to inode, and it won't set c; the
code below would then incorrectly discard the next ("Size:") line.

(With GCC 4.9.0, this bug causes the "pmap extra extended output" test
to fail for me.)

10 years agoUpdate free testsuite
Craig Small [Tue, 19 Aug 2014 12:43:33 +0000 (22:43 +1000)]
Update free testsuite

free got a makeover to suit the newer kernel memory management.
This commit updates the tests to follow the new output for free

Signed-off-by: Craig Small <csmall@enc.com.au>
10 years agotop: final tweak to recent changes for new graph modes
Jim Warner [Fri, 8 Aug 2014 16:59:59 +0000 (11:59 -0500)]
top: final tweak to recent changes for new graph modes

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agoNEWS: add a few more for the release 3.3.10 change log
Jim Warner [Thu, 7 Aug 2014 05:00:00 +0000 (00:00 -0500)]
NEWS: add a few more for the release 3.3.10 change log

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agotop: swat a potential buglet affecting new graph modes
Jim Warner [Thu, 7 Aug 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agomisc: result after checking all files for misspellings
Jim Warner [Wed, 6 Aug 2014 05:00:00 +0000 (00:00 -0500)]
misc: result after checking all files for misspellings

Reference(s):
https://github.com/lyda/misspell-check.git

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agotop: replace <values.h> with <limits.h> plus <float.h>
Fredrik Fornwall [Fri, 1 Aug 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agolibrary: increasing meminfo()/namebuf size from 16 to 32
Jaromir Capik [Tue, 5 Aug 2014 17:15:03 +0000 (19:15 +0200)]
library: increasing meminfo()/namebuf size from 16 to 32

10 years agodocs: free.1 now follows the latest used/cache changes
Jaromir Capik [Thu, 31 Jul 2014 14:46:54 +0000 (16:46 +0200)]
docs: free.1 now follows the latest used/cache changes

10 years agofree: remove -/+ buffers/cache
Jaromir Capik [Tue, 29 Jul 2014 19:31:46 +0000 (21:31 +0200)]
free: remove -/+ buffers/cache

With introduction of the 'available' column
and with the latest changes in the 'used' evaluation
the -/+ buffers/cache line became redundant.
The first value duplicates the 'used'
column and the second value has a more accurate
brother called 'available'.

10 years agofree: replace -a/--available with -w/--wide
Jaromir Capik [Tue, 29 Jul 2014 19:23:19 +0000 (21:23 +0200)]
free: replace -a/--available with -w/--wide

This renames the --available switch
to the --wide switch and changes the default
layout so that it includes the 'available'
column and joins buffers and cache into
a common column called 'buff/cache'.

10 years agotop: adapt global memory support to new library format
Jim Warner [Wed, 30 Jul 2014 05:00:00 +0000 (00:00 -0500)]
top: adapt global memory support to new library format

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agolibrary: cached += slabs, used -= cached + buffers
Jaromir Capik [Tue, 29 Jul 2014 19:09:07 +0000 (21:09 +0200)]
library: cached += slabs, used -= cached + buffers

From now we include slabs in cached
and exclude buffers and cached from used.

10 years agolibrary: MemAvailable fallback now uses /proc/meminfo
Jaromir Capik [Tue, 29 Jul 2014 18:56:20 +0000 (20:56 +0200)]
library: MemAvailable fallback now uses /proc/meminfo

Taking the values from /proc/vmstat was unnecessary
and prone to race conditions.

10 years agolibrary: use LINUX_VERSION macro in the MemAvailable fallback
Jaromir Capik [Tue, 22 Jul 2014 16:18:51 +0000 (18:18 +0200)]
library: use LINUX_VERSION macro in the MemAvailable fallback

10 years agotop: exclude reclaimable slabs from used
Jaromir Capik [Tue, 22 Jul 2014 12:07:45 +0000 (14:07 +0200)]
top: exclude reclaimable slabs from used

10 years agolibrary: fix kb_slab_*reclaimable names and export both
Jaromir Capik [Tue, 22 Jul 2014 11:52:11 +0000 (13:52 +0200)]
library: fix kb_slab_*reclaimable names and export both

10 years agolibrary: evolve MenAvailable algorithm on older kernel
Jim Warner [Sat, 19 Jul 2014 09:44:44 +0000 (04:44 -0500)]
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>
10 years agotop: correct one grammatical error in the man document
Jim Warner [Fri, 18 Jul 2014 13:55:08 +0000 (08:55 -0500)]
top: correct one grammatical error in the man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agotop: exploit new kb_main_available, make Jaromir happy
Jim Warner [Thu, 17 Jul 2014 18:13:13 +0000 (13:13 -0500)]
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>
10 years agotop: trade Page_size for that newly exposed page_bytes
Jim Warner [Thu, 17 Jul 2014 17:12:12 +0000 (12:12 -0500)]
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>
10 years agolibrary: tweak newly added MemAvailable fall-back code
Jim Warner [Thu, 17 Jul 2014 16:11:11 +0000 (11:11 -0500)]
library: tweak newly added MemAvailable fall-back code

This commit just ensures recalculation of some amounts
for iterative processes, like top. It also trades some
repeated runtime calls to sysconf for a one time cost.

Reference(s):
http://www.freelists.org/post/procps/systemd-support-to-library,7
. fall-back calculations
commit b779855cf15d68f9038ff1809db18c0788e9ae70

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agodocs: with systemd now in library, remember openproc.3
Jim Warner [Thu, 17 Jul 2014 15:10:10 +0000 (10:10 -0500)]
docs: with systemd now in library, remember openproc.3

[ plus remove just a little darn trailing whitespace ]

Reference(s):
. systemd migrated to library
commit 9d8ad6419f9f16978b7e9e769b7acb085f317058
. added library documentation
commit a74fb8fade82ad624703bb1bc7395cf0aacaeaa9

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agodocs: Add the 'MemAvailable' availability in free.1
Jaromir Capik [Thu, 17 Jul 2014 15:02:27 +0000 (17:02 +0200)]
docs: Add the 'MemAvailable' availability in free.1

10 years agolibrary: disable a potential 'ELF note' is missing msg
Jim Warner [Wed, 16 Jul 2014 05:00:00 +0000 (00:00 -0500)]
library: disable a potential 'ELF note' is missing msg

The stderr message regarding ELF notes appears on some
systems (openSUSE-13.1 for example) but I have not yet
isolated why. Since at startup we go on to determine a
Hertz value the old fashion way, this patch just turns
off the useless message until the cause is understood.

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agops: exploit library systemd support vs. internal logic
Jim Warner [Sat, 28 Jun 2014 05:00:33 +0000 (00:00 -0500)]
ps: exploit library systemd support vs. internal logic

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agolibrary: generalize then add former 'ps' systemd logic
Jim Warner [Sat, 28 Jun 2014 05:00:22 +0000 (00:00 -0500)]
library: generalize then add former 'ps' systemd logic

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agops: clarify which options depend on systemd in man doc
Jim Warner [Sat, 28 Jun 2014 05:00:11 +0000 (00:00 -0500)]
ps: clarify which options depend on systemd in man doc

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agodocs: top.1 minor fix
Jaromir Capik [Thu, 17 Jul 2014 11:08:29 +0000 (13:08 +0200)]
docs: top.1 minor fix

RES - memory task has used -> is using

10 years agosysctl: support expansion of csh style braces with -p
Jaromir Capik [Wed, 16 Jul 2014 12:29:42 +0000 (14:29 +0200)]
sysctl: support expansion of csh style braces with -p

This commit adds the GLOB_BRACE flag in the glob flags.
That allows to expand the csh style braces {a,b} and
define multiple independent patterns for config file
locations.

10 years agolibrary: fallback MemAvailable evaluation if missing
Jaromir Capik [Tue, 15 Jul 2014 17:17:02 +0000 (19:17 +0200)]
library: fallback MemAvailable evaluation if missing

This commit adds support for fallback calculation
of the MemAvailable field if not exported by the
kernel. The MemAvailable field appeared in kernel
3.14, but it's possible to calculate it from other
fields since 2.6.27 (splitLRU changes).

10 years agolibrary: additional comments to the buffer size increase
Jaromir Capik [Mon, 14 Jul 2014 17:44:14 +0000 (19:44 +0200)]
library: additional comments to the buffer size increase

10 years agolibrary: fixing buffer sizes in sysinfo.c
Jaromir Capik [Mon, 14 Jul 2014 17:07:25 +0000 (19:07 +0200)]
library: fixing buffer sizes in sysinfo.c

10 years agolibrary: changing P_G_SZ from 20 to 33
Jaromir Capik [Mon, 14 Jul 2014 14:21:52 +0000 (16:21 +0200)]
library: changing P_G_SZ from 20 to 33

Nowadays the usernames can be 32 characters long
(typically OpenShift usernames use the whole length)
and the old limit was preventing us from processing
them correctly.
The macro change affects the proc_t structure size.

10 years agolibrary: removing note about PROC_{PID,UID} being obsolete
Jaromir Capik [Mon, 14 Jul 2014 14:12:53 +0000 (16:12 +0200)]
library: removing note about PROC_{PID,UID} being obsolete

10 years agodocs: adding openproc(), readproc() and readproctab() man
Jaromir Capik [Mon, 14 Jul 2014 14:07:23 +0000 (16:07 +0200)]
docs: adding openproc(), readproc() and readproctab() man

10 years agofree: support for MemAvailable
Jaromir Capik [Fri, 11 Jul 2014 20:34:06 +0000 (22:34 +0200)]
free: support for MemAvailable

This commit adds a new switch -a/--available that
appends a new column called 'available' to the
output. The column displays an estimation
of how much memory is available for starting
new applications, without swapping. Unlike the data
provided by the 'cached' or 'free' fields, this
field takes into account page cache and also that
not all reclaimable memory slabs will be reclaimed
due to items being in use.

10 years agops: add -q/q/--quick-pid option
Jaromir Capik [Thu, 10 Jul 2014 19:14:02 +0000 (21:14 +0200)]
ps: add -q/q/--quick-pid option

This commit introduces a new option q/-q/--quick-pid
to the 'ps' command. The option does a similar job
to the p/-p/--pid option (i.e. selection of PIDs
listed in the comma separated list that follows
the option), but the new option is optimized
for speed.
In cases where users only need to specify a list
of PIDs to be shown and don't need other selection
options, forest type output and sorting options,
the new option is recommended as it decreases
the initial processing delay by avoiding reading
the necessary information from all the processes
running on the system and by simplifying
the internal filtering logic.

10 years agotop: fix potential 'nan', should a system have no Swap
Jim Warner [Fri, 4 Jul 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agotop: as with ps, distinguish between 'T' and 't' state
Jim Warner [Thu, 3 Jul 2014 05:00:00 +0000 (00:00 -0500)]
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 411d218793af1f7ef6db37b319c1b08a7ca7c9b8

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agotop: add another translation hint for graphs alignment
Jim Warner [Wed, 2 Jul 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agotop: with new startup defaults, tweak the man document
Jim Warner [Tue, 1 Jul 2014 05:00:00 +0000 (00:00 -0500)]
top: with new startup defaults, tweak the man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agotop: eliminated unreferenced macros & an error message
Jim Warner [Mon, 30 Jun 2014 05:00:00 +0000 (00:00 -0500)]
top: eliminated unreferenced macros & an error message

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agopgrep: Fixing regression in exitcodes
Jaromir Capik [Wed, 2 Jul 2014 15:42:08 +0000 (17:42 +0200)]
pgrep: Fixing regression in exitcodes

The pgrep usage() rework commit from 26-Sep-2011 introduced
a regression in exitcodes and the pgrep tool now returns
EXIT_FAILURE (1) or even EXIT_SUCCESS (0) instead
of the documented EXIT_USAGE (2). This commit fixes
the usage() so that the exitcodes match the manual.

10 years agodocs: distinguish between T/t in the ps.1 manual
Jaromir Capik [Wed, 2 Jul 2014 14:23:30 +0000 (16:23 +0200)]
docs: distinguish between T/t in the ps.1 manual

10 years agoAdded polish translation
Craig Small [Tue, 1 Jul 2014 11:48:27 +0000 (21:48 +1000)]
Added polish translation

10 years agotop: retire old stale startup defaults in favor of new
Jim Warner [Sun, 29 Jun 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agotop: maximize recent locale aware numeric enhancements
Jim Warner [Sat, 28 Jun 2014 05:00:00 +0000 (00:00 -0500)]
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 f7b84f45c7ae99c276de9954fc16cdc4ff7f36f0
http://www.freelists.org/post/procps/topwatch-floating-point-input,2

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agoReliably kill test processes
Craig Small [Tue, 1 Jul 2014 08:51:21 +0000 (18:51 +1000)]
Reliably kill test processes

It seems command -v also includes built-ins so checking for kill
is useless because it finds the built-in and those machines or
environments that have no /bin/kill fail at the check stage.
Oh and then TCL exec doesn't spawn a shell.

After reading way too many TCL websites, I believe this should
fix the problem. TCL quoting is... different to say the least but
it works reliably here. The script now even picked up a typo elsewhere
which was nice.

This change should stop the intermittent FTBFS bugs from the Debian
pbuilders, I hope! You'd think kill $var wouldn't be this difficult.

10 years agotop: afford each window its own cpu/memory graph modes
Jim Warner [Fri, 27 Jun 2014 05:00:00 +0000 (00:00 -0500)]
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 1d171ec74163f3103e7b230ee63818df04b4526f

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agotop: fix translation hint to preserve graphs alignment
Jim Warner [Thu, 26 Jun 2014 05:00:00 +0000 (00:00 -0500)]
top: fix translation hint to preserve graphs alignment

Signed-off-by: Jim Warner <james.warner@comcast.net>
10 years agoManpage translations in Makefiles
Craig Small [Sat, 28 Jun 2014 13:38:13 +0000 (23:38 +1000)]
Manpage translations in Makefiles

The translated manpage generation has moved from scripts to
Makefiles. This asists with conditional building as well, no
need to regenerate the German pgrep man page if both
the original pgrep.1 and man-po/de.po is not changed.

My Makefile-fu fails me on producing a cross-product or double
iteration for languages and man pages. Until that is solved
each man page is explicitly built. No big deal but it doesn't
look elegant in the Makefile. Languages will be picked
up automatically if they are found in man-po, man-po/top or
man-po/ps

The README describes the three-step process for translating
the files, incase I forget or someone else wants to update them.

10 years agoMoved man-po pot file creation into Makefile
Craig Small [Wed, 25 Jun 2014 13:11:15 +0000 (23:11 +1000)]
Moved man-po pot file creation into Makefile

The pot files for man-po are part of the extra_dist target so are
built at dist time. These used to be created as part of the dist-hook.
However it is better to control their builds in the Makefile so they
are conditionally built. It also means distcheck doesn't complain when
they are added to the CLEANFILES.

10 years agotop: tweak argument parsing for some locale situations
Jim Warner [Wed, 25 Jun 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agotop: let's not pretend top can catch SIGKILL & SIGSTOP
Jim Warner [Tue, 24 Jun 2014 05:00:00 +0000 (00:00 -0500)]
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>
10 years agoFix some man-po stuff for distcheck
Craig Small [Tue, 24 Jun 2014 12:20:13 +0000 (22:20 +1000)]
Fix some man-po stuff for distcheck

distcheck failed because the man-po scripts weren't sourcing or
escaping the directories correctly.

This is a partial fix, but at least distcheck is happy.