]> granicus.if.org Git - procps-ng/log
procps-ng
2 years agotop: distinct separator if two abreast summary display
Jim Warner [Sun, 18 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: distinct separator if two abreast summary display

When displaying detailed memory statistics two abreast
data for the lines are less than those for cpus. So we
can exploit such a difference to provide a distinctive
separator. This may help separating cpu & memory data.

[ in truth, this happened before this patch. what we ]
[ are doing now is polishing that accidental feature ]
[ and placing it under the control of a conditional. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: harden detailed stats two abreast summary display
Jim Warner [Sun, 18 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: harden detailed stats two abreast summary display

When displaying detailed cpu statistics, as opposed to
those scalable graphs, only two per line can be shown.

Therefore, if we are showing a detail version, our '4'
toggle must prematurely revert to single mode display.

Conversely, the 't' toggle must also turn off that '4'
toggle rather than try to print more than 2 abreast if
we're currently executing in detailed statistics mode.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: refined memory graphs two abreast summary display
Jim Warner [Mon, 12 Sep 2022 18:13:13 +0000 (13:13 -0500)]
top: refined memory graphs two abreast summary display

When more than two cpus are displayed per summary area
line in graph form, those memory graphs were scaled to
that same width for consistency & aesthetics. However,
they probably shouldn't have been reduced to less than
terminal width due to a resulting loss of information.

[ after all, detailed memory stats are never reduced ]

So now, supporting logic was refactored to behave just
as it did before the 4 toggle was expanded beyond '1'.

[ the changes impact the 2 memory graphs exclusively ]

Reference(s):
https://www.freelists.org/post/procps/top-enhancements-2-bugs-swatted,1

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: additional tweaks for two abreast summary display
Jim Warner [Mon, 12 Sep 2022 13:00:00 +0000 (08:00 -0500)]
top: additional tweaks for two abreast summary display

This patch just supplements the previous series with a
few minor tweaks representing some diverse objectives:

. a recent date for man page (which i always overlook)

. improved length calculations to maximize graph width

. a proper response to platforms with less than 8 cpus

. more consistency and readability with one blank line

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: top now has more than two abreast summary display
Jim Warner [Sat, 10 Sep 2022 05:00:00 +0000 (00:00 -0500)]
doc: top now has more than two abreast summary display

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: implemented more than two abreast summary display
Jim Warner [Sat, 10 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: implemented more than two abreast summary display

Well, here it is. This is what the preceding series of
commits was leading to: an ability to show up to eight
cpus per Summary Area line. In reality, a self imposed
limit of four cpus on such lines seems more realistic.

In any case, the new capability could also be employed
along with that '!' toggle which consolidates adjacent
cpus into a solitary graph. When used together the '4'
and '!' toggles should accommodate any number of cpus.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: prepare for more than two abreast summary display
Jim Warner [Sat, 10 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: prepare for more than two abreast summary display

I guess the cat's out of the bag with the prior commit
message. It mentioned the objective of displaying more
than the current two cpu graphs on summary area lines.

On the way to that objective, this patch just prepares
our battlefield for the actual implementation in which
up to 8 individual cpu graphs will be shown on 1 line.

[ no logic has been impacted with this commit. we're ]
[ just adding one manifest constant, trading several ]
[ identifiers and updating some comments so the next ]
[ commit might be just a little bit more manageable. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: better graphic scaling in cpu/mem summary display
Jim Warner [Fri, 9 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: better graphic scaling in cpu/mem summary display

This program has always been sensitive to the width of
a terminal/console. The detailed cpu/memory statistics
plus all of those full screen replacement windows were
designed to fit within some 80 column, 24 row display.

When a user narrowed a gui terminal to less than those
dimensions, top would simply truncate the data to fit.
However, when displaying cpu/mem graphs instead of the
detailed statistics such truncation was not justified.
After all, such graphs were already scaled to 80 cols.

Henceforth, when in graph mode, truncation won't occur
until the graphs will no longer fit within 10 columns.

[ can you keep a secret? this change is really being ]
[ made in anticipation of showing more than just two ]
[ cpu graphs in the summary area on each screen row! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: refactor graph support of cpu/mem summary display
Jim Warner [Fri, 9 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: refactor graph support of cpu/mem summary display

The logic (illogic?) in the sum_tics() and do_memory()
functions has grown to become almost unfathomable over
time. Additionally, though perhaps not apparent in the
code, many steps are duplicated within those routines.

So, this patch refactors all the summary graph support
to consolidate duplicated code and (hopefully) make it
more understandable with an eye to future maintenance.

[ additionally, that show_special guy's workload has ]
[ been reduced by eliminating any special directives ]
[ previously embedded in some cpu graphs even though ]
[ a cpu may have been idle during the last interval. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: eliminate that 'TOG4_NOTRUNC' compile conditional
Jim Warner [Thu, 8 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: eliminate that 'TOG4_NOTRUNC' compile conditional

When 2 abreast cpu display was introduced, the minimum
screen width was 160 columns so as to avoid (minimize)
truncation. Later that was reduced to 80 columns while
keeping the original minimum as a compile conditional.

In preparation for (virtually) eliminating these width
restrictions in a future patch this #define's history.

Reference(s):
. May, 2020 - introduced #define TOG4_NOTRUNC
commit be3dcaa842cb64859e356d350c17de34932e5f1b
. May, 2020 - introduce 2 abreast display
commit 59f5a37a247184b3009af963706ca68198067185

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: eliminate that 'TOG4_NOFORCE' compile conditional
Jim Warner [Thu, 8 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: eliminate that 'TOG4_NOFORCE' compile conditional

When two abreast display was introduce, in that commit
shown below, this #define provision was also added. It
actually was an artifact left from program development
and never made much sense in a real world application.

If activated it would make the '4' toggle appear to be
broken since it would only take affect if a user first
activated individual cpu display (the '1' toggle off).
And there was no error message offered to those users.

So, this questionable #define is now being eliminated.

Reference(s):
. May, 2020 - introduce 2 abreast display
commit 59f5a37a247184b3009af963706ca68198067185

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: fix an improper behavior following a SIGWINCH bug
Jim Warner [Wed, 7 Sep 2022 05:00:00 +0000 (00:00 -0500)]
top: fix an improper behavior following a SIGWINCH bug

When top was made more responsive to keyboard input in
that commit referenced below, his previous response to
a SIGWINCH was upset. Formerly, that display integrity
was restored with the next refresh cycle. But, without
this patch, one must strike some key to accomplish it.

[ in truth, this patch vastly improves that sigwinch ]
[ response. whereas before, although integrity would ]
[ be restored automatically, it did not happen until ]
[ the next regular refresh. now it is instantaneous! ]

Reference(s):
. May, 2022 - made more responsive to kdb input
commit 3ea1bc779fb7ca5bf065a5ca620ec5b5823bc61c

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agolibrary: address an 'uninitialised value' VALGRIND bug
Jim Warner [Wed, 7 Sep 2022 05:00:00 +0000 (00:00 -0500)]
library: address an 'uninitialised value' VALGRIND bug

Thanks to valgrind and his --track-origins=yes option,
the problem and solution was suggested as shown below.

[ and it was created in that commit referenced below ]

But, after attacking this problem by adding a memset()
call in pids.c, a 2nd valgrind oops, also shown below,
was encountered. The dynamically acquired 'cmd' again!

[ might help to explain why changes appear excessive ]

Reference(s):
. 1st valgrind discovery
==11111== Conditional jump or move depends on uninitialised value(s)
==11111==    at 0x13425D: stat2proc (readproc.c:582)
==11111==    by 0x137436: look_up_our_self (readproc.c:1613)
==11111==    by 0x132196: fatal_proc_unmounted (pids.c:1388)
==11111==    by 0x11BA4D: before (top.c:3580)
==11111==    by 0x127E10: main (top.c:7173)
==11111==  Uninitialised value was created by a stack allocation
==11111==    at 0x132165: fatal_proc_unmounted (pids.c:1381)

. Jul, 2022 - fatal_proc_unmounted refactored
commit 52bd019d8ca09ecfec34b5020eb7b8d612c315f8

. 2nd valgrind discovery
==22222== 16 bytes in 1 blocks are definitely lost
==22222==    by 0x4A0E60E: strdup (strdup.c:42)
==22222==    by 0x133D00: stat2proc (readproc.c:587)
==22222==    by 0x136E67: look_up_our_self (readproc.c:1613)
==22222==    by 0x131BC7: fatal_proc_unmounted (pids.c:1390)
==22222==    by 0x11B7C6: before (top.c:3580)
==22222==    by 0x127828: main (top.c:7173)

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agonls: Update man-po for EIP updates v4.0.1rc1
Craig Small [Mon, 5 Sep 2022 07:50:54 +0000 (17:50 +1000)]
nls: Update man-po for EIP updates

References:
 commit 3fa04fa9471cc1020c8c7e534ef1d4fa500c90d6

2 years agonls: Update translations for ignore ancestors
Craig Small [Mon, 5 Sep 2022 07:46:40 +0000 (17:46 +1000)]
nls: Update translations for ignore ancestors

References:
 commit 4b44ab98c144dae099442e30a62966a7689818c6

2 years agodocs: add info on why eip and esp are zeroed out
Eduardo Damato [Fri, 26 Aug 2022 11:05:02 +0000 (08:05 -0300)]
docs: add info on why eip and esp are zeroed out

2 years agoImprove trace().
Rafael Kitover [Fri, 15 Oct 2021 04:40:03 +0000 (04:40 +0000)]
Improve trace().

Turn on trace() with the TRACE macro and remove the ## token paste
preprocessor operator which is unnecessary here and causes these errors:

ps/common.h:176:26: error: pasting "(" and ""ps_argv[thisarg] is %s\n""
does no t give a valid preprocessing token
.

Send trace output to STDERR.

Tracing can be enabled by adding TRACE to CPPFLAGS as follows:

./configure CPPFLAGS="-DTRACE"

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2 years agopgrep: Look at all ancestors in --ignore-ancestors
Chris Down [Wed, 31 Aug 2022 08:59:47 +0000 (09:59 +0100)]
pgrep: Look at all ancestors in --ignore-ancestors

Previously we mistakenly only checked one previous level of the
hierarchy.

Signed-off-by: Chris Down <chris@chrisdown.name>
2 years agomisc: Update NEWS/man date for pgrep -A
Craig Small [Wed, 31 Aug 2022 07:43:17 +0000 (17:43 +1000)]
misc: Update NEWS/man date for pgrep -A

Added NEWS item
Update pgrep.1 date

References:
 commit 4b44ab98c144dae099442e30a62966a7689818c6

2 years agonls: Update man translations for new library
Craig Small [Wed, 31 Aug 2022 07:40:50 +0000 (17:40 +1000)]
nls: Update man translations for new library

Library translations now use the new library and include
path.

References:
 commit 1502648ff9aef047286db2e03a3e1a872d40a0e2

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agopgrep: Add support for ignoring ancestors with -A/--ignore-ancestors
Chris Down [Wed, 10 Aug 2022 13:07:38 +0000 (14:07 +0100)]
pgrep: Add support for ignoring ancestors with -A/--ignore-ancestors

pgrep and friends naturally filter their own processes from their
matches. The same issue can occur when elevating with tools like sudo or
doas, where the elevating shim layers linger as a parent and are
returned in the results. For example:

    % sudo pkill -9 -cf someelevatedcmdline
    1
    zsh: killed     sudo pkill -9 -cf someelevatedcmdline

This is a situation we've actually seen in production, where some poor
soul changes how permission management works (for example with Linux's
hidepid option), needs to elevate a pgrep or pkill call, and now ends up
with more than they bargained for. Even after the issue is noticed,
resolving it requires reinventing some of the pgrep logic, which is
unfortunate.

This commit adds the -A/--ignore-ancestors option which excludes pgrep's
ancestors from the results:

    % sudo ./pkill -9 -Acf someelevatedcmdline
    0

We looks at multiple layers of the process hierarchy because, while
things like sudo only have one layer of shimming, some mechanisms (like
those found in a typical container manager like those found in Docker or
Kubernetes) may have many more.

Signed-off-by: Chris Down <chris@chrisdown.name>
2 years agobuild-sys: Fix paths for check-lib
Craig Small [Wed, 31 Aug 2022 07:30:34 +0000 (17:30 +1000)]
build-sys: Fix paths for check-lib

Forgot to move the location for test_Itemtables

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agoskill: Update include location too
Craig Small [Mon, 29 Aug 2022 11:37:40 +0000 (21:37 +1000)]
skill: Update include location too

skill got missed in the main update as its not compiled by
default.

2 years agodocs: Update manpages
Craig Small [Mon, 29 Aug 2022 10:56:43 +0000 (20:56 +1000)]
docs: Update manpages

Change include directory <procps/ -> <libproc2/
Change link instruction -lproc-2 -lproc2

2 years agobuild-sys: Move git-version-gen
Craig Small [Mon, 29 Aug 2022 10:53:01 +0000 (20:53 +1000)]
build-sys: Move git-version-gen

git-version-gen was the only file in misc/ moving it to local/

2 years agonls: Update translations for lib change
Craig Small [Mon, 29 Aug 2022 10:50:53 +0000 (20:50 +1000)]
nls: Update translations for lib change

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agomisc: Update pc file to new library name
Craig Small [Mon, 29 Aug 2022 10:42:45 +0000 (20:42 +1000)]
misc: Update pc file to new library name

2 years agotestsuite: Update the library tests for new location
Craig Small [Mon, 29 Aug 2022 10:40:45 +0000 (20:40 +1000)]
testsuite: Update the library tests for new location

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agolibrary: Rename to libproc2
Craig Small [Mon, 29 Aug 2022 10:38:17 +0000 (20:38 +1000)]
library: Rename to libproc2

The newlib library used to be called libproc-2 but the new
name is preferred.

References:
 https://www.freelists.org/post/procps/Next-for-newlib,3

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agobuild-sys: Relocate lib/
Craig Small [Mon, 29 Aug 2022 10:28:03 +0000 (20:28 +1000)]
build-sys: Relocate lib/

test files in lib go to src/tests
include/ goes to local/
lib/*.c goes to local/

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agobuild-sys: Need to add libary includes
Craig Small [Mon, 29 Aug 2022 09:16:49 +0000 (19:16 +1000)]
build-sys: Need to add libary includes

The default path didn't add the library includes. A standard
build would work, but a make distcheck would not.

2 years agobuild-sys: Update tests to new binary locations
Craig Small [Mon, 29 Aug 2022 09:13:10 +0000 (19:13 +1000)]
build-sys: Update tests to new binary locations

2 years agobuild-sys: Relocate library to library/
Craig Small [Mon, 29 Aug 2022 09:02:44 +0000 (19:02 +1000)]
build-sys: Relocate library to library/

All the dependent programs needed to have their includes moved too

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agomisc: Move Documentation to doc
Craig Small [Mon, 29 Aug 2022 08:38:52 +0000 (18:38 +1000)]
misc: Move Documentation to doc

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agonls: Update translations to new source location
Craig Small [Mon, 29 Aug 2022 08:35:04 +0000 (18:35 +1000)]
nls: Update translations to new source location

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agonls: Minor translation update
Craig Small [Mon, 29 Aug 2022 08:30:50 +0000 (18:30 +1000)]
nls: Minor translation update

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agomisc: Move all binaries to src
Craig Small [Mon, 29 Aug 2022 08:29:28 +0000 (18:29 +1000)]
misc: Move all binaries to src

*.c -> src/
ps/* src/ps/
top/* src/top/

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agobuild-sys: Rearrange the manual pages
Craig Small [Mon, 29 Aug 2022 08:07:43 +0000 (18:07 +1000)]
build-sys: Rearrange the manual pages

All man pages are found in ./man
man-po -> po-man

References:
 https://www.freelists.org/post/procps/Next-for-newlib,3

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agobuild-sys: Removal of contrib directory
Craig Small [Mon, 29 Aug 2022 07:46:03 +0000 (17:46 +1000)]
build-sys: Removal of contrib directory

There is nothing we have used here for over a decade

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agotestsuite: Add test for fatal_proc_unmounted
Craig Small [Mon, 1 Aug 2022 12:23:38 +0000 (22:23 +1000)]
testsuite: Add test for fatal_proc_unmounted

Adding a check to ensure that fatal_proc_unmounted returns
values for things that do not just sit in /proc/self/stat

References:
 commit 52bd019d8ca09ecfec34b5020eb7b8d612c315f8

2 years agolibrary: refactor flawed function fatal_proc_unmounted
Jim Warner [Thu, 28 Jul 2022 05:00:00 +0000 (00:00 -0500)]
library: refactor flawed function fatal_proc_unmounted

This commit addresses a potentially disastrous flaw in
that fatal_proc_unmounted() function wherein requested
item(s) might not have been returned to the caller yet
were specified at the time of a 'new' or 'reset' call.

The root cause, uncovered by Craig, was due to the old
library look_up_our_self() support function which only
would populate a proc_t with limited 'stat' file data.

This routine will now act the same as all other <pids>
functions which return a stack or stacks. Whatever was
specified with a 'new' or 'reset' will be returned, if
the passed 'return_self' parameter is other than zero.

[ as is so often the case, when flawed code is fixed ]
[ former complexity can be reduced as a side benefit ]

Reference(s):
https://www.freelists.org/post/procps/issue-245-plus-one,2

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: revert mention of limits for fatal_proc_unmounted
Jim Warner [Thu, 28 Jul 2022 05:00:00 +0000 (00:00 -0500)]
doc: revert mention of limits for fatal_proc_unmounted

With the next commit the fatal_proc_unmounted function
will be refactored to behave as it always should have.
So, a need for the user 'stat' caution will disappear.

Reference(s):
. original man page change
commit 7d44c94317941c1cd3d41325a0128010fe5d1331

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agops: adapted to change of VSIZE_PGS item to VSIZE_BYTES
Jim Warner [Thu, 28 Jul 2022 05:00:00 +0000 (00:00 -0500)]
ps: adapted to change of VSIZE_PGS item to VSIZE_BYTES

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agolibrary: change misnamed VSIZE_PGS item to VSIZE_BYTES
Jim Warner [Thu, 28 Jul 2022 05:00:00 +0000 (00:00 -0500)]
library: change misnamed VSIZE_PGS item to VSIZE_BYTES

Gosh this particular flaw originated way back in 2015.

[ that was when we burdened a caller with additional ]
[ responsibilities for 'stacks_alloc', 'stacks_fill' ]
[ and 'stacks_dealloc'. damn implementation details. ]

Reference(s):
. Aug, 2015 - introduced<pids> api
commit 7e6a371d8a36b250a2edddff9f5d059640b8132e

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: Mention fatal_proc_unmounted limitations
Craig Small [Wed, 27 Jul 2022 11:12:10 +0000 (21:12 +1000)]
doc: Mention fatal_proc_unmounted limitations

Discovered this while trying to port programs that use the deleted
libprocps function look_up_our_self() which can be found with the
fatal_proc_unmounted() function.

While procps_pids_new() will allow you to specify any items you
care to think of, a subsequent call to fatal_proc_unmounted()
will only fill in the values found in /proc/self/stat.

Added a caveat to the procps_pids manpage pointing out this
limitation.

References:
 https://salsa.debian.org/xorg-team/app/apitrace/-/blob/debian-unstable/lib/os/os_memory.hpp#L44
 https://gitlab.com/-/snippets/2377884

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agotop: eliminate a potential abend when exiting 'A' mode
Jim Warner [Tue, 26 Jul 2022 05:00:00 +0000 (00:00 -0500)]
top: eliminate a potential abend when exiting 'A' mode

In that issue cited below, Tyson Nottingham identified
a potential abend which was associated with 'alternate
display mode' plus that troublesome 'mkVIZrow1' macro.
He also offered a perfectly adequate fix for that bug.

I refer to that macro as troublesome since it's now so
widely used and sometimes (by design) causes 'begtask'
to go negative (invalid). And now I found yet one more
place where it should have been used but wasn't ('f').

It's also troublesome as evidenced by some git history
listed below. Heck, there was even a commit addressing
the same symptoms (alternate display mode abend) which
Tyson suffered. Clearly, the current design is flawed.

So, with those two issues in mind, I've refactored the
approach to maintaining a visible task in the 1st row.
Henceforth, a 'mkVIZrow1' macro will be issued in only
two places: once at startup and after most keystrokes.

Such an approach likely results in additional calls to
the 'window_hlp' routine that aren't really necessary.
But, it provides a cleaner design less prone to errors
in the future. Besides, such additional overhead would
only be incurred when interacting with the user. Thus,
new costs are of no concern and will never be noticed.

Reference(s):
. Tyson Nottingham reported problem
https://gitlab.com/procps-ng/procps/-/issues/245
. Jun, 2018 - visible row 1 tasks first addressed
commit 6aedeac667267b24ba7f03914eec768d661651ed
. Jun, 2018 - adressed edge case, new bugs created
commit 9d59ddc4661453dc65a8fc81dd75bfea40b7696c
. Sep, 2018 - additional edge case addressed
commit 59f02f19c796cdd83a9ec8751f83e10c42080a44
. May, 2021 - some abends fixed, new error created
commit 8281ac4f98cf04c51cbeb746d214201531d660ec
. Jun, 2021 - try to prorect against future errors
commit 2ea082b4af6f4751548e7583fe7430cd97935318
. Sep, 2021 - integrate mkVIZ & 'focused' tasks
commit 69978e365043f27305e487709474947bb377084d

Discovered by: Tyson Nottingham
Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: make the library API pages a little more readable
Jim Warner [Tue, 26 Jul 2022 05:00:00 +0000 (00:00 -0500)]
doc: make the library API pages a little more readable

Use of the the '.B' and '.BI' man documentation macros
had rendered the three library API pages less readable
than they could be. In addition, sometimes the pointer
indicator and an identifier were separated by a space.

So, this commit will trade those macros for some '.RI'
and '.RB' macros plus treat the pointers consistently.

[ plus we no longer italicize sort 'stacks' brackets ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agonls: Update po files
Craig Small [Mon, 18 Jul 2022 10:55:01 +0000 (20:55 +1000)]
nls: Update po files

Updates to cover the "new used" change and the pidwait change

2 years agopgrep: Better warning if pidfd_open not implemented
Craig Small [Mon, 18 Jul 2022 10:51:41 +0000 (20:51 +1000)]
pgrep: Better warning if pidfd_open not implemented

If procps is built on a Linux 5.3+ system then pidwait
is built with pidfd_open(). If that program is run on
a system < 5.3 then it gives an odd generic error.

If we get a ENOSYS from one pid, we will get it for all
the others so its better to explain what happens and terminate.

The man page is updated to note this issue.

This came up due to killall in psmisc using pidfd_send_signal

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

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agops: Make STIME entries thread safe
Craig Small [Thu, 30 Jun 2022 11:15:37 +0000 (21:15 +1000)]
ps: Make STIME entries thread safe

Using localtime() can be a problem due to the static buffer for
the return value. It's simple enough to use localtime_r()

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agotop: if line editing, account for invisible characters
Jim Warner [Tue, 28 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: if line editing, account for invisible characters

If we're deleting a character or operating in overtype
mode, we must account for the potential of 'invisible'
characters. When one follows any character about to be
deleted or replaced both multi-byte sequences must go.

Without this change, there exists the possibility that
top might report some error where no error is apparent
to the user. For example, with 'other filtering' (o/O)
the user could see "unrecognized field name 'COMMAND'"
where the quoted column name appears perfectly normal.

Or maybe a sequences like the 'combining acute accent'
gets applied to an existing character instead of being
deleted as one expects when its parent was eliminated.

So, henceforth whenever any character is being deleted
we will now check for a following 'invisible' sequence
then eliminate it along with that preceding character.

[ admittedly, these scenarios are very rare yet they ]
[ may occur, especially when recalling some previous ]
[ multi-byte strings for editing. and, since we will ]
[ be interacting with a user, performance won't be a ]
[ factor so extra checks for a zero wcwidth is fine. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: adjust the man page alignment for 'Ctrl' commands
Jim Warner [Sun, 26 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: adjust the man page alignment for 'Ctrl' commands

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: afford another level of protection for line input
Jim Warner [Sun, 26 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: afford another level of protection for line input

This commit just provides the final protection against
possible screen corruption when processing line input.

[ such corruption was limited to the input line only ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: Note new Used behavour
Craig Small [Sat, 25 Jun 2022 01:42:08 +0000 (11:42 +1000)]
doc: Note new Used behavour

Added note to NEWS in the lbirary section
Updated free.1 as it specifies the calculation

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agotop: adapt for modification to 'MEMINFO_MEM_USED' item
Jim Warner [Wed, 22 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: adapt for modification to 'MEMINFO_MEM_USED' item

With the library change calculating 'MEMINFO_MEM_USED'
top must be tweaked in order to retain the distinction
between non-cached used memory and cached used memory.

[ assuming one of the two graphs are being displayed ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agolibrary: modify calculation of 'MEMINFO_MEM_USED' item
Jim Warner [Wed, 22 Jun 2022 05:00:00 +0000 (00:00 -0500)]
library: modify calculation of 'MEMINFO_MEM_USED' item

In an effort to more accurately reflect 'used' memory,
we will now rely on the kernel's estimate of available
memory. Thus, 'MEMINFO_MEM_USED' will be calculated as
just 'MEMINFO_MEM_TOTAL' less 'MEMINFO_MEM_AVAILABLE'.

Reference(s):
. thread leading to agreed upon change
https://www.freelists.org/post/procps/free-regression-due-to-a-different-calculation-of-Used-memory
. where consensus reached
https://www.freelists.org/post/procps/free-regression-due-to-a-different-calculation-of-Used-memory,11
https://www.freelists.org/post/procps/free-regression-due-to-a-different-calculation-of-Used-memory,12

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: adjust some parenthesis for correct '^N' behavior
Jim Warner [Thu, 16 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: adjust some parenthesis for correct '^N' behavior

Some kdeinit tasks have a large environment consisting
mostly of nulls which were then followed by one or two
printable characters. Such strange environments should
not be shown with that 'not applicable' (n/a) notation
even though that first string vector is equal to '\0'.

I thought I had covered such a contingency but, due to
a misplaced right parenthesis, that '^N' bottom window
could see 'n/a' + a bunch of spaces + printable stuff.

Well, that won't happen anymore with this tiny change.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: make 'n/a' (not applicable) notation translatable
Jim Warner [Thu, 16 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: make 'n/a' (not applicable) notation translatable

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agoNEWS: acknowledge that utf8 multi-byte character input
Jim Warner [Tue, 14 Jun 2022 05:00:00 +0000 (00:00 -0500)]
NEWS: acknowledge that utf8 multi-byte character input

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: enable processing utf8 multi-byte character input
Jim Warner [Mon, 13 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: enable processing utf8 multi-byte character input

This program was well equipped to properly handle utf8
multi-byte characters - except for one important area!

If users typed any unicode character (shift+ctrl+u) or
pasted a utf-8 multi-byte string as a response to some
input prompt, those characters would simply be ignored
since they would not pass the internal 'isprint' test.

Well, now we can handle such data while preserving all
line editing provisions such as insertions, deletions,
destructive backspace, prior line recall (up/down) and
those all important cursor left plus right arrow keys.

[ we even support overtype mode for multi-byte stuff ]
[ even though our gui emulator will not let us alter ]
[ the cursor as confirmation (as we do at a console) ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: provide for visual hint when overtype mode active
Jim Warner [Mon, 13 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: provide for visual hint when overtype mode active

Given that we won't always be able to alter the cursor
shapes (from underscore to block) if in input overtype
mode, this commit will at least provide a visual clue.

[ while this libvte quirk will impact gnome-terminal ]
[ and likely others, we're able to change the cursor ]
[ shape from underscore to block at a linux console. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: avoid premature forced loss of that bottom window
Jim Warner [Mon, 13 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: avoid premature forced loss of that bottom window

In the commit shown below the bottom window was forced
off if a full screen replacement function was invoked.
It did so by setting Frames_signal after calling those
routines from the keys_global function. However, there
was sometimes a possibility such action was premature.

At least two of those full screen replacement routines
may issue an error message & return without corrupting
the screen. As such, forcing off that bottom window is
totally unnecessary. It therefore should be preserved.

So this commit just moves the setting of Frames_signal
to the full screen replacement routines when possible.

Reference(s):
. May, 2022 - bottom window forced off for some
commit d66c1f39b52d53ec279fc638aa4a6352d7672201

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: acknowledge the top 'message log' display ability
Jim Warner [Thu, 2 Jun 2022 05:00:00 +0000 (00:00 -0500)]
doc: acknowledge the top 'message log' display ability

[ along the way, we'll fix-up the section 4 commands ]
[ summary which has gotten a little outdated lately. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: provides a new user 'message log' display ability
Jim Warner [Thu, 2 Jun 2022 05:00:00 +0000 (00:00 -0500)]
top: provides a new user 'message log' display ability

Messages issued by top will be displayed for only 1.25
seconds. And while this length of time would appear to
be acceptable (given the absence of complaints), there
will be times when a specific message might be missed.

So, this commit offers users the opportunity to recall
up to 10 of the most recent messages that were issued.

[ we'll just exploit top's new bottom window feature ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agolibrary: at unref, close these cached file descriptors
Jim Warner [Thu, 2 Jun 2022 05:00:00 +0000 (00:00 -0500)]
library: at unref, close these cached file descriptors

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agolibrary: Close filehandle for procps_loadavg
Craig Small [Thu, 2 Jun 2022 06:36:40 +0000 (16:36 +1000)]
library: Close filehandle for procps_loadavg

Previous commit didn't close the filehandle after making the
open non-persistent.

References:
 commit 8fcd14de18b998647ba47f5b35feb1d85e2d2f08

2 years agolibrary: clear rc in procps_loadavg again
Craig Small [Tue, 31 May 2022 12:03:22 +0000 (22:03 +1000)]
library: clear rc in procps_loadavg again

During the changes to procps_loadavg I didn't set the initial
value for retval, meaning it was a random number.
It is now correctly intialised to zero.

References:
  commit 8fcd14de18b998647ba47f5b35feb1d85e2d2f08

2 years agotload: Report on lack of /proc/loadavg
Craig Small [Tue, 31 May 2022 11:35:40 +0000 (21:35 +1000)]
tload: Report on lack of /proc/loadavg

Now that the library correctly returns an error if loadavg
is not available, tload can tell the user the bad news.

References:
 procps-ng/procps#227
 commit 8fcd14de18b998647ba47f5b35feb1d85e2d2f08

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agolibrary: Return -errno not print messages
Craig Small [Tue, 31 May 2022 11:32:03 +0000 (21:32 +1000)]
library: Return -errno not print messages

A library should generally return an error value, rather than
printing to stderr a message. procps_loadavg() had a few things
to change:

It had a global buffer, but we don't call this function over and
over except in tload. It also did had two macros where a plain
fopen() would do the job nicely.

This removed the macro FILE_TO_BUF which was used everywhere in oldlib
but only for loadavg in newlib.

This library change will set us up to fix tload.

2 years agofree: better error message if meminfo not available
Craig Small [Tue, 31 May 2022 11:10:18 +0000 (21:10 +1000)]
free: better error message if meminfo not available

When /proc is mounted with subset=pid free just gives the
standard cannot create meminfo structure without any hint why.
free now checks the return value and if it is -ENOENT then it
gives more information about the problem.

References:
 procps-ng/procps#227

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agolibrary: Cygwin doesnt have /proc/vmstat
Craig Small [Tue, 31 May 2022 10:41:30 +0000 (20:41 +1000)]
library: Cygwin doesnt have /proc/vmstat

Make the vmstat_read_failed() return non-error for Cygwin as
it always will error because /proc/vmstat doesn't exist.

Patch from Achim of the Cygwin project.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agotop: the bottom 'window' headings are now translatable
Jim Warner [Fri, 27 May 2022 05:00:00 +0000 (00:00 -0500)]
top: the bottom 'window' headings are now translatable

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: remove the 'BOT_MENU_YES' prototype demonstration
Jim Warner [Fri, 27 May 2022 05:00:00 +0000 (00:00 -0500)]
top: remove the 'BOT_MENU_YES' prototype demonstration

Now that a potential use of that bottom 'window' for a
menu has been demonstrated, we'll remove such clutter.

[ after all, the prior commit cautioned against text ]
[ made conditional which might also be translatable. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: don't make translatable text subject to a #define
Jim Warner [Fri, 27 May 2022 05:00:00 +0000 (00:00 -0500)]
top: don't make translatable text subject to a #define

While it is acceptable to make text usage conditional,
one must never make the text itself conditional. After
all, the translators must be presented with all of the
text so the opportunity to translate it is never lost.

[ one wonders who the idiot was that did this anyway ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: cleanup of miscellaneous stuff from prior commits
Jim Warner [Fri, 27 May 2022 05:00:00 +0000 (00:00 -0500)]
top: cleanup of miscellaneous stuff from prior commits

Fix some errors introduced in the commits shown below.

Reference(s):
. Apr, 2022 - 'keys_global' missed redundancy
commit 27f5904edd3772a2f3f66ac62148dee636295933
. Apr, 2022 - added extraneous comma in help text
commit fb32021eeb6f78f01bf455231423a162c9766408

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agolibrary: Cygwin only has 4 cpu numbers
Craig Small [Thu, 26 May 2022 07:53:43 +0000 (17:53 +1000)]
library: Cygwin only has 4 cpu numbers

Old library never checked how many matches there were meaning that
both 8-number and 4-number cpu lines would work.

2 years agotop: enable bottom 'window' multi-byte char capability
Jim Warner [Wed, 25 May 2022 05:00:00 +0000 (00:00 -0500)]
top: enable bottom 'window' multi-byte char capability

If the special bottom 'window' routines remain unaware
of potential multi-byte characters, that heading could
be truncated prematurely and unnecessary blank line(s)
added to the reserved rows at the bottom of a display.

So, in both cases, this patch will now account for any
difference between string lengths and display columns.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: rework bottom 'window' logic to reduce redundancy
Jim Warner [Wed, 25 May 2022 05:00:00 +0000 (00:00 -0500)]
top: rework bottom 'window' logic to reduce redundancy

This patch attempts to reduce the proliferation of the
bottom window support routines by combining the 'misc'
with 'item' functions. Along the way we can now rename
those two 'pick' functions 'menu' while keeping proper
alphabetic order among all the bottom window routines.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agobuild-sys: Give sensible errors if missing pkg-config
Craig Small [Wed, 25 May 2022 11:08:50 +0000 (21:08 +1000)]
build-sys: Give sensible errors if missing pkg-config

pkg-config is used to find various libraries used by procps.
Unfortunately it, or rather automake, give terrible misleading
error messages if pkg-config is not installed.

At ./configure time you get this:
configure: error: ncurses support missing/incomplete (for partial
build use --without-ncurses)

At automake time you get this:
configure.ac:33: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:48: error: possibly undefined macro: AS_IF
configure.ac:113: error: possibly undefined macro: AC_DEFINE

The internet is filled with such wonderful other examples.

This commit does two things:
 At autoconf time, check PKG_PREREQ macro is defined which is found in
pkg.m4 and tells us pkg-config has its macros available.
 At configure time, check the result of the pkg-config test and error
 if it didn't find it.

Now it actually says its missing pkg-config. To be fair, the autoconf
check is "documented" and recommended in pkg.m4 file.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agobuild-sys: Use ncursesw by default
Craig Small [Sat, 21 May 2022 01:06:57 +0000 (11:06 +1000)]
build-sys: Use ncursesw by default

The existing build system would only require wide ncurses for
a wide watch and even if the library was there would not link
anything else to it.

The first issue which #123 made me think of, is if ncursesw
was there and ncurses is not, why not use ncursesw?

A more major issue is if programs such as slabtop are linked
to ncurses, then certain languages will display their text
wrong, as found in #237.

The days of assuming ASCII only is ok are over the build system
now does the following:
 1. If ncursesw is available use this for all relevant programs
 2. If ncursesw is not but ncurses is, use this instead
 3. If you enable 8bit watch and either disable ncurses or
    we cannot find ncursesw error at configure time.

In related news, I hate M4sh.

References:
 procps-ng/procps#123
 procps-ng/procps#237

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agolibrary: silence the clang warning for 'uptime' module
Jim Warner [Wed, 18 May 2022 05:00:00 +0000 (00:00 -0500)]
library: silence the clang warning for 'uptime' module

Reference(s):
proc/uptime.c:191:9: warning: variable 'uphours' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: extend shift+tab (back_tab) navigation to console
Jim Warner [Wed, 18 May 2022 05:00:00 +0000 (00:00 -0500)]
top: extend shift+tab (back_tab) navigation to console

Really, extend shift+tab navigation to only some linux
consoles (or maybe most consoles). However, there were
some consoles where shift+tab always yields just '\t'.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: apply a special emphasis with some focus elements
Jim Warner [Wed, 18 May 2022 05:00:00 +0000 (00:00 -0500)]
top: apply a special emphasis with some focus elements

Since top now uses string vectors for two items in the
new focus window (cmdline & environ), there is no real
use for that 'separator' specified at toggle time. So,
this commit will find a new use for what is the space.

Henceforth, when a user is navigating using the tab or
backtab keys, should a strv element with focus contain
embedded space(s), it will be emphasized & highlighted
using the current window's message color (capclr_msg).

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: some imbedded literals are now manifest constants
Jim Warner [Wed, 18 May 2022 05:00:00 +0000 (00:00 -0500)]
top: some imbedded literals are now manifest constants

A commit that changes no code but, hopefully, helps to
better document where and how such literals were used.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodocs: Update news for watch equexit
Craig Small [Wed, 18 May 2022 11:50:14 +0000 (21:50 +1000)]
docs: Update news for watch equexit

References:
 commit 3ac20bf5366b5784d8ee4b1f927e96f4dd164f28

2 years agowatch: Add --equexit option
Orhun Parmaksız [Thu, 31 Mar 2022 19:36:57 +0000 (22:36 +0300)]
watch: Add --equexit option

This commit adds a new option called `--equexit` which is the opposite
of `--chgexit`. This option makes it possible to exit when the output
of the given command does not change for the given number of cycles.
A download operation could be given as a use-case since `watch` will
exit when the output does not change anymore, in other words, when
the download is completed.

References:
 procps-ng/procps#232

Signed-off-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2 years agodocs: Minor fix for kill.1 manpage
Craig Small [Wed, 18 May 2022 11:37:26 +0000 (21:37 +1000)]
docs: Minor fix for kill.1 manpage

Merge request 154 brought up the issue of the space before the commar
after sigaction, however the MR included the translated generated
pages.

References:
  procps-ng/procps!154

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2 years agotop: modify 'focus' strv function to display 'n/a' too
Jim Warner [Tue, 17 May 2022 05:00:00 +0000 (00:00 -0500)]
top: modify 'focus' strv function to display 'n/a' too

This commit just brings that 'bot_focus_strv' function
up to the same standard as the vanilla 'bot_focus_str'
guy. Namely, if there is no cmdline or environ for any
process, that bottom window will now display an 'n/a'.

[ with the nature of those string vectors, it wasn't ]
[ the same simple process found for regular strings. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: extend 'focus' navigation to shift+tab (back_tab)
Jim Warner [Tue, 17 May 2022 05:00:00 +0000 (00:00 -0500)]
top: extend 'focus' navigation to shift+tab (back_tab)

Some of those bottom windows grow quite large, as with
the firefox environment. If one is navigating the data
using the tab key, it can be very inconvenient when an
element should be reexamined but that focus has moved.

Therefore, this commit will support the 'back_tab' key
which is a standard combination of the shift+tab keys.

Now a user can easily backup up to any missed element,
assuming a terminal emulator honors that terminfo key.

[ a gui emulator typically will honor the 'back_tab' ]
[ terminfo string, whereas a linux console does not. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: be more careful with memcpy length specifications
Jim Warner [Tue, 17 May 2022 05:00:00 +0000 (00:00 -0500)]
top: be more careful with memcpy length specifications

Using 'mempcpy' was a mistake where plain old 'memcpy'
was appropriate. More importantly, the careless length
specified resulted in a SEGV under some circumstances.

[ namely, it occurred under a multi-threaded top and ]
[ the top program itself as focus + CtrlN 'environ'. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: modify 'Ctrl' bottom window 'str' use with 'strv'
Jim Warner [Sun, 15 May 2022 05:00:00 +0000 (00:00 -0500)]
top: modify 'Ctrl' bottom window 'str' use with 'strv'

After satisfying increased buffer size in the previous
patch, I decided to improve the highlight accuracy for
both the command lines plus the environment variables.

Since they both may contain elements which themselves
include embedded spaces, to accomplish this goal, one
must trade vanilla strings for string vectors instead.

[ at last such library items have now been justified ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: needed 'Ctrl' bottom window fixes were discovered
Jim Warner [Sun, 15 May 2022 05:00:00 +0000 (00:00 -0500)]
top: needed 'Ctrl' bottom window fixes were discovered

As it turns out, some of the 'environ' strings are big
enough to overrun the initial buffer sizes. And, while
no real harm was done (other than to silently truncate
the output), this patch will increase the buffer size.

While we're at it. we will normalize a few more buffer
declarations along with correcting a couple typos too.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: man page adjusted for response to keyboard inputs
Jim Warner [Fri, 13 May 2022 05:00:00 +0000 (00:00 -0500)]
doc: man page adjusted for response to keyboard inputs

[ and along the way, those 2 newest namespace fields ]
[ are now mentioned under that same 'X' command part ]
[ this commit already changed for improved response. ]

[ they should have been included in the patch below. ]

Reference(s):
commit 6e78355d4d1ab011c1d65ebbec9a4408b743a6b3

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: program is now more responsive to keyboard inputs
Jim Warner [Fri, 13 May 2022 05:00:00 +0000 (00:00 -0500)]
top: program is now more responsive to keyboard inputs

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agodoc: detail 'Ctrl' bottom window namespaces plus focus
Jim Warner [Thu, 12 May 2022 05:00:00 +0000 (00:00 -0500)]
doc: detail 'Ctrl' bottom window namespaces plus focus

[ along the way we will restore '^R' to keys summary ]
[ plus correct a leftover reference to 'Ctrl-V' too. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: extend 'Ctrl' bottom window for 'memu' selections
Jim Warner [Thu, 12 May 2022 05:00:00 +0000 (00:00 -0500)]
top: extend 'Ctrl' bottom window for 'memu' selections

This commit adds a prototype for a potential extension
of that tabbed bottom window capability. It introduces
a 'menu' which then provides for users' selections. It
does not actually do anything meaningful and will only
be enabled with the new #define called 'BOT_PICK_YES'.

[ since it's just a proof of concept, no attempt has ]
[ been made to add the usual NLS translation support ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: extend 'Ctrl' bottom window for focus via tab key
Jim Warner [Thu, 12 May 2022 05:00:00 +0000 (00:00 -0500)]
top: extend 'Ctrl' bottom window for focus via tab key

This commit introduces the 'tab' key which can be used
to highlight individual elements in that bottom 'Ctrl'
window. This can really help when reviewing such data.

[ note, normal ongoing monitoring continues unabated ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: expand 'Ctrl' bottom window to display other data
Jim Warner [Thu, 12 May 2022 05:00:00 +0000 (00:00 -0500)]
top: expand 'Ctrl' bottom window to display other data

This commit adds support for displaying the namespaces
in top's separate bottom 'Ctrl' window. Along the way,
the plumbing is now in place to extend this capability
to other data (if we don't run out of '^' keystrokes).

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agotop: rename 'Ctrl' bottom window routines and relocate
Jim Warner [Thu, 12 May 2022 05:00:00 +0000 (00:00 -0500)]
top: rename 'Ctrl' bottom window routines and relocate

This patch will just set the stage for the next commit
where we'll be adding the capability to display things
that sometimes may necessitate multiple library items.

In that effort we will be adding several new routines.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2 years agops: Document -P option
Craig Small [Wed, 11 May 2022 07:34:12 +0000 (17:34 +1000)]
ps: Document -P option

The -P option for ps has been in there for decades but neither the
man page nor the help option explained what it did.

Amazing what crops up even now!

References:
 https://unix.stackexchange.com/questions/701422/what-does-p-mean-in-the-context-of-the-ps-command