]> granicus.if.org Git - procps-ng/log
procps-ng
9 years agoadded a README in markup
Craig Small [Sun, 10 May 2015 06:43:41 +0000 (06:43 +0000)]
added a README in markup

9 years agoMerge branch 'filbranden/procps-build_sys_cleanup_usrbin'
Craig Small [Sun, 10 May 2015 05:28:56 +0000 (15:28 +1000)]
Merge branch 'filbranden/procps-build_sys_cleanup_usrbin'

configure.ac conflict was due to the git url being
changed after the merge request.

Conflicts:
configure.ac

9 years agotests: slabinfo should not be too strict about slab names
dmarc-noreply@freelists.org [Wed, 6 May 2015 22:17:24 +0000 (15:17 -0700)]
tests: slabinfo should not be too strict about slab names

Before this commit, the test checking `vmstat -m` (slabinfo) output uses
a fairly strict regular expression that only allows alphanumeric
characters and a few exceptions such as "_", "-", "(" and ")".

However, recent kernels use a wider range of characters, such as ">".
For instance, see this Linux commit which creates a "page->ptl" slab:
  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/mm/memory.c?id=b35f1819acd9243a3ff7ad25b1fa8bd6bfe80fb2#n4283

Other patches for reporting slab usage per memcg include the names of
the cgroup in the slabinfo output, which can include additional
characters and use dots for abbreviation.

The check should not be so string, instead it could simply look for a
chain of non-whitespace characters and that should be enough.

Tested that `make check` is still working, including in some of the
environments where features that enable the additional slabinfo names.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agotests: fix regexp in ps_sched_batch.exp to match in first line
dmarc-noreply@freelists.org [Wed, 6 May 2015 22:17:23 +0000 (15:17 -0700)]
tests: fix regexp in ps_sched_batch.exp to match in first line

The current regexp checks for a \s+ in the beginning, however that will
only match if there is a \n in the `ps` output before test-schedbatch,
but that will not happen if test-schedbatch is the first process in the
list, which happens if the PID of test-schedbatch is low enough to bring
it up in the sorted list.

Fix it by enabling newline-sensitive matching with (?n) which then
allows using ^ and $ anchors in the regexp (including an optional \r
introduced by expect.) Matching the end of line also improves checking
that the last field matches 18 exactly and not something like 181, etc.

Tested that `make check` does not break and also fixed the flakiness
seen in an environment with few processes running under the test user
which made the issue more frequent.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agotests: do not mark ps_sched_batch.exp as untested
dmarc-noreply@freelists.org [Wed, 6 May 2015 22:17:22 +0000 (15:17 -0700)]
tests: do not mark ps_sched_batch.exp as untested

Right now the test case is both testing it (expect_pass "$test") and
marking it as untested (untested "$test"), it should do either one or
the other, so stop marking it as untested.

Before this change, these lines appear in testsuite/ps.log or the output
of `make check RUNTESTFLAGS="--all"`:

  PASS: ps SCHED_BATCH scheduler
  UNTESTED: ps SCHED_BATCH scheduler

Note that the second line is confusing, it's implying that the test is
untested, right after having tested it and indicated it passes.

After this change, only the first line will appear.

Tested that both `make check` and `make distcheck` continue working with
this commit.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agorevert ps_sched checks for following commits
Craig Small [Sun, 10 May 2015 05:04:19 +0000 (15:04 +1000)]
revert ps_sched checks for following commits

9 years agoChanged git site to gitlab
Craig Small [Sun, 10 May 2015 04:57:50 +0000 (14:57 +1000)]
Changed git site to gitlab

9 years agopgrep SID=1 is valid
Craig Small [Sat, 9 May 2015 07:53:08 +0000 (17:53 +1000)]
pgrep SID=1 is valid

On most systems the only process with a SID=1 is init
and certainly not a test sleep.  On docker systems this
test program IS on SID=1 and so our "impossible SID" becomes
possible.

9 years agoFix some sched and tty tests
Craig Small [Sat, 9 May 2015 07:48:12 +0000 (17:48 +1000)]
Fix some sched and tty tests

The ps sched test has been disabled. There are too many
odd build farms this fails in strange ways.

Other odd build farms have no tty and so some tests check
for no tty and skip if not found.

9 years agobuild-sys: install binaries in bindir (get rid of usrbin_execdir)
Filipe Brandenburger [Sat, 2 May 2015 06:27:13 +0000 (23:27 -0700)]
build-sys: install binaries in bindir (get rid of usrbin_execdir)

The "usrbin_execdir" hack meant to install some binaries in /bin and
others in /usr/bin. However:

- It is very inflexible: not much control on the final directory name
  and it is not possible to get rid of the usr/bin suffix without
  patching the build system.

- It is hard to use: it requires configure to receive --exec_prefix=/
  and other settings do not make much sense. It is not very obvious that
  that setting needs to be passed and it takes a while to figure it out.

- It produces garbage with the default setup: the default prefix of
  /usr/local ends up installing the binaries under /usr/local/usr/bin
  which does not make any sense.

Furthermore, the requirement to split binaries in /bin and /usr/bin is
not that strong since some distributions adopted the /usr merge and so
would agree to just deploy all binaries to /usr/bin directly.

Distributions that would still like to split /bin from /usr/bin should
actually move binaries such as `ps` and `kill` to /bin after the install
of procps-ng is complete. After all, they are the ones responsible for
determining what are the binaries that need to be in the root partition
and that list depends on their early boot init scripts, so it is
possible that the list must be augmented with other binaries from this
package.

Therefore, I propose here to get rid of that hack and simply install all
the binaries to bindir instead, which solves the problems described
above and simplifies the build and install of procps-ng.

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

