]> granicus.if.org Git - procps-ng/log
procps-ng
8 years agotop: provide for expanded potential displayable fields
Jim Warner [Sat, 30 Jul 2016 05:00:00 +0000 (00:00 -0500)]
top: provide for expanded potential displayable fields

This commit provides for raising the total displayable
fields from its current 70 to 86. It also bumps the id
in an rcfile representing the version from 'i' to 'j'.

The increase in number of fields will make sharing the
rcfile with an older top, once it's saved, impossible.

These changes are being done via a #define rather than
hard coded so any such sharing will still be possible.

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agolibrary: dont use vm_min_free on non-Linux systems
Craig Small [Sat, 16 Jul 2016 23:06:24 +0000 (09:06 +1000)]
library: dont use vm_min_free on non-Linux systems

For a specific slice of kernel versions we can get a better
estimate of the available memory before the "real" available
figure appears around kernel 3.2

However, that middle method requires a /proc/sys/vm directory.
FreeBSD 9.x used to emulate a < 2.6.27 kernel procfs meaning
it never tried the middle method. FreeBSD 10.x emulates something
more modern, but without the available figure and without a
/proc/sys/vm, so the library falls into a hole.

Hurd may to one day have this bug so we'll exclude him as well
as its triggered by whatever number appears in
/proc/sys/kernel/osrelease

References:
 commit 3f3b1a59ada85d21f34530cfb1dc1c0afd70e6dc
 https://bugs.debian.org/831396

8 years agotop: make compilation possible under netbsd-curses too
Jim Warner [Sat, 16 Jul 2016 05:00:00 +0000 (00:00 -0500)]
top: make compilation possible under netbsd-curses too

Whoa, I had never considered an alternative to ncurses
until the issue referenced below was raised. Thus, I'm
surprised to find that 'tparm' was the only impediment
to ultimately utilizing this alternate curses library.

And, while we could have substituted that non-standard
'tiparm' with only 2 arguments, we'll utilize the full
parms compliment in the spirit of that original patch.

Frankly, the task of developing an alternative library
to that ncurses implementation really boggles my mind.

Congratulations to rofl0r, whoever that masked man is.

Reference(s):
. issue raised
https://gitlab.com/procps-ng/procps/issues/38
. netbsd-curses home
https://github.com/sabotage-linux/netbsd-curses

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agoUpdated Chinese po file
Craig Small [Sat, 16 Jul 2016 22:45:48 +0000 (08:45 +1000)]
Updated Chinese po file

8 years agomisc: fix strtod_nol_err tests
Dr. Werner Fink [Wed, 13 Jul 2016 10:08:51 +0000 (20:08 +1000)]
misc: fix strtod_nol_err tests

A better way of implementing the string to double
conversion and a better way of testing it.

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agomisc: Remove strtod tests
Craig Small [Sun, 10 Jul 2016 23:25:43 +0000 (09:25 +1000)]
misc: Remove strtod tests

Due to the interesting properties of floating points, the strtod
tests have been removed. One day I may bother enabling them again.

8 years agowatch: define HOST_NAME_MAX
Craig Small [Sun, 10 Jul 2016 22:41:21 +0000 (08:41 +1000)]
watch: define HOST_NAME_MAX

Those infernal arches of kfreebsd-i386 (not -amd64) don't define
HOST_NAME_MAX. This patch is a work-around for those systems with
lacking include files.

8 years agomisc: Update translations v3.3.12
Craig Small [Sat, 9 Jul 2016 23:09:32 +0000 (09:09 +1000)]
misc: Update translations

Update the translations to the latest versions.
We also now have simplified Chinese language too!

8 years agomisc: testsuite to source aux scripts correctly
Craig Small [Sat, 9 Jul 2016 23:04:44 +0000 (09:04 +1000)]
misc: testsuite to source aux scripts correctly

Because I don't know how to redirect properly in tcl, there are
some small scripts that do this for me. With your standard
make check, all is good because the scripts and the binary are
in the usual spots.

make distcheck however puts them all over the place. The binary is
in a different tree to the test and aux scripts. The change now
tells where aux script where its binary is.

8 years ago6:0:0 lbirary API bump
Craig Small [Sat, 9 Jul 2016 22:55:45 +0000 (08:55 +1000)]
6:0:0 lbirary API bump

8 years agomisc: Add note for Debian bug about ANSI
Craig Small [Sat, 9 Jul 2016 21:59:20 +0000 (07:59 +1000)]
misc: Add note for Debian bug about ANSI

8 years agowatch: fix process_ansi typo
Craig Small [Sat, 9 Jul 2016 05:57:11 +0000 (15:57 +1000)]
watch: fix process_ansi typo

When I had to apply Josh's ansi fix a few commits below I put the
return before the setattr

References:
 commit 261c571acafed88d03ebdb5c5fa3d7e084daf25b

