Craig Small [Tue, 22 Dec 2020 05:24:47 +0000 (16:24 +1100)]
Merge branch 'topimiettinen/procps-ps-sort-label'
References:
procps-ng/procps!99
Topi Miettinen [Wed, 11 Mar 2020 09:23:33 +0000 (11:23 +0200)]
ps: add lots of sorting functions
Use NULL in format_array to indicate that the print function shall be
used also for sorting. Change sr_nop() to NULL for all fields which
don't use pr_nop() for printing.
Before the commit (note that '--sort label' has no effect: the rows
are not sorted according to label field):
$ ps -A -o command,label --sort label | grep /lib/systemd
/lib/systemd/systemd-journa system_u:system_r:syslogd_t:s0
/lib/systemd/systemd-udevd system_u:system_r:udev_t:s0-s0:c0.c1023
/lib/systemd/systemd-networ system_u:system_r:systemd_networkd_t:s0
/lib/systemd/systemd-resolv system_u:system_r:systemd_resolved_t:s0
/lib/systemd/systemd-timesy system_u:system_r:ntpd_t:s0
/lib/systemd/systemd-logind system_u:system_r:systemd_logind_t:s0
/lib/systemd/systemd --user user_u:user_r:user_t:s0
/lib/systemd/systemd --user root:sysadm_r:sysadm_t:s0-s0:c0.c1023
grep /lib/systemd user_u:user_r:user_t:s0
After the commit, '--sort label' works and the output is sorted:
$ ps -A -o command,label --sort label | grep /lib/systemd
/lib/systemd/systemd --user root:sysadm_r:sysadm_t:s0-s0:c0.c1023
/lib/systemd/systemd-timesy system_u:system_r:ntpd_t:s0
/lib/systemd/systemd-journa system_u:system_r:syslogd_t:s0
/lib/systemd/systemd-logind system_u:system_r:systemd_logind_t:s0
/lib/systemd/systemd-networ system_u:system_r:systemd_networkd_t:s0
/lib/systemd/systemd-resolv system_u:system_r:systemd_resolved_t:s0
/lib/systemd/systemd-udevd system_u:system_r:udev_t:s0-s0:c0.c1023
/lib/systemd/systemd --user user_u:user_r:user_t:s0
grep /lib/systemd user_u:user_r:user_t:s0
Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
Craig Small [Tue, 22 Dec 2020 05:08:49 +0000 (16:08 +1100)]
pgrep: Remove memory leak
This is part of !118 where @tt.rantala found a memory leak.
The other part of !118 may come later if the performance change
is significant.
References:
procps-ng/procps!118
Craig Small [Tue, 22 Dec 2020 04:43:07 +0000 (15:43 +1100)]
Merge branch 'axxName/procps-master'
References:
procps-ng/procps!63
Alexandr Miasnikov [Fri, 27 Apr 2018 13:27:17 +0000 (13:27 +0000)]
If you use echo -e $(put sgr0)"text" - reset color attributes, it turns out the artifact (Btext
Craig Small [Tue, 22 Dec 2020 04:31:39 +0000 (15:31 +1100)]
ps: Add NEWS and test for exe output
Only need this for master, as Jim took care of exe
handling for newlib in the ad4269 change.
References:
commit
b556bf5ba82c7e593eb682bbf836c2bc444b2e7d
commit
ad4269f1189d5a7d68765e291bcfa981b6731c25
Jan Rybar [Fri, 8 Jun 2018 14:38:14 +0000 (16:38 +0200)]
ps: new format option 'exe' now shows executable path if unavail from cmdline
Red Hat Bugzilla #
1399206
Craig Small [Tue, 22 Dec 2020 04:20:30 +0000 (15:20 +1100)]
build-sys: Make pwait test dependent on pwait built
As pwait building is conditional, testsuite should
only run pwait tests if there is a pwait binary.
Craig Small [Tue, 22 Dec 2020 03:59:47 +0000 (14:59 +1100)]
Merge branch 'awilfox/procps-utmpx-support'
References:
procps-ng/procps!67
A. Wilcox [Sat, 16 Jun 2018 07:26:53 +0000 (02:26 -0500)]
w: Use POSIX <utmpx.h> functions where available
<utmp.h> has been deprecated since 2001 in favour of <utmpx.h>.
On glibc systems, utmp is just an alias to utmpx, so there is no
functional change using one over the other.
However, on the musl libc, a library (utmps) can be used to provide
utmpx functionality - but not utmp. This means that procps either
doesn't work properly (`w` shows nothing under musl with default no-op
implementation), or fails to build (utmps provides utmpx.h but no
utmp.h).
This commit will use utmpx.h where available, which allows `w` to work
correctly with utmps and has no change on glibc systems.
Craig Small [Tue, 22 Dec 2020 03:32:26 +0000 (14:32 +1100)]
Merge branch 'teknoraver/procps-master'
References:
procps-ng/procps!83
Craig Small [Tue, 22 Dec 2020 03:32:03 +0000 (14:32 +1100)]
NEWS: Add notice for pidof -q
Matteo Croce [Tue, 19 Mar 2019 13:33:01 +0000 (14:33 +0100)]
pidof: allow to suppress output
Often pidof is used in shell scripts in this form:
if pidof daemon >/dev/null; then
...
fi
The redirection to /dev/null is needed because otherwise the script
would output the found PIDs.
Let's add a -q option which, similary to grep, just sets the exit code.
Also exit on first match, as there is no reason to proceed further when
at least a process is matched.
Tested with:
$ ./pidof bash
17701 14019 5276 2967
$ echo $?
0
$ ./pidof bashx
$ echo $?
1
$ ./pidof -q bash
$ echo $?
0
$ ./pidof -q bashx
$ echo $?
1
Raphaël Jakse [Fri, 7 Sep 2018 12:57:03 +0000 (12:57 +0000)]
kill: Fix argument handling for negative PIDs
Craig Small [Tue, 22 Dec 2020 02:54:50 +0000 (13:54 +1100)]
Merge branch 'nipunn1313/procps-watch_colors2'
References:
procps-ng/procps!109
Nipunn Koorapati [Mon, 13 Jul 2020 02:08:26 +0000 (02:08 +0000)]
Supporting bright colors with ncurses
Nipunn Koorapati [Thu, 2 Jul 2020 06:05:24 +0000 (06:05 +0000)]
Support simple 8 bit ansi escape sequences
See https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
Support standard and high intensity colors. The default
ncurses colors ARE the high intensity colors - represented
via an 8 bit ansi escape sequence here.
Craig Small [Tue, 22 Dec 2020 02:48:15 +0000 (13:48 +1100)]
Merge branch 'nipunn1313/procps-watch_colors'
References:
procps-ng/procps!106
Nipunn Koorapati [Mon, 13 Jul 2020 03:20:23 +0000 (03:20 +0000)]
Spaces to tabs
Nipunn Koorapati [Mon, 13 Jul 2020 00:59:29 +0000 (00:59 +0000)]
Add comments and limit to standard colors
Nipunn Koorapati [Thu, 2 Jul 2020 07:45:29 +0000 (07:45 +0000)]
bugfix - increment endpointer when parsing color_escape_sequence
Nipunn Koorapati [Thu, 2 Jul 2020 06:05:24 +0000 (06:05 +0000)]
Support simple 8 bit ansi escape sequences
See https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
Support standard and high intensity colors. The default
ncurses colors ARE the high intensity colors - represented
via an 8 bit ansi escape sequence here.
Craig Small [Tue, 22 Dec 2020 02:18:58 +0000 (13:18 +1100)]
Merge branch 'antonblanchard/procps-proc-stat-buffer'
References:
procps-ng/procps!105
Anton Blanchard [Thu, 25 Jun 2020 23:06:12 +0000 (09:06 +1000)]
Increase BUFFSIZE to handle very large /proc/stat files
We read /proc/stat using a statically sized buffer. This was increased
to 64kB in 2005 via commit
777fcd3cf15d "/proc/stat for 1024 CPUs".
Unfortunately in 2020, 1024 CPUs is not enough for anyone. I have a
large machine where /proc/stat is 74kB, and vmstat gives incorrect
output.
Double the buffer to 128kB in the confidence that 2048 CPUs is actually
enough for anyone.
Signed-off-by: Anton Blanchard <anton@ozlabs.org>
Craig Small [Tue, 22 Dec 2020 01:25:44 +0000 (12:25 +1100)]
testsuite: Add pwait tests
They're pretty simple tests but its something.
References:
commit
09327c2b772fd7bc2762c557855e6a78b6352eb5
Craig Small [Tue, 22 Dec 2020 01:16:09 +0000 (12:16 +1100)]
Merge branch 'alxu/procps-pwait'
New command, pwait! Waits for another process to finish just like
pgrep finds or pkill kills another process.
References:
procps-ng/procps!97
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Alex Xu (Hello71) [Mon, 24 Feb 2020 03:02:59 +0000 (22:02 -0500)]
pgrep: add pwait
Craig Small [Tue, 22 Dec 2020 00:55:10 +0000 (11:55 +1100)]
Merge branch 'nipunn1313/procps-spaces_to_tabs'
References:
procps-ng/procps!108
Nipunn Koorapati [Mon, 13 Jul 2020 03:24:53 +0000 (03:24 +0000)]
Convert spaces to tabs in watch.c
Craig Small [Tue, 22 Dec 2020 00:45:47 +0000 (11:45 +1100)]
Merge branch 'nipunn1313/procps-configure_ncurses'
Macs have the wide stuff in the ncurses (not ncursesw) library.
References:
procps-ng/procps!110
procps-ng/procps#47
Nipunn Koorapati [Mon, 13 Jul 2020 05:08:24 +0000 (22:08 -0700)]
watch: Support wide char ncurses on mac with enable-watch8bit
Fixes #47
Samanta Navarro [Sat, 3 Oct 2020 11:26:22 +0000 (11:26 +0000)]
misc: fix typos in manual pages
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Jan Rybar [Fri, 6 Nov 2020 14:45:56 +0000 (14:45 +0000)]
pkill manpage to document '-e' option
Jan Rybar [Tue, 22 Dec 2020 00:14:41 +0000 (00:14 +0000)]
pidof: new option to show cmdline-less PIDs (kernel workers), empty input fixed
Craig Small [Tue, 22 Dec 2020 00:08:52 +0000 (11:08 +1100)]
Merge branch 'brenns10/procps-master'
References:
procps-ng/procps!119
Stephen Brennan [Fri, 20 Nov 2020 00:03:58 +0000 (16:03 -0800)]
Set TZ to avoid repeated stat("/etc/localtime")
With glibc, each time the strftime() function is used (twice per process
in a typical ps -fe run), a stat("/etc/localtime") system call is used
to determine the timezone. Not only does this add extra system call
overhead, but when multiple ps processes are trying to access this
file (or multiple glibc programs using strftime) in parallel, this can
trigger significant lock contention within the OS kernel.
Since ps is not intended to run for long periods of time as a
daemon (during which the system timezone could be altered and PS might
reasonably be expected to adapt its output), there is no benefit to
repeatedly doing this stat(). To stop this behavior, explicitly set the
TZ variable to its default value (:/etc/localtime) whenever it is unset.
glibc will then cache the stat() result.
Craig Small [Tue, 22 Dec 2020 00:03:57 +0000 (11:03 +1100)]
Merge branch 'ratijas/procps-man-watch'
References:
procps-ng/procps!121
ivan tkachenko [Sun, 6 Dec 2020 11:17:23 +0000 (14:17 +0300)]
docs: Consistent style across watch.1
Craig Small [Mon, 21 Dec 2020 23:55:18 +0000 (10:55 +1100)]
misc: Document sysctl change bug
While sysctl did change the order of /run and /etc to match
systemd in the referenced commit, the Debian bug report that
brought it to light was not documented.
References:
commit
24a1574f0acbe636c98ab13b439c93f7b91de697
https://bugs.debian.org/950788
Jim Warner [Mon, 19 Oct 2020 05:00:00 +0000 (00:00 -0500)]
top: a small safeguard added to the ATEOJ_RPTHSH logic
If a hash results report was output (via ATEOJ_RPTHSH)
a portion is devoted to occupied table entries ordered
by depth. There is a possibility that some depths will
not be found among existing occupied table entries and
to avoid any confusion probably should not be printed.
[ to illustrate the potential for confusion prior to ]
[ this patch, force a very small table size (like 8) ]
[ and then arrange to trigger the end-of-job report. ]
So this patch ensures only 'in use' entries are shown.
[ admittedly, all of the remaining logic in the loop ]
[ could/should be subordinate to this new 'if' test, ]
[ but we will keep the change to a minimum. besides, ]
[ there's no harm subtracting/adding a zero numdepth ]
[ especially since the chance of a zero is very low. ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
Craig Small [Mon, 19 Oct 2020 11:36:06 +0000 (22:36 +1100)]
free,slabtop,uptime: complain about extra ops
free, slabtop and uptime would happily take extra command line
arguments and doing nothing about them. The programs now check
optind after option processing and will give you usage screen
if there is anything extra.
References:
procps-ng/procps#181
Craig Small [Mon, 19 Oct 2020 11:03:44 +0000 (22:03 +1100)]
watch: Add no linewrap option
For long lines from a process, watch would wrap them around to the
next. While this default option has it uses, sometimes you want to
just cut those long lines down.
watch has a -w flag which will truncate the lines to the number
of columns. A few simple lines to do this new trick.
I think I caught all the ANSI state correctly but there might be
a chance it bleeds to the next row.
References:
procps-ng/procps#182
Jim Warner [Thu, 1 Oct 2020 05:00:00 +0000 (00:00 -0500)]
top: just a small tweak to that history hash algorithm
This patch just raises the size of the hash table used
to calculate elapsed task stuff. The net result should
be less need for 'chaining' under pid hash collisions.
[ the hash scheme is intentionally kept as primitive ]
[ and, therefore, as fast as possible. it employs an ]
[ 'and' approach versus a 'mod' operation since both ]
[ yield similar distribution but the former approach ]
[ was 4 fewer cpu instructions in terms of overhead. ]
[ additionally, for hash collisions, 'chaining' uses ]
[ an array index rather than the usual pointer since ]
[ the HST_t guys may move when they are reallocated. ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
Craig Small [Thu, 24 Sep 2020 12:01:22 +0000 (22:01 +1000)]
ps: Match on truncated 16 char for -C
The referenced commit the comm length was increased from 16 to 64
characters to handle the larger command names for things like kernel
threads.
However most user processes are limited to 15 characters which means
if you try something like ps -C myprogramisbiggerthansixteen this would
fail to match because /proc/<PID>/comm would only be myprogramisbigg
ps now checks the comm length and if it is 15 and if the given match
is 15 or more, it will only match the first 15 characters.
This is also how killall has worked for about a year.
Thanks to Jean Delvare <jdelvare@suse.de> for the note.
References:
commit
14005a371e5c14289e96a4927ffd1a827d3c9d85
commit psmisc/psmisc@
1188315cd037d73bf946a0003b70c6423cc330d2
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Jim Warner [Sun, 13 Sep 2020 05:00:00 +0000 (00:00 -0500)]
top: fix additional SEGVs if no tasks were displayable
This patch is an outgrowth of that commit shown below.
Many additional potential segmentation faults might be
encountered if interactive commands are opened up to a
user when a '-p' switch has a single non-existent pid.
[ always the 'k', 'L', 'r', 'Y' keys & maybe 'v' too ]
So, this patch will restrict such a loser (oops, user)
to a reduced subset of normal commands until he/she/it
quits then restarts top with something to be displayed
or issues the '=' command overriding that '-p' switch.
Reference(s):
commit
f57a0301e3adfa5fd456404a200182c7f21da03a
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Wed, 9 Sep 2020 05:00:00 +0000 (00:00 -0500)]
top: fix potential SEGV when no tasks were displayable
This patch fixes a nearly decade old bug discovered by
Frederik Deweerdt. His merge request shown below would
be an adequate solution except for iterative overhead.
This alternate patch will represent substantially less
overhead for an admittedly extremely rare possibility.
Reference(s):
https://gitlab.com/procps-ng/procps/-/merge_requests/114
And-thanks-to: Frederik Deweerdt <fdeweerdt@fastly.com>
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Tue, 8 Sep 2020 05:00:00 +0000 (00:00 -0500)]
top: update user/system cpu % graph content (man page)
What had been stated as the contents of the cpu graphs
was never really inclusive enough. Those recent newlib
tweaks highlighted the need for these man doc changes.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sun, 30 Aug 2020 05:00:00 +0000 (00:00 -0500)]
build-sys: updated autoscan for that configure.ac file
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Fri, 21 Aug 2020 05:00:00 +0000 (00:00 -0500)]
top: even more useless cosemetic stuff (only comments)
[ this is what happens when i've run out of bugs and ]
[ issues and am now left with way too much free time ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 20 Aug 2020 05:00:00 +0000 (00:00 -0500)]
top: more useless cosemetic changes (chiefly comments)
All of these changes are self-explanatory, so I'll not
provide any more comments thus avoiding further shame.
[ everything's perfectly justified and right margins ]
[ are filled entirely, but of course it must be luck ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sat, 25 Jul 2020 05:00:00 +0000 (00:00 -0500)]
misc: eliminate a couple of miscellaneous gcc warnings
This commit just addresses those warnings shown below.
Reference(s):
proc/sysinfo.c: In function `getrunners':
proc/sysinfo.c:491:26: warning: `%s' directive writing up to 255 bytes into a region of size 26 [-Wformat-overflow=]
491 | sprintf(tbuf, "/proc/%s/stat", ent->d_name);
| ^~
pgrep.c: In function `select_procs':
pgrep.c:591:11: warning: suggest explicit braces to avoid ambiguous `else' [-Wdangling-else]
591 | else if (opt_older)
| ^
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 23 Jul 2020 05:00:00 +0000 (00:00 -0500)]
top: for consistency, reposition a few man page macros
This patch just repositions some .PP macros so they'll
immediately precede the paragraphs to which they apply
rather than a comment line used as a visual separator.
[ ok we also update the document date to 'July 2020' ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Tue, 14 Jul 2020 05:00:00 +0000 (00:00 -0500)]
build-sys: suppress '-Wunused-result' with AM_CPPFLAGS
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Fri, 10 Jul 2020 05:00:00 +0000 (00:00 -0500)]
top: address several 'mandoc -Tlint' errors & warnings
This commit addresses the errors/warnings shown below.
Reference(s):
ERROR: skipping end of block that is not open: RE
WARNING: skipping paragraph macro: sp after PP
WARNING: skipping paragraph macro: PP empty
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 9 Jul 2020 05:00:00 +0000 (00:00 -0500)]
top: make that 'cpu_prt' function a tad more efficient
This commit only eliminates two 'nop' instructions and
one 'jmp' instruction. However, it makes that C source
code look a little bit prettier than it looked before.
[ and yes, some unnecessary parenthesis were used to ]
[ force an alignment of some related lines. it costs ]
[ us nothing in extra code yet helps in readability. ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Wed, 8 Jul 2020 05:00:00 +0000 (00:00 -0500)]
top: make the 'cpu_tics' function a tad more efficient
This patch eliminates one variable which resulted in a
corresponding elimination of three 'mov' instructions.
[ that was 6 bytes per 'mov' for a total of 18 bytes ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
Craig Small [Tue, 30 Jun 2020 22:04:51 +0000 (08:04 +1000)]
Merge branch 'jrybar/procps-vmstat-watch-manpage-fix'
References:
procps-ng/procps!103
Jan Rybar [Thu, 30 Apr 2020 15:06:18 +0000 (17:06 +0200)]
vmstat and watch manpage slight fixes
vmstat - align wording with proc manpage to clarify ambiguities (rhbz#
1796043)
watch - manpage presumes ntp tools are present by default (which they're not on rpm and deb distros, rhbz#
1583669)
Jim Warner [Fri, 26 Jun 2020 05:00:00 +0000 (00:00 -0500)]
top: raise the amount by which top's stat buffer grows
We won't go as far as the merge request shown below in
increasing buffer size, but we'll reduce substantially
total iterations while growing it to achieve one read.
[ and this seems in line with what was recently done ]
[ to accommodate the massively parallel environments ]
[ thru 2 abreast ('4') and combined cpus ('!') modes ]
Reference(s:
https://gitlab.com/procps-ng/procps/-/merge_requests/105
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 25 Jun 2020 05:00:00 +0000 (00:00 -0500)]
NEWS: updated for those recent utf-8 translation fixes
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Fri, 19 Jun 2020 05:00:00 +0000 (00:00 -0500)]
top: provide for zero length character in utf8 support
This commit is prompted by the preceding change to the
library's escape.c module which, in turn, was prompted
by that issue shown below (with thanks to Konstantin).
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/176
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 18 Jun 2020 05:00:00 +0000 (00:00 -0500)]
library: correct that 'escape_str_utf8' guy's behavior
Thanks to Konstantin for discovering 2 problems in the
issue referenced below. That 15+ year old logic went a
little too far overboard wrestling with a utf8 string.
Henceforth, we will not treat 'x9b' as special. And we
also will handle a 'combining acute accent' correctly.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/176
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Tue, 16 Jun 2020 05:00:00 +0000 (00:00 -0500)]
top: some miscellaneous accumulated tweaks and cleanup
I've grown to hate that man document rendering when it
comes to hyphenation. So this patch will eliminate it.
And we'll also eliminate an unnecessary initialization
in that top program code concerned with combined cpus.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Craig Small [Thu, 4 Jun 2020 12:25:26 +0000 (22:25 +1000)]
docs: some manpage fixes
Some editorial changes so the man pages follow the standards.
References:
procps#173
Jim Warner [Sun, 31 May 2020 05:00:00 +0000 (00:00 -0500)]
top: fix a minor startup flaw for the '2 abreast' mode
This ensures that a single '4' keystroke will reliably
toggle the new 2 abreast mode ON. Depending on whether
an older configuration file existed or whether top was
configured with '--disable-modern-top', keying the '4'
for a second time might otherwise have been necessary.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sat, 30 May 2020 05:00:00 +0000 (00:00 -0500)]
top: help the '#define PRETEND48CPU' be more realistic
The previous PRETEND8CPUS #define was recently changed
to PRETEND48CPU to better exercise the new '4' and '!'
toggles. But, the implementation simply duplicated the
/proc/stat summary line for each cpu. Therefore, every
cpu showed the same graph/detail (depending upon 't').
This patch shows the actual individual cpu information
(duplicated, of course, when total cpus are exceeded).
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Fri, 29 May 2020 05:00:00 +0000 (00:00 -0500)]
top: preserved those new '4' and '!' toggles in rcfile
This patch will address Craig's feedback regarding the
original implementation of top's two new toggles. It's
likely other users would have questioned why they were
not saved also, once they discover these new features.
And, since the minimum terminal width was just lowered
to 80 columns, the default for window #1 is also being
changed to show the individual cpu graphs two abreast.
[ assuming no '--disable-modern-top' for ./configure ]
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
https://www.freelists.org/post/procps/two-major-changes-to-top,1
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Fri, 29 May 2020 05:00:00 +0000 (00:00 -0500)]
top: warn users if rcfile save prevents older top read
I'm about to break older top rcfile compatibility when
preserving those two new toggles. And, though this has
happened several times over the years, we never issued
any warnings that such thing was just about to happen.
So, this patch corrects the long standing shortcoming.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 28 May 2020 05:00:00 +0000 (00:00 -0500)]
top: reduce minimum terminal width with 2 abreast mode
For the original implementation of the '4' toggle, the
minimum width was set at 165 columns. This was done to
avoid truncations when detailed cpu statistics (versus
graphs) were being displayed. Those can not be scaled.
Upon reflection, it seems more appropriate to give the
user the choice of whether or not to truncate. And, by
reducing that minimum width requirement to 80 columns,
we'll vastly expand potential use of two abreast mode.
[ we'll keep that original as '#define TOG4_NOTRUNC' ]
The patch also updates the man document appropriately.
Along the way, we will trade the potentially confusing
word 'adjacent' for the more natural 'additional' when
detailing the '!' toggle in 4b. Summary-Area-Commands.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
https://www.freelists.org/post/procps/two-major-changes-to-top
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Wed, 27 May 2020 05:00:00 +0000 (00:00 -0500)]
top: address each of the most recent coverity warnings
This patch attempts to supress the following warnings:
. MISSING_BREAK, TAINTED_SCALAR plus SIZEOF_MISMATCH .
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Mon, 25 May 2020 05:00:00 +0000 (00:00 -0500)]
NEWS: acknowledge those two new top command provisions
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Sun, 24 May 2020 05:00:00 +0000 (00:00 -0500)]
top: bump up that PRETEND8CPUS #define to PRETEND48CPU
This patch simply allows for better testing of our two
new toggles: '4' (2 abreast) plus '!' (combined cpus).
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 21 May 2020 05:00:00 +0000 (00:00 -0500)]
top: add '!' toggle for combined cpus display, man doc
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Thu, 21 May 2020 05:00:00 +0000 (00:00 -0500)]
top: add '!' toggle for combined cpus display, program
When implementing that earlier '4' toggle, in response
to the issue referenced below, I got to thinking about
those environments with massively parallel processors.
Such environments may not benefit from the '4' toggle.
So, I decided to implement a feature that could enable
use of those '1' and/or '4' toggles no matter how many
active processors top may have ultimately encountered.
With the new '!' toggle, adjacent cpus can be combined
to any degree, represented as a single cpu group/line.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Wed, 13 May 2020 12:02:43 +0000 (07:02 -0500)]
top: add '4' toggle for 2 abreast cpu display, man doc
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Wed, 13 May 2020 05:00:00 +0000 (00:00 -0500)]
top: add '4' toggle for 2 abreast cpu display, program
In the back of my mind, I've always wanted to enable a
two abreast cpu display. Folks with massively parallel
machines must surely have been frustrated with the '1'
toggle when Off (individual cpus in the Summary Area).
So, I'll use that recently raised issue shown below as
a justification for finally implementing this feature.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
Signed-off-by: Jim Warner <james.warner@comcast.net>
Jim Warner [Tue, 5 May 2020 05:00:00 +0000 (00:00 -0500)]
top: eliminate a long standing extraneous comment line
Wow, hard to believe the extraneous comment line dates
all way back to an introduction of NLS support (2011).
Signed-off-by: Jim Warner <james.warner@comcast.net>
Craig Small [Fri, 22 May 2020 07:11:13 +0000 (17:11 +1000)]
build-sys: Some version fixes
tarball-version should be shipped in tarball
version is not.
Craig Small [Sun, 17 May 2020 12:00:51 +0000 (22:00 +1000)]
NEWS: add pgrep older than item
Craig Small [Sun, 17 May 2020 11:54:55 +0000 (21:54 +1000)]
Merge branch 'edneville/procps-master'
References:
procps-ng/procps!79
ed [Thu, 21 Mar 2019 21:32:22 +0000 (21:32 +0000)]
pgrep.c: simplifying uptime call
ed [Thu, 21 Mar 2019 20:21:09 +0000 (20:21 +0000)]
pgrep.c: Replacing seconds_since_boot with uptime as suggested by Craig Small
ed [Fri, 9 Nov 2018 22:03:17 +0000 (22:03 +0000)]
pgrep.c: change to allow 'older than' style selection
pgrep.1: man page addition for above selection
Makefile.am: addition of global.c to include sections since boot in pgrep.
Craig Small [Tue, 12 May 2020 09:22:48 +0000 (19:22 +1000)]
Merge branch 'awesomeclaw/procps-master'
References:
procps-ng/procps!62
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Harry Wagstaff [Mon, 23 Apr 2018 10:43:47 +0000 (11:43 +0100)]
Add information on WATCH_INTERVAL env var to watch documentation
Harry Wagstaff [Mon, 23 Apr 2018 10:34:08 +0000 (11:34 +0100)]
Add ability to specify watch interval using environment variable WATCH_INTERVAL
Craig Small [Tue, 12 May 2020 08:57:26 +0000 (18:57 +1000)]
vmstat: Add NEWS and revert comment from prev
Reverted the translation hint as the fields are used for both
normal and wide modes, so need to fit the smaller of the two.
Added NEWS item
References:
commit
01c1b2345ee952c28a9995c5766839f43f8e5ac9
Craig Small [Tue, 12 May 2020 08:52:03 +0000 (18:52 +1000)]
Merge branch 'isj4/procps-mode_wide_columns'
References:
procps-ng/procps!48
Ivan Skytte Jørgensen [Thu, 8 Jun 2017 12:14:50 +0000 (14:14 +0200)]
Use wide columns for r/b too in wide mode
2 digits are not enough for number of runnable/blocked processes on modern
systems. Changed to 4 digits with given the -w option.
Craig Small [Mon, 11 May 2020 07:43:12 +0000 (17:43 +1000)]
Merge branch 'swiggett/procps-patch-1'
References:
procps-ng/procps!34
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Dylan Swiggett [Tue, 29 Nov 2016 22:34:37 +0000 (22:34 +0000)]
Fixes small bug in struct proc_t documentation.
From http://man7.org/linux/man-pages/man5/proc.5.html:
(22) starttime %llu
The time the process started after system boot. In
kernels before Linux 2.6, this value was expressed
in jiffies. Since Linux 2.6, the value is expressed
in clock ticks (divide by sysconf(_SC_CLK_TCK)).
Craig Small [Tue, 28 Apr 2020 09:40:07 +0000 (19:40 +1000)]
build-sys: Enable testing of sigqueue
The referenced commits enavled both pkill and kill to send an integer to
the killed or signalled process. The test_process now will report on the
integer if sent and the testsuite changes take advantage of this
new feature.
Another process make/destroy set had to be made as using spawn
instead of exec changes both the SID and TTY for the underlying
process, making other tests fail.
References:
commit
7d55409b82602dac540c011000c9c5abedb5158a
commit
2b804a532a90a98bccc5255a728da9076a5e4f4f
Arun Chandrasekaran [Sat, 25 Apr 2020 03:15:06 +0000 (13:15 +1000)]
pgrep: use sigqueue to pass value with the signal.
Based on the command line option, use 'sigqueue'
instead of 'kill' to pass the integer value with
the signal.
References:
procps-ng/procps!32
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Craig Small [Fri, 24 Apr 2020 09:29:34 +0000 (19:29 +1000)]
kill: Adjust documentation for sigqueue
Added NEWS item
Changed the section for sigqueue as its 3 for me.
Arun Chandrasekaran [Fri, 24 Apr 2020 09:22:47 +0000 (19:22 +1000)]
kill: use sigqueue to pass value with the signal.
New -q/--queue option for kill so it will send an integer to the
signalled process. See sigqueue(3) for details.
References:
https://pubs.opengroup.org/onlinepubs/
009695399/functions/sigqueue.html
procps-ng/procps!32
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Wieland Hoffmann [Fri, 17 Apr 2020 09:50:46 +0000 (09:50 +0000)]
INSTALL.md: Replace blockquotes with code blocks
The previous syntax (`> `) is for blockquotes, which don't keep newlines when
rendered. Codeblocks (` ` at the beginning of the line) do.
Craig Small [Fri, 24 Apr 2020 07:42:58 +0000 (17:42 +1000)]
free: Adjust space to really use 9 chars
@steffhip found that while the translation hint said use 9 characters in
the free headers, it really was only 7.
Currently each line is constructed with the following (in non wide format):
Header + 6 Columns. The header takes 7 characters and each column is 11
characters wide and prefixed with one space. Thus we have
7 + (1 + 11) * 6 = 79 characters for each line
By dropping the leading space for the first column after the header -the
header is already terminated by a colon- one could indeed provide the needed
9 letters for the header and thus have 9 + 11 * 1 + (1 + 11) * 5 = 80 Chars
per line which would fit into one line.
Craig Small [Fri, 24 Apr 2020 07:29:08 +0000 (17:29 +1000)]
Merge branch 'utoddl/procps-master'
References:
procps-ng/procps!78
Todd Lewis [Mon, 29 Oct 2018 18:33:48 +0000 (18:33 +0000)]
Fix user and group name to number conversion for uid/gid above 2^31.
Jim Warner [Wed, 15 Apr 2020 05:00:00 +0000 (00:00 -0500)]
top: updated man page and copyright dates to year 2020
Signed-off-by: Jim Warner <james.warner@comcast.net>