Commit Graph

1535 Commits

Author SHA1 Message Date
dmarc-noreply@freelists.org
e40b0060c2 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>
2015-05-10 15:05:28 +10:00
dmarc-noreply@freelists.org
af6e264b46 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>
2015-05-10 15:05:02 +10:00
dmarc-noreply@freelists.org
e981f2bbd2 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>
2015-05-10 15:04:46 +10:00
Craig Small
e0256d1fd6 revert ps_sched checks for following commits 2015-05-10 15:04:19 +10:00
Craig Small
96dc43d72b Changed git site to gitlab 2015-05-10 14:57:50 +10:00
Craig Small
34a1194af8 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.
2015-05-09 17:53:08 +10:00
Craig Small
4050148a45 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.
2015-05-09 17:48:12 +10:00
Tobias Stoeckmann
c7abb6a6ed 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>
2015-04-07 20:46:15 +10:00
Jim Warner
e107f5d63b 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>
2015-04-07 20:46:15 +10:00
Jim Warner
8bcdd2145d top: miscellaneous accumulated changes to man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
2015-04-07 20:46:15 +10:00
Craig Small
f8e98b65ae 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>
2015-04-03 19:18:58 +11:00
Vadim Kaushan
6ed8cf3444 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>
2015-04-03 18:17:08 +11:00
Craig Small
fd77ca1dc6 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
2015-03-17 22:43:22 +11:00
Jaromir Capik
f71405b44d w: fixing missing '-' in the FROM field when empty
With 99bebff06a a configurable
width of the FROM column was introduced. Unfortunately this
caused a regression in the dash printing. Hopefully fixed
with this commit.
2015-03-02 18:41:07 +01:00
Jaromir Capik
a5937e4e94 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.
2015-02-25 18:40:53 +01:00
Craig Small
fe559b5b3b Updated translations
Signed-off-by: Craig Small <csmall@enc.com.au>
2015-01-24 19:09:33 +11:00
Craig Small
92071e963e 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>
2015-01-24 18:53:29 +11:00
Derek Fawcus
96c524990b '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>
2015-01-24 17:27:12 +11:00
Craig Small
7610b3128e 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>
2015-01-24 17:11:11 +11:00
Craig Small
fc7cb8dd4c Update NEWS with merge 33
Signed-off-by: Craig Small <csmall@enc.com.au>
2014-12-03 22:41:17 +11:00
Craig Small
3a66fba1e9 Merge commit 'refs/merge-requests/33' of git://gitorious.org/procps/procps into merge-requests/33 2014-11-08 17:03:51 +11:00
Jaromir Capik
76f2b442c6 docs: adding latest french man translations 2014-10-30 16:49:10 +01:00
Jim Warner
da06b8fa59 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 ce70017eb1

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-10-29 17:00:03 +01:00
Jim Warner
ce70017eb1 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>
2014-10-27 17:18:47 +01:00
Jim Warner
b0767bd391 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 8ef6cd91fc

Signed-off-by: Jim Warner <james.warner@comcast.net>
2014-09-29 08:22:13 +10:00
Jaromir Capik
00ec244114 docs: adding latest man translations 2014-09-23 13:40:36 +02:00
Yuri Chornoivan
6a5cf7aa77 docs: Fix typos in slabtop.1, sysctl.8 and uptime.1 2014-09-16 19:35:28 +02:00
Jaromir Capik
0bc60e5c27 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'.
2014-09-15 19:55:13 +02:00
Jaromir Capik
d6b8818238 docs: Committing new translations 2014-09-15 19:04:47 +02:00
Jaromir Capik
7e6ac6c868 build-sys: adding translated mans to dist 2014-09-15 18:57:40 +02:00
Yuri Chornoivan
955a003a2b docs: Fix typos in sysctl.8 and sysctl.conf.5 2014-09-15 16:24:59 +02:00
Jaromir Capik
d63ef52995 configure.ac: re-enabling the ALL_LINGUAS related checks 2014-09-15 15:30:08 +02:00
Craig Small
515ef90b93 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>
2014-09-12 23:04:33 +10:00
Jaromir Capik
05b42b0f3c watch: typo in man (closign->closing) 2014-09-12 14:22:48 +02:00
Craig Small
0bcfc19a08 Merge remote-tracking branch 'refs/remotes/origin/master' 2014-09-10 21:21:26 +10:00
Craig Small
6cd03d506a 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.
2014-09-10 21:19:24 +10:00
Jaromir Capik
3477439278 3.3.10 API 2014-09-09 18:35:44 +02:00
Jaromir Capik
60660219b8 NEWS: adding enhanced ANSI support in watch 2014-09-09 18:13:23 +02:00
Jaromir Capik
eae9b671c0 watch: avoid ansi manipulations in non-ansi mode 2014-09-08 18:28:08 +02:00
Jaromir Capik
578cce6730 watch: fixing uninitialized variable 2014-09-08 18:24:28 +02:00
Jaromir Capik
e428a27af9 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.
2014-09-08 15:50:24 +02:00
Jaromir Capik
0160bdb559 watch: fixing future italic support 2014-09-06 10:54:34 +02:00
Jaromir Capik
b3e36c552b watch: enhancing ANSI color & style support
This commit adds support for background colors
and additional ANSI styles (faint, italic,
underlined, blinking, inversed).
2014-09-06 10:52:38 +02:00
Eero Häkkinen
0f649e2cd2 pgrep: avoid SEGV when lightweight and list-full options are used together
do not segfault
2014-09-06 00:35:16 +03:00
Craig Small
a0561fb4eb Add french and polish translation 2014-09-04 21:22:20 +10:00
Mike Frysinger
dd979a83b0 ignore config.cache
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2014-08-28 19:16:00 +02:00
Jaromir Capik
cbd8cf7829 sysctl: finalizing the GLOB_* flags check
This commit properly resolves the merge conflict
caused by the following two commits:
fb6d4e6cb4
f8128568d6
2014-08-28 15:48:29 +02:00
Michael Forney
fb6d4e6cb4 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.
2014-08-28 15:07:01 +02:00
Michael Forney
007c438148 Also emulate error_at_line if not present 2014-08-28 13:54:24 +02:00
Michael Forney
d6a3a3d97e Handle 'none required' result from AC_SEARCH_LIBS 2014-08-28 13:39:22 +02:00