8 years agowatch: Remove second [m check
Craig Small [Sat, 9 Jul 2016 05:16:57 +0000 (15:16 +1000)]
watch: Remove second [m check

With the previous watch fixes, there is no need for the second
[m check as these are covered in previous checks.

8 years agowatch: Don't attempt to ungetc parts of unknown ANSI escape sequences
Josh Triplett [Fri, 8 Jul 2016 07:32:59 +0000 (00:32 -0700)]
watch: Don't attempt to ungetc parts of unknown ANSI escape sequences

If process_ansi encountered an unknown character when processing an ANSI
escape sequence, it would ungetc all the characters read so far, except
for the character just read, and the opening '\033['.  ungetting the
middle of the escape sequence does not produce useful results, and also
relies on the unportable assumption that ungetc works on multiple
characters (which glibc does not support).  Discard the characters
instead.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
8 years agowatch: Fix ANSI escape sequence termination
Josh Triplett [Fri, 8 Jul 2016 07:29:59 +0000 (00:29 -0700)]
watch: Fix ANSI escape sequence termination

process_ansi stopped processing an ANSI escape sequence if
(c < '0' && c > '9' && c != ';'), which will never happen.  Fix the
range check to use || instead.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
8 years agowatch: Don't process additional numbers in unknown ANSI color escapes
Josh Triplett [Sat, 9 Jul 2016 04:52:54 +0000 (14:52 +1000)]
watch: Don't process additional numbers in unknown ANSI color escapes

process_ansi assumed all numbers in a color control sequence correspond
to colors or attributes, which breaks badly if it encounters a
ISO-8613-3 escape sequence (such as for truecolor RGB).  For instance,
the sequence "\x1b[38;2;10;20;30m" sets the foreground color to
rgb(10,20,30), but watch will interpret all five numbers in the sequence
as colors or attributes themselves.

Stop processing the entire escape sequence if watch encounters any
number it doesn't understand, as that number may change the meaning of
the rest of the sequence.

8 years agobuild-sys: Re vert noinst and check programs
Craig Small [Sat, 9 Jul 2016 04:35:06 +0000 (14:35 +1000)]
build-sys: Re vert noinst and check programs

Previously there was a commit to change all noinst_PROGRAMS into
check_PROGRAMS. This was not a good idea.

check_PROGRAMS are built before TESTS are run. However they are
NOT build before the dejagnu tests are run, causing those tests
to fail.

So:
If the program is required for dejagnu, it needs to go into
noinst_PROGRAMS
If the program is required for TESTS or is one of those TESTS,
it needs to go into check_PROGRAMS

8 years agobuild-sys: Make check programs before check
Craig Small [Sat, 9 Jul 2016 04:11:06 +0000 (14:11 +1000)]
build-sys: Make check programs before check

For some unknown reason, check_PROGRAMS are not built before check.
They are built before recheck and after check, which isn't very
useful.

This means any tests by dejagnu that need those programs will fail.
On my console I get a build error, the CI merrily reports the error
but considers the build OK; go figure.

The kludge adds check_PROGRAMS to be a dependency to check.
Note, TESTS don't need to be included in this, because they are
properly compliled after the dejagnu tests but before they are
run.

8 years agowatch: fix 8bit regression
Craig Small [Sat, 9 Jul 2016 03:27:23 +0000 (13:27 +1000)]
watch: fix 8bit regression

As part of the fix to truncate the command in non-8bit, watch had
the function for output_header changed (much for scope cleanliness
and cohesiveness than anything; so I'm going to blame Meyer)...

Anyhow the 8bit enabled version did not have that update which
meant watch failed to compile. Thanks to @asavah for issue #37
and the patch.

References:
 commit 5a40c7970d8185fcf322575de9fed69d4cdedd93

8 years agoNEWS: update (and reorganize) with accumulated changes
Jim Warner [Thu, 7 Jul 2016 05:00:00 +0000 (00:00 -0500)]
NEWS: update (and reorganize) with accumulated changes

For what could be our last oldlib release, why not try
to make the NEWS a little more readable. So, it's been
reorganized by category and bug fixes were out-dented.

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agobuild sys: update configure.ac for the latest autoscan
Jim Warner [Wed, 6 Jul 2016 05:00:00 +0000 (00:00 -0500)]
build sys: update configure.ac for the latest autoscan

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agomisc: repair a single instance of 'whitespace' boo-boo
Jim Warner [Wed, 6 Jul 2016 05:00:00 +0000 (00:00 -0500)]
misc: repair a single instance of 'whitespace' boo-boo

[ this is just the case of the final newline missing ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agolibrary: avoid QUICK_THREADS, swat Redhat bug #1284091
Jim Warner [Wed, 6 Jul 2016 05:00:00 +0000 (00:00 -0500)]
library: avoid QUICK_THREADS, swat Redhat bug #1284091

For this release, what's likely to be our last oldlib,
we really no longer care when top or ps threads access
is made a little less efficient. This is especially so
when efficiency was gained at the expense of accuracy.

The newlib branch already has turned off QUICK_THREADS
so this patch just brings the master branch into line.

Reference(s):
https://bugzilla.redhat.com/show_bug.cgi?id=1284091

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agolibrary: rename clashing pwcache functions
Craig Small [Fri, 17 Jun 2016 22:17:45 +0000 (08:17 +1000)]
library: rename clashing pwcache functions

On MacOS the system already has user_from_uid and group_from_gid.
These are renamed pwcache_get_user and pwcache_get_group.

For the old library, pwcache_get_user needs to be exported
for skill.

References:
 https://gitlab.com/procps-ng/procps/issues/34

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agomisc: adapted others to that new proc_t 'cgname' field
Jim Warner [Sun, 3 Jul 2016 05:00:00 +0000 (00:00 -0500)]
misc: adapted others to that new proc_t 'cgname' field

This patch adapts the ps program to a newly add proc_t
field and provides for new support in that top program
along with his man document (ps was already ok there).

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agolibrary: play catchup with a new proc_t 'cgname' field
Jim Warner [Sun, 3 Jul 2016 05:00:00 +0000 (00:00 -0500)]
library: play catchup with a new proc_t 'cgname' field

Since we're about to break the ABI/API anyway, why not
go ahead and add yet another field to our proc_t which
the newlib branch has had for awhile. This then allows
the top program to offer 'control group name' and will
also permit a few reductions in that ps program logic.

And let's also clean up some unrelated warnings below.

Clang warnings:
proc/readproc.c:1178:50: warning: address of array 'ent->d_name' will always evaluate to 'true' [-Wpointer-bool-conversion]
    if(unlikely(unlikely(!ent) || unlikely(!ent->d_name))) return 0;
                                           ~~~~~~^~~~~~
proc/readproc.c:1205:50: warning: address of array 'ent->d_name' will always evaluate to 'true' [-Wpointer-bool-conversion]
    if(unlikely(unlikely(!ent) || unlikely(!ent->d_name))) return 0;
                                           ~~~~~~^~~~~~

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: eliminate 2 author sections from the man document
Jim Warner [Sun, 3 Jul 2016 05:00:00 +0000 (00:00 -0500)]
top: eliminate 2 author sections from the man document

We'll follow Craig's lead and whack some author stuff.

[ and we'll honor the SEE ALSO guideline for periods ]
[ but essentially ignore all the other busybody crap ]
[ which, to be honest, we pretty much follow already ]

[ actually, if you're told to follow a certain style ]
[ in program examples, you've gone way past busybody ]
[ crap and have entered the realm of anal retentive! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: improved that #define PRETENDNOCAP implementation
Jim Warner [Sun, 3 Jul 2016 05:00:00 +0000 (00:00 -0500)]
top: improved that #define PRETENDNOCAP implementation

This development (only) define can be used to turn top
into a simple text program, disabling termcap effects.
But input (at screen bottom) suffers from a line wrap.

So, this commit just makes the input prompt processing
a little more effective by adding one leading newline.

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agodocumentation: Update watch man page
Craig Small [Sun, 3 Jul 2016 06:16:28 +0000 (16:16 +1000)]
documentation: Update watch man page

Added locale details and fixed this manual page to follow standards
including ordering it the right way, keeping the names of things
consistent and removing authors section.

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agowatch,free: interpet intervals in non-locale way
Craig Small [Sun, 3 Jul 2016 06:14:36 +0000 (16:14 +1000)]
watch,free: interpet intervals in non-locale way

Both watch and free used the locale to determine the required delay
interval for subsequent updates. It's preferable to not care about
locale and accept both 12.34 and 12,34 as meaning 12 seconds and
340 microseconds.

References:
 https://bugs.debian.org/692113

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agodocumentation: rewrite for shared in free
Craig Small [Sun, 3 Jul 2016 00:36:58 +0000 (10:36 +1000)]
documentation: rewrite for shared in free

Minor tweaks in the free manual page
* Removed author section. It's wrong and strongly discouraged
  by the man page standards.
* Moved note about shared not in old kernels into bugs sections
as this is not relevant for most people and declutters the top
sections.

References:
 https://bugs.debian.org/755233

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agolibrary: find tty device name of process quicker
Simon Tatham [Sun, 3 Jul 2016 00:08:18 +0000 (10:08 +1000)]
library: find tty device name of process quicker

The procps library attempts to work out the tty of a process
through several methods. For things like /dev/tty123 or
/dev/foo it works fine.

For tty devices that put the minor number in a directory
of the major name this fails. So then we have to fallback
to stating things like the processes STDERR and try again.

Considering a lot of processes sit on ttys such as
/dev/pts/3 this is a lot of wasted time. At the point of
entering driver_name we know "/dev/pts" and we know "3"
we just didn't join them up the right way as this is old
code.

This change now looks for /dev/pts/3 as well. It does it
after looking for /dev/pts3 so the behaviour is the same.

References:
 https://bugs.debian.org/770215

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agowatch: truncate command in non-8 bit mode
Craig Small [Sat, 2 Jul 2016 06:07:56 +0000 (16:07 +1000)]
watch: truncate command in non-8 bit mode

When the screen width is not long enough to display the entire
command, watch puts three dots ... like elipses at the end of
the truncated line.

It's been like that for years, perhaps noone uses non 8-bit
watch?

References:
 commit 367b8bb616c6d52513b594ccb936d322a3f8b6c1

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agowatch: Add hostname to the header
Jesse Hathaway [Sat, 2 Jul 2016 05:45:36 +0000 (15:45 +1000)]
watch: Add hostname to the header

watch has the hostname added to the header so you know what device
if you have many it is running on.

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agokill: Correct pid type
Craig Small [Sat, 2 Jul 2016 05:18:29 +0000 (15:18 +1000)]
kill: Correct pid type

Previous commit used a pid type of int in the printf, this should
be a long.

8 years agoMerge branch 'master' into 'master'
Craig Small [Sat, 2 Jul 2016 04:52:43 +0000 (04:52 +0000)]
Merge branch 'master' into 'master'

- Fixing sysinfo - devices with length exceeding 15 chars are not displayed in vmstat -d

Resolves Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=586078. See for more info.<br/>
Enhances procps-ng to get aligned with kernel features (support for devices of name 32 chars long).

See merge request !16

8 years agokill: report error if cannot kill process
Craig Small [Sat, 2 Jul 2016 02:25:14 +0000 (12:25 +1000)]
kill: report error if cannot kill process

Shell kill would report a problem if you tried to kill a process
while procps kill was silent. This meant it looked like kill worked
when it actually failed.

References:
 https://bugs.debian.org/733172

8 years ago- Fixing sysinfo - devices with length exceeding 15 chars are not displayed in vmstat -d
Jan Rybar [Thu, 30 Jun 2016 16:29:50 +0000 (18:29 +0200)]
- Fixing sysinfo - devices with length exceeding 15 chars are not displayed in vmstat -d

8 years agoMerge branch 'master' into 'master'
Craig Small [Fri, 17 Jun 2016 11:56:40 +0000 (11:56 +0000)]
Merge branch 'master' into 'master'

- Fixing incorrect memory usage assessment due to skipping vmflags parsing

- Sometimes occurs when calculating memory usage of program using virtual memory. Vmflags line not recognized and affects calculations, resulting in nonsense values. Raised in Red Hat Bugzilla #1262864, affecting upstream.

See merge request !15

8 years ago- Fixing incorrect memory usage assessment due to skipping vmflags parsing
Jan Rybar [Wed, 15 Jun 2016 12:12:59 +0000 (14:12 +0200)]
- Fixing incorrect memory usage assessment due to skipping vmflags parsing
- Resolves Red Hat Bugzilla #1262864, affecting upstream

8 years agops: adapt to revised approach for --with-systemd build
Jim Warner [Thu, 2 Jun 2016 05:00:00 +0000 (00:00 -0500)]
ps: adapt to revised approach for --with-systemd build

We'll now display a '?' for any systemd field when our
library was built without that above configure option.

Since the man page documents such fields this approach
is far superior to that old (confusing) error message:
. error: unknown user-defined format specifier "slice"

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: accommodate the loss of that OOMEM_ENABLE #define
Jim Warner [Thu, 2 Jun 2016 05:00:00 +0000 (00:00 -0500)]
top: accommodate the loss of that OOMEM_ENABLE #define

Now that the conditional OOMEM_ENABLE has been removed
and all users exposed to those 'out of memory' fields,
it's about time we added them to the top man document.

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agolibrary: make sure that the proc_t is now fixed length
Jim Warner [Thu, 2 Jun 2016 05:00:00 +0000 (00:00 -0500)]
library: make sure that the proc_t is now fixed length

The former variable length structure created potential
problems for library users like that referenced below.

We will now parallel the same approach newlib uses for
the configure options --enable-oomem & --with-systemd.
Thus, the --enable-oomem and OOMEM_ENABLE #define have
been eliminated and the --with-systemd option (#define
WITH_SYSTEMD) will hereafter impact one function only.

The proc_t struct itself will now *never* be impacted.

Reference(s):
https://gitlab.com/procps-ng/procps/issues/31

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: make more responsive when toggling cpu off/online
Jim Warner [Wed, 1 Jun 2016 05:00:00 +0000 (00:00 -0500)]
top: make more responsive when toggling cpu off/online

Using the <STAT> api under the newlib branch, that top
program is very responsive to changes in the number of
on-line cpus. However under the master branch this top
program is very responsive only to losses of some cpu.

When a cpu is brought back on-line potential delays of
60 seconds could be encountered. That delay was simply
an attempt to reduce costs and reflected the erroneous
assumption that adding a cpu required physical effort.

So without redesigning the cpu refresh code to emulate
that of newlib, this commit just reduces the potential
delay to 3 seconds (the same that is used for memory).

[ As an aside, if one wants to have their confidence ]
[ in that htop program badly shaken, try taking some ]
[ cpus off-line & on-line again while it is running. ]

[ Poor ol' htop just continues to report results for ]
[ whatever were the cpus when started. Nice feature, ]
[ but I wonder where those phantom results are from. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: miscellaneous accumulated tweaks of code/comments
Jim Warner [Tue, 26 Apr 2016 05:00:00 +0000 (00:00 -0500)]
top: miscellaneous accumulated tweaks of code/comments

This commit just tries to parallel that newlib branch.
It contains the following changes, which were prompted
by the newlib coverity analysis which Craig initiated:

. comment typo predicting 'String not null terminated'
. eliminate 'Logically dead code' from insp_make_row()

Some tweaks, unrelated to coverity, are also included:

. use more modern (recommended) approach for time call

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: extend 'zero suppression' scope to several fields
Jim Warner [Fri, 15 Apr 2016 05:00:00 +0000 (00:00 -0500)]
top: extend 'zero suppression' scope to several fields

This commit just tries to parallel the implementations
in the newlib branch. The config file Rc.zero_suppress
will be extended to include both out-of-memory fields.

And while we're at it, we'll also extend zero suppress
to that NI (nice value) field, which already should've
had it. Plus we trade those namespaces custom suppress
logic for our now slightly enhanced make_num function.

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: man page now includes resident memory enhancement
Jim Warner [Wed, 13 Apr 2016 05:00:00 +0000 (00:00 -0500)]
top: man page now includes resident memory enhancement

Since support already exists in the newlib branch this
represents an equivalent master branch implementation,
and this commit message is shared with 2 more patches.

Beginning with linux-4.5, the following new fields are
being added under that /proc/<pid>/status pseudo file:
 . RssAnon - size of resident anonymous memory
 . RssFile - size of resident file mappings
 . RssShmem - size of resident shared memory

p.s. Locked resident memory support was also added but
isn't directly related to the kernel 4.5 enhancements.

p.p.s. Archlinux, Debian-stretch and Fedora-23 already
are currently using a 4.5 linux kernel (as of 6/2/16).

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: exploit new linux-4.5 resident memory enhancement
Jim Warner [Wed, 13 Apr 2016 05:00:00 +0000 (00:00 -0500)]
top: exploit new linux-4.5 resident memory enhancement

Since support already exists in the newlib branch this
represents an equivalent master branch implementation,
and this commit message is shared with 2 more patches.

Beginning with linux-4.5, the following new fields are
being added under that /proc/<pid>/status pseudo file:
 . RssAnon - size of resident anonymous memory
 . RssFile - size of resident file mappings
 . RssShmem - size of resident shared memory

p.s. Locked resident memory support was also added but
isn't directly related to the kernel 4.5 enhancements.

p.p.s. Archlinux, Debian-stretch and Fedora-23 already
are currently using a 4.5 linux kernel (as of 6/2/16).

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agolibrary: exploit linux-4.5 resident memory enhancement
Jim Warner [Wed, 13 Apr 2016 05:00:00 +0000 (00:00 -0500)]
library: exploit linux-4.5 resident memory enhancement

Since support already exists in the newlib branch this
represents an equivalent master branch implementation,
and this commit message is shared with 2 more patches.

Beginning with linux-4.5, the following new fields are
being added under that /proc/<pid>/status pseudo file:
 . RssAnon - size of resident anonymous memory
 . RssFile - size of resident file mappings
 . RssShmem - size of resident shared memory

p.s. Locked resident memory support was also added but
isn't directly related to the kernel 4.5 enhancements.

p.p.s. Archlinux, Debian-stretch and Fedora-23 already
are currently using a 4.5 linux kernel (as of 6/2/16).

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agopmap: Do not display error if shmctl(..IPC_RMID) returns EINVAL
Cristian Rodríguez [Thu, 28 Apr 2016 05:22:53 +0000 (02:22 -0300)]
pmap: Do not display error if shmctl(..IPC_RMID) returns EINVAL

The segment may have been destroyed by the kernel automagically
after shmdt(addr)

How to reproduce:

sysctl -w kernel.shm_rmid_forced=1
./pmap 1
shared memory remove: Invalid argument
[..]

8 years agobprocps: fix order of operations for %use of slabinfo
Takayuki Nagata [Mon, 25 Apr 2016 09:30:36 +0000 (05:30 -0400)]
bprocps: fix order of operations for %use of slabinfo

In some environments, 100 * nr_active_objs is calculated at first,
and lower 32bit of the result is divided by nr_objs.
If 100 * nr_active_objs > 42949672, %use will be incorrect.

Signed-off-by: Takayuki Nagata <tnagata@redhat.com>
8 years agoadded gettext to dependency
Craig Small [Wed, 20 Apr 2016 12:15:27 +0000 (22:15 +1000)]
added gettext to dependency

8 years agofixed incorrect libtool dependency
Craig Small [Wed, 20 Apr 2016 12:07:45 +0000 (22:07 +1000)]
fixed incorrect libtool dependency

8 years agoneeded extra dependencies
Craig Small [Wed, 20 Apr 2016 12:03:50 +0000 (22:03 +1000)]
needed extra dependencies

8 years agoUpdate gitlab test yaml
Craig Small [Wed, 20 Apr 2016 12:00:24 +0000 (22:00 +1000)]
Update gitlab test yaml

8 years agopidof: check cmd if space in argv0
Craig Small [Sun, 17 Apr 2016 06:43:26 +0000 (16:43 +1000)]
pidof: check cmd if space in argv0

A difference in behaviour between the sysvinit and procps pidof
was that the procps one would sometimes not find process that
the sysvinit one did.

The difference is that if a space is found in argv[0] then sysvinit
would look at cmd for a match. This isn't perfect and more of a
best guess but does often work.

procps pidof now follows the same "standard". The most obvious
difference is with kde based processes and incoming ssh connections
with sshd.

References:
 GitLab issue #4
 https://gitlab.com/procps-ng/procps/issues/4
 https://github.com/limingth/sysvinit/blob/master/sysvinit-2.88dsf/src/killall5.c#L800

8 years agofix parsing of negative PIDs
Benedikt Böhm [Tue, 12 Apr 2016 19:02:28 +0000 (21:02 +0200)]
fix parsing of negative PIDs

Signed-off-by: Craig Small <csmall@enc.com.au>
8 years agotests: Conditionally add prctl to test process
Craig Small [Sat, 16 Apr 2016 23:09:41 +0000 (09:09 +1000)]
tests: Conditionally add prctl to test process

prctl was already bypassed on Cygwin systems. This extends to
non-Linux systems such as kFreeBSD and Hurd.

References:
 https://bugs.debian.org/816237

8 years agotop: minimal necessary corrections to the man document
Jim Warner [Tue, 12 Apr 2016 05:00:00 +0000 (00:00 -0500)]
top: minimal necessary corrections to the man document

After experimenting with those 4.5 kernel enhancements
to /proc/<pid>/status, that newly added overview topic
'Memory Types' was found to be in need of some tweaks.

In addition, the 'DATA' description wasn't quite broad
enough since explicit private file mappings impact it.

( lastly, for the record, the 2nd commit referred to )
( below contained an incorrect reference that should )
( have been the original issue 21 commit. instead it )
( showed an invalid SHA-1 hash. i believe i have now )
( identified a flaw in my workflow that produced it. )

Reference(s):
. original patch responding to issue #21
commit e4bbd3ca1abe57bc52e7eff72aa3973ecf67765c
. subsequent patch with invalid commit ref
commit 5dcbcd00fe0978b5e2e8e0a19a34389d896e84d9

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: add additional memory information to the man page
Jim Warner [Thu, 17 Mar 2016 05:00:00 +0000 (00:00 -0500)]
top: add additional memory information to the man page

In response to Issue #21, the commit referred to below
provided some much needed improvements and corrections
to topic `3a. DESCRIPTIONS of Fields' in the man page.
However, it assumed a reader possessed much background
knowledge that may not, in truth, actually be present.

So without, hopefully, insulting anyone's intelligence
this patch offers an expanded discussion of some terms
and concepts within a separate section under OVERVIEW.

[ plus it affords an opportunity to incorporate that ]
[ extremely useful table from Florent Bruneau's post ]

Reference(s):
commit f2a08cf16794ec6085bdecbaf8f7c2887cd4e87f
https://techtalk.intersec.com/2013/07/memory-part-1-memory-types/

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agotop: improve/correct several memory fields in man page
Jim Warner [Mon, 14 Mar 2016 06:00:00 +0000 (00:00 -0600)]
top: improve/correct several memory fields in man page

Due to quirks in kernel memory management plus limited
information available from /proc/<pid>/status & statm,
some of the top resident memory fields were capable of
exceeding available physical memory. So this commit is
a bit of a band-aid until the kernel has been changed.

Such a change appears to be on the horizon in the form
of three new fields to be added to /proc/<pid>/status.
While not preventing 'resident' memory from apparently
exceeding physical memory, the new fields will help to
clarify any such contingency, if/when we exploit them.

Reference(s):
. original post by Samuel Thibault
https://gitlab.com/procps-ng/procps/issues/21
. informative memory analysis
https://techtalk.intersec.com/2013/07/memory-part-1-memory-types/
https://techtalk.intersec.com/2013/07/memory-part-2-understanding-process-memory/
. kernel changes to /proc/<pid>/status
commit 8cee852ec53fb530f10ccabf1596734209ae336b
commit eca56ff906bdd0239485e8b47154a6e73dd9a2f3

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agoMerge branch 'master' into 'master'
Craig Small [Sat, 12 Mar 2016 04:00:28 +0000 (04:00 +0000)]
Merge branch 'master' into 'master'

Cygwin build support

I have added some changes to make building in Cygwin possible. Please review the changes and let me know if there are any ways I may have done anything incorrectly.

strverscmp is included to satisfy a dependency in Cygwin.
Excluded utmp and prctl functions that are not supported currently.

See merge request !12

8 years agotop: tweaks to vertical scroll management & 'i' toggle
Jim Warner [Mon, 1 Feb 2016 06:00:00 +0000 (00:00 -0600)]
top: tweaks to vertical scroll management & 'i' toggle

The commit referenced below claims to disable vertical
scrolling when idle tasks weren't being shown. However
it really addresses only a point in time when that 'i'
toggle is keyed. Left untouched were the up/down keys.

So this commit will simply finish the job of disabling
vertical scrolling whenever tasks which have used some
CPU are the only ones which are currently being shown.

Reference(s):
commit c07f6c5e6d6170ef3f2373b4d86988184c3235bf

Signed-off-by: Jim Warner <james.warner@comcast.net>
8 years agoFixed tests so make check no longer fails
Wayne Porter [Thu, 10 Mar 2016 23:35:30 +0000 (15:35 -0800)]
Fixed tests so make check no longer fails

8 years agoAdded Cygwin build support
Wayne Porter [Thu, 10 Mar 2016 23:04:27 +0000 (15:04 -0800)]
Added Cygwin build support

strverscmp is included to satisfy a dependency in Cygwin.
Excluded utmp and prctl functions that are not supported currently.

8 years agoenable transparent large file support
Mike Frysinger [Mon, 7 Mar 2016 20:36:59 +0000 (15:36 -0500)]
enable transparent large file support

Historically LFS mattered only to open/read large files.  A few programs
here use open/seek, but not generally on files that are large.  However,
LFS also applies to stat which procps does in a bunch of places -- some
filesystems have 64bit inodes and attempts to do a 32bit stat will throw
an error.

Enable transparent LFS everywhere to avoid this.

8 years agoset test programs to check_PROGRAMS
Mike Frysinger [Mon, 7 Mar 2016 20:19:47 +0000 (15:19 -0500)]
set test programs to check_PROGRAMS

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
8 years agoReplace %Lu with standard %llu
Craig Small [Thu, 3 Mar 2016 10:43:52 +0000 (21:43 +1100)]
Replace %Lu with standard %llu

Multiple scanf()s use the GNU-permitted %Lu. This is not supported in
other libraries and isn't to the POSIX specification. The L modifier
is only used for floats in POSIX.

Replacing %Lu with %llu is the same for GNU libc (scanf(3) says as much)
but means other libraries will work fine.

Closes: #19
References:
 http://pubs.opengroup.org/onlinepubs/009695399/functions/fscanf.html

8 years agoMerge branch 'master' into 'master'
Craig Small [Thu, 3 Mar 2016 10:29:58 +0000 (10:29 +0000)]
Merge branch 'master' into 'master'

pmap: Fix detail parsing on long mapping lines

If the mapping descriptor is longer than 128 chars, the last parsed
character won't be a newline even if the current buffer contains it a
bit further than that. The current code always interprets it as a short
fgets() read instead, and thus keeps calling fgets() until it gets a
newline, dropping valid lines and failing with the following error:

pmap: ERROR: inconsistent detail field in smaps file, line:
 Rss:                 212 kB

See merge request !10

8 years agoMerge branch 'master' into 'master'
Craig Small [Thu, 3 Mar 2016 10:26:11 +0000 (10:26 +0000)]
Merge branch 'master' into 'master'

Fix for Bug:1174313

Re-ordered 'tgid' before 'thcount' to fix bug https://bugzilla.redhat.com/show_bug.cgi?id=1174313.
It was not in alphabetical order.

See merge request !11

8 years agoA locale-independent strtod
Craig Small [Thu, 3 Mar 2016 10:24:08 +0000 (21:24 +1100)]
A locale-independent strtod

There is a need in some utilities to have a way of accepting both
types of decimal points "." and ",". The only way seems to be to
rebuild strtod().

This new function will accept "123.456" and "123,456" as 123.456
and considers them the same number. It means we lose thousands
separator, but this is rarely used.

test scripts are added to check the function returns the proper
values. There was simpler predecessor that got stuck on negative
0 or -0.123 which these tests flushed out.

References:

8 years agoFix for Bug:1174313
Shivkrishna A [Wed, 2 Mar 2016 17:05:55 +0000 (22:35 +0530)]
Fix for Bug:1174313

8 years agopmap: Fix detail parsing on long mapping lines
Emanuele Aina [Tue, 9 Feb 2016 22:02:31 +0000 (23:02 +0100)]
pmap: Fix detail parsing on long mapping lines

If the mapping descriptor is longer than 128 chars, the last parsed
character won't be a newline even if the current buffer contains it a
bit further than that. The current code always interprets it as a short
fgets() read instead, and thus keeps calling fgets() until it gets a
newline, dropping valid lines and failing with the following error:

pmap: ERROR: inconsistent detail field in smaps file, line:
 Rss:                 212 kB

8 years agotestsuite: kill test fails on signal names
Craig Small [Sun, 3 Jan 2016 07:20:45 +0000 (18:20 +1100)]
testsuite: kill test fails on signal names

Some archs have + and - in their signal names, such as hppa
which comes with signals such as RTMIN+-9 RTMIN+-8
The kill -l test failed because of this, we now accept these
odd names.

References:
 https://bugs.debian.org/762764
 https://buildd.debian.org/status/fetch.php?pkg=procps&arch=hppa&ver=1%3A3.3.10-1&stamp=1411601407

8 years agops: use attr/current as fallback for context
Laurent Bigonville [Sun, 3 Jan 2016 07:11:51 +0000 (18:11 +1100)]
ps: use attr/current as fallback for context

If SELINUX is enabled but the machine is using another MAC system
(like apparmor), ps will fallback to just parsing
"/proc/%d/attr/current", otherwise the label/context would not
be properly displayed in that case.

References:
 https://bugs.debian.org/786956

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agowatch: interpret esc[m sequence
Craig Small [Wed, 18 Nov 2015 11:48:09 +0000 (22:48 +1100)]
watch: interpret esc[m sequence

Commit 99fa7f removed watch crashing from having the null ANSI
sequence. However it just ignored that sequence instead of fixing it.

This change correctly checks buf (not undefined endptr) and sends
the reset attribute if found.

Closes: #12
9 years agotop: extend '=' key to include active 'locate' request
Jim Warner [Sat, 24 Oct 2015 05:00:00 +0000 (00:00 -0500)]
top: extend '=' key to include active 'locate' request

It is documented behavior that when certain other keys
are active, sorts column highlighting will temporarily
be disabled. Among those keys is the 'L' (locate/find)
provision. The equals ('=') key can be used to restore
column highlighting by resetting other keys, except 1.

When a locate/find is active, the '=' key will have no
effect on 'x' column highlighting, which still remains
disabled. Further, when 'L' is active an 'x' keystroke
is processed changing the state of column highlighting
but without any visual clue (since it's yet disabled).

So this commit just extends the '=' key to embrace 'L'
processing resets, just like other highlight disabling
keys while avoiding 'x' state changes if approproiate.

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agotop: ATEOJ_RPTHSH prints hash table entries less often
Jim Warner [Fri, 23 Oct 2015 05:00:00 +0000 (00:00 -0500)]
top: ATEOJ_RPTHSH prints hash table entries less often

We'll following the newlib <pids> approach to hashing:

. a 'PIDs at max depth:' portion of that UNREF_RPTHASH
enabled #define is now published only when the maximum
depth of hash table entry chains exceed depths of one.

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agotop: do not co-mingle strings/numbers under namespaces
Jim Warner [Thu, 22 Oct 2015 05:00:00 +0000 (00:00 -0500)]
top: do not co-mingle strings/numbers under namespaces

Craig's recent commit under that newlib branch dealing
with namespace support has prompted me to review top's
handling of those fields. Currently, when such a field
is zero, top displays a dash ('-'). This will mean the
justification toggles ('j/J') will behave incorrectly.

This patch simply allows the potential zero to display
or be suppressed with the already existing '0' toggle.

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agotop: miscellaneous accumulated tweaks to code/comments
Jim Warner [Wed, 21 Oct 2015 05:00:00 +0000 (00:00 -0500)]
top: miscellaneous accumulated tweaks to code/comments

A patch containing the following miscellaneous tweaks:

. remove a function that handled former library errors
[ that function should have gone bye-bye with 3.3.11 ]
[ when those 'wchan' provisions were much simplified ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agotop: update the man document reporting bugs suggestion
Jim Warner [Tue, 20 Oct 2015 05:00:00 +0000 (00:00 -0500)]
top: update the man document reporting bugs suggestion

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agoCloses: #9 ps: Remove Unix98 output limitations
Craig Small [Mon, 26 Oct 2015 00:18:52 +0000 (11:18 +1100)]
Closes: #9 ps: Remove Unix98 output limitations
ps previously followed the Unix98 standard when it comes to
user-defined output, sometimes. This meant you could have
user output format with a header that included commas and
equals signs. It was dependent on if ps thought you wanted
sysv or bsd format and THAT was dependent on things in previous
options.

It was very confusing to a user because
 ps p $$ -o pid=,comm=
gave you a two-column output but
 ps -p $$ -o pid=,comm=
would give you a one column output with the header ",comm="

The -p versus p means (to ps) you want sysv or bsd parsing.
Unix98 standard or not, this is plainly just silly.

The commit removes any of the quirks Unix98 has with user defined
output.  If you really wanted a ps header with commas in the output,
today isn't your day.

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agoRemoved empty test
Craig Small [Sat, 24 Oct 2015 03:41:54 +0000 (14:41 +1100)]
Removed empty test

9 years agofree: use SReclaimable in cached
Craig Small [Sat, 24 Oct 2015 03:15:07 +0000 (14:15 +1100)]
free: use SReclaimable in cached

The previous commit added all of slab into the cache value. The
thing was is cached in this context is something you can get
back and reclaim if under memory pressure.

The problem was slab parameter includes both reclaimable and
unreclaimable values which doesn't make sense in this context.
This commit make cached only use the reclaimable component.

References:
 http://www.freelists.org/post/procps/OmegaPhilxxxxxxxxxxxxx-Bug799716-free-considers-cached-to-include-SUnreclaim
 https://github.com/brndnmtthws/conky/issues/130
 https://bugs.debian.org/799716

Commits:
 6cb75efef85f735b72e6c96f197f358f511f8ed9

9 years agoMerge branch 'no-cxx' into 'master'
Craig Small [Sat, 24 Oct 2015 02:36:15 +0000 (02:36 +0000)]
Merge branch 'no-cxx' into 'master'

configure.ac: do not check for C++ compiler

We do not have any C++ code, so there is no point in checking for C++
tools in the configure script.

Signed-off-by: John Keeping <john@keeping.me.uk>
See merge request !8

9 years agofree: use correct end sentinel
Craig Small [Sat, 24 Oct 2015 02:17:36 +0000 (13:17 +1100)]
free: use correct end sentinel

When scaling values, the last item was integer 0 but the loop checked
for character '0'.

This was reported by 付腾桂 Thanks for the report and patch.

9 years agoadded new CI status button
Craig Small [Sat, 24 Oct 2015 01:35:01 +0000 (01:35 +0000)]
added new CI status button

9 years agoRemove CI from readme as the function has been integrated
Craig Small [Sat, 24 Oct 2015 01:23:31 +0000 (01:23 +0000)]
Remove CI from readme as the function has been integrated

9 years agowatch: Correctly process [m Remove lib dependency
Craig Small [Tue, 1 Sep 2015 11:28:07 +0000 (21:28 +1000)]
watch: Correctly process [m Remove lib dependency

The commit referenced below made the ANSI sequence
[m be interpreted as [0m However this change was put
in the incorrect place and would reference an undefined
pointer, causing a crash. Thanks to Jimmy Theis for the
second heads-up.

watch doesn't need any libprocps functions so it is no
longer linked to them.

References:
 commit a5937e4e943eaf28b378a318566d6968f2b167be
 https://www.freelists.org/post/procps/watch-crashes-but-its-not-the-latest-commit-fault
 https://www.freelists.org/post/procps/Segmentation-fault-in-watch-3311

9 years agoconfigure.ac: do not check for C++ compiler
John Keeping [Tue, 18 Aug 2015 11:05:11 +0000 (12:05 +0100)]
configure.ac: do not check for C++ compiler

We do not have any C++ code, so there is no point in checking for C++
tools in the configure script.

Signed-off-by: John Keeping <john@keeping.me.uk>
9 years agops: display control group name
Craig Small [Sat, 15 Aug 2015 07:10:38 +0000 (17:10 +1000)]
ps: display control group name

The cgroup field while shown as a vector is a concatenated
string, so alot of the complexity of sorting and displaying
has gone.

This change simplifies the cgroup sorting and adds display
and sorting for the name attribute of the cgroup, if found.

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agops: sort by cgroup
Craig Small [Sat, 15 Aug 2015 06:23:37 +0000 (16:23 +1000)]
ps: sort by cgroup

A rather small fix to sort by cgroup. This sorting function
could be used for other string vector entries, but I can't
see why you want to for, say, environment.

Reference:
 https://bugs.debian.org/692279

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agoUpdate NEWS for next version
Craig Small [Sat, 15 Aug 2015 05:42:40 +0000 (15:42 +1000)]
Update NEWS for next version

9 years agoRELEASE 3.3.11 v3.3.11
Craig Small [Sun, 9 Aug 2015 07:54:49 +0000 (17:54 +1000)]
RELEASE 3.3.11

Update NEWS file to number this release.

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agobuild-sys: Update Library Version
Craig Small [Sun, 9 Aug 2015 07:45:19 +0000 (17:45 +1000)]
build-sys: Update Library Version

procps v3.3.11 will bring Library API 5:0:0
The reason for the change is the removal of some calls and
the addition of others. The newlib branch should hopefully
reset some of these changes to a much slower pace.

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agotranslations: Update all and fix Polish
Craig Small [Sun, 9 Aug 2015 07:37:44 +0000 (17:37 +1000)]
translations: Update all and fix Polish

Translation files downloaded from TP.
Polish file fixed for man-po, there were two
bad sequences.

References:
 http://www.freelists.org/post/procps/Bad-sequences-in-the-manpo-translations

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agobuild-sys: include .version in EXTRA_DIST
Craig Small [Sun, 9 Aug 2015 06:27:37 +0000 (16:27 +1000)]
build-sys: include .version in EXTRA_DIST

.version is created in the top_srdir which when building normally
doesn't present a problem. When make distcheck is run, the source
directory is made read-only and it fails with permission denied.

The version of misc/git-version-gen is old and is missing the
instruction to add .version to EXTRA_DIST. This commit does just
that.

make distcheck now passes.

References:
 https://github.com/gagern/gnulib/blob/master/build-aux/git-version-gen
 https://lists.gnu.org/archive/html/bug-gnulib/2011-08/msg00000.html

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agofree: Parse -s option correctly.
Craig Small [Sat, 8 Aug 2015 11:04:01 +0000 (21:04 +1000)]
free: Parse -s option correctly.

If the -s option was the first option on the command line, free
would report seconds argument failed. This only appeared on the
Debian free, not the one in git.

Closer examination revealed that if a valid float string is
given to strtof() it doesn't set errno to 0, but just leaves it
alone. As we are explicitly testing errno for overflows, this
means the previous errno change is picked up here.

The simple answer is to set errno to 0 before calling strtof().

References:
 https://bugs.debian/org/733758
 https://enc.com.au/2015/08/08/be-careful-with-errno/

9 years agoAdd notice in news about vmstat
Craig Small [Sat, 8 Aug 2015 07:14:36 +0000 (17:14 +1000)]
Add notice in news about vmstat

9 years agomiscellaneous: a final cleanup prior to release 3.3.11
Jim Warner [Thu, 6 Aug 2015 13:43:48 +0000 (08:43 -0500)]
miscellaneous: a final cleanup prior to release 3.3.11

This patch just eliminates some eol whitespace, adds a
missing eof newline and contributes yet one additional
entry to the NEWS summary regarding saved top rcfiles.

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