Tested that `make install` works and produces the expected tree, the
only difference being the absence of the bogus /usr/local/usr/bin
directory and now all binaries are merged into /usr/local/bin as
expected.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
9 years agobuild-sys: enable "subdir-objects" automake option
Filipe Brandenburger [Fri, 1 May 2015 23:48:21 +0000 (16:48 -0700)]
build-sys: enable "subdir-objects" automake option

Otherwise, automake 1.14 will warn that this option will become the
default in an upcoming release, which will cause problems for the
procps-ng build.

Now that the automake rules were merged in the top level Makefile.am,
it is possible to enable "subdir-objects" without breaking the build or
the dist.

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

Tested that `make install` works and produces the same tree before and
after this change. Confirmed that binaries are also placed in the same
locations in the build tree.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
9 years agobuild-sys: merge automake subdirs into toplevel
Filipe Brandenburger [Sat, 2 May 2015 04:28:53 +0000 (21:28 -0700)]
build-sys: merge automake subdirs into toplevel

This will be required for subdir-objects, otherwise automake will have
problems with more than one Makefile.am having rules to build the same
files.

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

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

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

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
9 years agobuild-sys: drop unneeded $(top_srcdir) from source paths
Filipe Brandenburger [Sat, 2 May 2015 04:36:40 +0000 (21:36 -0700)]
build-sys: drop unneeded $(top_srcdir) from source paths

This is cleaner and we need to match paths exactly when we enable the
subdir-objects automake option.

Out-of-tree builds still work since automake is smart to know these are
source files and that it needs to look for them in $(top_srcdir), so
there is no need to make this explicit.

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

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
9 years agobuild-sys: split test cases in lib/ into their own files
Filipe Brandenburger [Sat, 2 May 2015 00:43:51 +0000 (17:43 -0700)]
build-sys: split test cases in lib/ into their own files

In order to avoid compiling the same source files twice, with and
without the TEST_PROGRAM define.

Tested that the build still works and that `make distcheck` works as
expected.

Tested that the test_* programs in lib/ keep working. (Though they are
not really invoked by `make check` and in particular test_nsutils is
quite useless, test_fileutils also quite poor.)

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
9 years agobuild-sys: remove AC_PROG_RANLIB from configure.ac
Filipe Brandenburger [Fri, 1 May 2015 23:42:33 +0000 (16:42 -0700)]
build-sys: remove AC_PROG_RANLIB from configure.ac

This suppresses the following warning from libtoolize 2.4.2:

  libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'

Tested that this does not break the build and that both `make check` and
`make distcheck` continue working as expected.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
9 years agobuild-sys: add $(top_srcdir) to include search dir
Filipe Brandenburger [Sat, 2 May 2015 00:09:39 +0000 (17:09 -0700)]
build-sys: add $(top_srcdir) to include search dir

This is required for out-of-tree build to work, since many source files
include e.g. proc/*.h which is not under the include/ directory.

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

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
9 years agotop: correct a small typo in manual page
Tobias Stoeckmann [Fri, 13 Feb 2015 18:00:00 +0000 (12:00 -0600)]
top: correct a small typo in manual page

Reference(s)
http://www.freelists.org/post/procps/PATCH-typo-in-top1

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agotop: miscellaneous accumulated changes to program code
Jim Warner [Sun, 1 Feb 2015 06:00:00 +0000 (00:00 -0600)]
top: miscellaneous accumulated changes to program code

This commit just tweaks top in the following respects:

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

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

. update program 'comments' reflecting copyright dates

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agotop: miscellaneous accumulated changes to man document
Jim Warner [Sun, 1 Feb 2015 06:00:00 +0000 (00:00 -0600)]
top: miscellaneous accumulated changes to man document

Signed-off-by: Jim Warner <james.warner@comcast.net>
9 years agofree: Use IEC units
Craig Small [Fri, 3 Apr 2015 08:18:58 +0000 (19:18 +1100)]
free: Use IEC units

Free always used 1024 based units but used the confusing old style
kilo,mega etc.

This change changes the names to kibi,mebi for 1024 based divisors
and kilo,mega for 1000 based divisors or IEC units.

It also checks if you try to set two units, e.g free -k -m
Petabyte and Pebibyte have been added.

If you used to use the long options such as --mega these will now
actually print megabytes (they previously printed mebibytes).
The short options are being used on the IEC units

References: https://www.gitorious.org/procps/procps/merge_requests/38

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agopgrep: Off by one in realloc in option handling
Vadim Kaushan [Fri, 3 Apr 2015 07:17:08 +0000 (18:17 +1100)]
pgrep: Off by one in realloc in option handling

The loop that parses options has a of by one bug where the realloc
adds one byte, instead of one list element.  This is exposed when
you try things like:
  pgrep -t,,,,

Signed-off-by: Craig Small <csmall@enc.com.au>
9 years agopgrep.1 removed STANDARDS section
Craig Small [Tue, 17 Mar 2015 11:43:22 +0000 (22:43 +1100)]
pgrep.1 removed STANDARDS section

pgrep got updated due to the confusion of the f,l and a flags.
While the newer behaviour is far better but it is no longer following
the ancient Solaris standards, so that got removed.

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

9 years agow: fixing missing '-' in the FROM field when empty
Jaromir Capik [Mon, 2 Mar 2015 17:41:07 +0000 (18:41 +0100)]
w: fixing missing '-' in the FROM field when empty

With 99bebff06a058f1ebf794fca1b358d0df73fdd35 a configurable
width of the FROM column was introduced. Unfortunately this
caused a regression in the dash printing. Hopefully fixed
with this commit.

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