]> granicus.if.org Git - procps-ng/log
procps-ng
3 years agotop: TREE_FOCUS_X works properly with multiple windows
Jim Warner [Wed, 28 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: TREE_FOCUS_X works properly with multiple windows

As promised, this commit will ensure that TREE_FOCUS_X
impacts only the window under which an 'F' was issued.

Previously, when 'F' was invoked it would impact every
window that was displaying forest view. Now, only that
window where 'F' was applied will show the indentation
losses whenever multiple windows were being displayed.

[ each of the 4 windows can now have different focus ]
[ pids active and not impact any other forest views! ]

Reference(s):
. 'TREE_FOCUS_X' introduction
commit c23d2708d4a6a80e029289d630c84824d27b1ada

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: trade most pids_stack pointers for a WIN_t ppt ix
Jim Warner [Tue, 27 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: trade most pids_stack pointers for a WIN_t ppt ix

For every function whose parameters consist of a WIN_t
pointer and a pointer to a pids_stack, we will instead
pass the WIN_t pointer and index to that window's ppt.

This change will save six instructions per invocation,
and converts the index once in those called functions.

[ you can consider this an efficiency change, but it ]
[ is really being implemented so that 'TREE_FOCUS_X' ]
[ #define can be made to behave as one should expect ]
[ when running under top's 'alternate display' mode! ]

[ stay tuned for the very next commit to be pushed!! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: restored a function prologue lost a long time ago
Jim Warner [Mon, 26 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: restored a function prologue lost a long time ago

For some reason, when top was modified to exploit that
<pids> api, one function prologue was removed. So this
commit just restores it to the 'window_show' function.

Reference(s):
. Aug, 2015 - adapted to new <pids> api
commit 77dc22b9101af39fc30306e36d65cad2b396cc9e

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: new #define added for focus ('F') toggle tweaking
Jim Warner [Sun, 25 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: new #define added for focus ('F') toggle tweaking

Just to see if I could, the new #define will force the
indentation of a parent task to be reset to zero while
maintaining the proper child indentation relationship.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: introduced new focus toggle ('F'), man doc & NEWS
Jim Warner [Sat, 24 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: introduced new focus toggle ('F'), man doc & NEWS

[ i also corrected an unrelated typographical error! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: introduced new focus toggle ('F'), program source
Jim Warner [Sat, 24 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: introduced new focus toggle ('F'), program source

Sometimes, it might be useful to isolate a parent task
and its forked children from other system activity. As
an example, a user might want to examine workload in a
specific lxc container. Or maybe there is some need to
question what's happening under the same tmux session.

Since forest view mode tends to be a relatively stable
display, it will sometimes satisfy the above need. But
that mode can't currently guarantee the target process
always remains as the topmost task or even is visible.

So, this patch will enable focusing on any parent task
and keeping it as the topmost process while displaying
it and its forked children only. It then appears as if
there is no other activity in that system by virtue of
the blank lines which follow that final child process.

To implement this new feature, top's redundant 'F' key
has been repurposed. It made little sense devoting two
keys to the Fields Management screen (especially since
the key we've taken required two separate keystrokes).

[ and while we're at it, i also added punctuation to ]
[ the prologue for that renamed 'forest_display' guy ]
[ since all other forest functions used punctuation. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: make eu_TREE_LVL a signed int not an unsigned int
Jim Warner [Fri, 23 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: make eu_TREE_LVL a signed int not an unsigned int

Since the internally kept nesting 'level' under forest
view is limited to a maximum of 101, we will now treat
it as signed to avoid any potential conversion issues.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: standardize 'pointer-to-thing' whitespace use
Jim Warner [Thu, 22 Jul 2021 05:00:00 +0000 (00:00 -0500)]
library: standardize 'pointer-to-thing' whitespace use

When declaring a pointer there's usually a space after
the thing-pointed-to and no space between the asterisk
and the pointer-thingy itself. So this commit enforces
such conventions where needed on old library elements.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: whack a label & branch in 'summary_show' function
Jim Warner [Wed, 21 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: whack a label & branch in 'summary_show' function

If there are zero numa nodes then the View_CPUNOD flag
cannot possibly be set. So it was unnecessary to check
both the numa total and View_CPUNOD in 'summary_show'.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: added a new #define to test absence of numa nodes
Jim Warner [Tue, 20 Jul 2021 05:00:00 +0000 (00:00 -0500)]
top: added a new #define to test absence of numa nodes

This new #define will produce top results identical to
the results achieved for './configure --disable-numa'.

However it keeps the change entirely local to our top.

[ it has been introduced to test the following patch ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agoNEWS: just play catch up with some top implementations
Jim Warner [Mon, 19 Jul 2021 05:00:00 +0000 (00:00 -0500)]
NEWS: just play catch up with some top implementations

These changes were already implemented for this newlib
version, but not in the the master branch top version.

[ and we also add the missing 3.3.17 ps 'exe' change ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotestsuite: Add test for previous sysctl change
Craig Small [Tue, 20 Jul 2021 12:45:17 +0000 (22:45 +1000)]
testsuite: Add test for previous sysctl change

Add a check for path traversal to sysctl.

References:
 commit f25d462166f80b844d33dad3e4c06088c809a426

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agosysctl: Check path is under /proc/sys
Craig Small [Tue, 20 Jul 2021 12:36:15 +0000 (22:36 +1000)]
sysctl: Check path is under /proc/sys

sysctl would try to read/write any path you gave it either on
the command line or configuration file. It would append /proc/sys
on the path but not check for any sneaky path traversal with ../

This commit means it first resolves all paths using realpath(3)
and then checks the path starts with "/proc/sys/"

At first I thought this might be a non-issue, but perhaps someone
could put a file into the sysctl configuration path and.. do
something? Anyway its a 8-line fix and makes things more correct.

References:
 #179

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agodoc: updated NEWS plus top(1) for IO accounting fields
Jim Warner [Tue, 22 Jun 2021 05:00:00 +0000 (00:00 -0500)]
doc: updated NEWS plus top(1) for IO accounting fields

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: fix a fix for the 'bye_bye' function (merge #127)
Jim Warner [Mon, 21 Jun 2021 05:00:00 +0000 (00:00 -0500)]
top: fix a fix for the 'bye_bye' function (merge #127)

In the merge request shown below, 1 too many bytes are
written to stdout thus including the terminating null.
As the cure, this commit just reduces the length by 1.

[ along the way, we will remove some unneeded braces ]
[ plus add some additional comments with attribution ]

Reference(s):
https://gitlab.com/procps-ng/procps/-/merge_requests/127
. original ported cchange
commit 6b8980a3b6279058d727377e914cfb6439d6f178

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: documented those newly added IO accounting fields
Jim Warner [Sun, 20 Jun 2021 05:00:00 +0000 (00:00 -0500)]
top: documented those newly added IO accounting fields

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: follow ps lead & add several IO accounting fields
Jim Warner [Sun, 20 Jun 2021 05:00:00 +0000 (00:00 -0500)]
top: follow ps lead & add several IO accounting fields

Some time ago, IO accounting was added for the library
and exploited by the ps program. This patch just plays
a little catch-up & adds similar functionality to top.

[ and we also finally get around to incrementing the ]
[ rcfile id which should have already been done when ]
[ the smaps fields were added or, at least, with USS ]

Reference(s):
. added IO accounting to ps program
commit 8baf8eeab4d5cf4ce712f3a0048985fe045c87f7
. added IO accounting to library
commit a7afe06e6f1b397b7404fbee724a51f88cc8a59c

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: correct sources for IO accounting, <pids> api
Jim Warner [Sun, 20 Jun 2021 05:00:00 +0000 (00:00 -0500)]
library: correct sources for IO accounting, <pids> api

This patch just brings 'PIDS_IO' source into alignment
with the names being used in that /proc/<pid>/io file.

[ i had my chance to fix them in a whitespace change ]
[ made in the patch referenced below, but i blew it! ]

Reference(s):
commit 2dcbe71f3b8e3586acab0221b2e4c55d10cf8f76

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agoNLS: Update translate files
Craig Small [Thu, 17 Jun 2021 06:45:07 +0000 (16:45 +1000)]
NLS: Update translate files

3 years agotop: exploit the newly added library smaps_rollup item
Jim Warner [Wed, 16 Jun 2021 05:00:00 +0000 (00:00 -0500)]
top: exploit the newly added library smaps_rollup item

We're just following the ps program's lead introducing
a new 'USS' field to represent the non-swapped portion
of physical memory ('RSS') not shared by another task.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agops: adapt to the newly added library smaps_rollup item
Jim Warner [Wed, 16 Jun 2021 05:00:00 +0000 (00:00 -0500)]
ps: adapt to the newly added library smaps_rollup item

In that commit referenced below, a new field was added
to the ps program which required adding 2 newlib items
together. Such a need is now satisfied by the library.

So, this commit will just adapt ps for that provision.

Reference(s):
commit e782b1d85989a9d27474264d4d65ffe1c485bdc9

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: add new derived smaps_rollup item, <pids> api
Jim Warner [Wed, 16 Jun 2021 05:00:00 +0000 (00:00 -0500)]
library: add new derived smaps_rollup item, <pids> api

That recent addition of USS to the ps program prompted
this change.  Rather than have it (and soon top) add 2
separate items to yield the desired value, we will let
our new library perform the arithmetic when necessary.

Outside of a little extra storage, there is no runtime
costs for such an extension. There is, however, a real
benefit to having such code in the library. Now should
callers choose to sort on this new field, results will
be guaranteed to be what was expected (i.e. accurate).

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: refactor 'mkVIZ' support to avoid future problems
Jim Warner [Tue, 15 Jun 2021 05:00:00 +0000 (00:00 -0500)]
top: refactor 'mkVIZ' support to avoid future problems

In the patch referenced below, 2 potential abends were
fixed both of which involved 'alternate display mode'.

The root cause of those abends was a negative value in
the 'begnext' field for other than the current window.

And while that potential is fixed for now the existing
code almost invites such problems again in the future.

So, this patch will remove any temptation to name some
other window in the 'mkVIZrow1' macro. And, since that
macro is not the only source of 'begnext' changes, the
'mkVizrowX' is being added to identify such occasions.

[ and for symmetry i've added a 'mkVIZyes' macro and ]
[ ameliorated an otherwise surreptitious assignment! ]

Reference(s):
commit 8281ac4f98cf04c51cbeb746d214201531d660ec

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agops: Add PSS and USS fields
Craig Small [Wed, 16 Jun 2021 11:13:52 +0000 (21:13 +1000)]
ps: Add PSS and USS fields

The library added smaps_rollup fields in the referenced commit.
This commit exploits the new fields to give pss and uss options.

These options were first proposed back in 2015 by Petr Malat
and, with the library update, they are finally made it into ps.

Why use proportional or unique segment size? It is argued that
these give a better idea of the "real" memory usage of a process.

References:
 commit 12543b6c7690c379abc28e278cd804c05490a8b1
 issue #112
 https://www.freelists.org/post/procps/PSS-and-USS-support-for-ps
 https://lwn.net/Articles/230975/

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agotestsuite: Add test for free committed
Craig Small [Wed, 16 Jun 2021 10:34:33 +0000 (20:34 +1000)]
testsuite: Add test for free committed

Add a check for free -v for committed memory.

References:
 commit 16734d580eb779654e626f3b41a98992fc0d557d

3 years agofree: option to show memory commit limits
Craig Small [Wed, 16 Jun 2021 10:29:03 +0000 (20:29 +1000)]
free: option to show memory commit limits

This commit is largely the userland only changes found in !73
added by Jens Låås (@jelaas)

References:
 procps-ng/procps!73

3 years agoc: print strerror() instead of error code.
Érico Nogueira [Fri, 4 Jun 2021 16:10:28 +0000 (13:10 -0300)]
c: print strerror() instead of error code.

This changes error() behavior to match what glibc already does.

3 years agofree: Clean up scale_size and fix `free -h --si`
Jan Alexander Steffens (heftig) [Tue, 15 Jun 2021 18:43:36 +0000 (20:43 +0200)]
free: Clean up scale_size and fix `free -h --si`

- Simplify control flow a bit. We don't need two loop variables, either.
- Consistently use %lld for bytes.
- Fix the base handling for human-readable output. The code used to
  calculate *mebibytes* first, then scale that to the required exponent
  with the selected base, which is patently wrong.

Fixes https://gitlab.com/procps-ng/procps/-/issues/133

3 years agotop: fix two potential 'alternate display mode' abends
Jim Warner [Mon, 31 May 2021 05:00:00 +0000 (00:00 -0500)]
top: fix two potential 'alternate display mode' abends

This commit will address potential abends upon leaving
the windows help or color mapping screens and invoking
alternate display mode ('A').  It only happens if that
current window was changed with multiple 'a'/'w' keys.

So now, rather than leaving a trail of negative values
in the 'begtask' field, compliments of that win_select
function, we'll remove the mkVIZrow1 macro. Henceforth
it will be issued just once per user interaction. Thus
a promise of 'Curwin' only being impacted is restored.

[ my thanks to Vladimir Chren for reporting this bug ]

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/210
https://gitlab.com/procps-ng/procps/-/merge_requests/135

Discovered by:Vladimir Chren <vladimir.chren@gmail.com>
Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agosysctl man page update for pattern
Bas van der Vlies [Thu, 25 Feb 2021 08:35:33 +0000 (09:35 +0100)]
sysctl  man page update for pattern

pattern must be used before `--system` else it does not work for sysctl
file(s)

```
root# /sbin/sysctl --system --pattern '^net.ipv6'
* Applying /etc/sysctl.d/30-ceph-osd.conf ...
fs.aio-max-nr = 1048576
kernel.pid_max = 4194304
* Applying /etc/sysctl.d/protect-links.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/sara_tweaks.conf ...
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 0
* Applying /etc/sysctl.conf ...
```

vs:
```
root# /sbin/sysctl --pattern '^net.ipv6' --system
* Applying /etc/sysctl.d/30-ceph-osd.conf ...
* Applying /etc/sysctl.d/protect-links.conf ...
* Applying /etc/sysctl.d/sara_tweaks.conf ...
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 0
* Applying /etc/sysctl.conf ...
```

References:
 !124

3 years agoconfigure: add macro to check for __PROGNAME
Henrik Grimler [Wed, 26 May 2021 13:45:02 +0000 (15:45 +0200)]
configure: add macro to check for __PROGNAME

in include/c.h we check if HAVE___PROGNAME is defined, but the
corresponding macro for setting (or not setting) it is missing from
the configure script. This commit adds the missing macro, by
copying it from the macro in tmux.

3 years agoCoverity scan findings - memleaks, unused vars, potential nullptr dereferences
Jan Rybar [Thu, 6 May 2021 14:30:54 +0000 (16:30 +0200)]
Coverity scan findings - memleaks, unused vars, potential nullptr dereferences

3 years agolibrary: rename/reposition two enumerators, <pids> api
Jim Warner [Fri, 30 Apr 2021 05:00:00 +0000 (00:00 -0500)]
library: rename/reposition two enumerators, <pids> api

The two special hugetlbfs items were misnamed. The TBL
reference (table) should be TLB (transaction lookaside
buffer). Besides, I never liked their position anyway!

[ and one macro argument tweak is being snuck in too ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agoNEWS: add comments for the new smaps_rollup provisions
Jim Warner [Wed, 28 Apr 2021 05:00:00 +0000 (00:00 -0500)]
NEWS: add comments for the new smaps_rollup provisions

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: document all of top's new smaps_rollup provisions
Jim Warner [Tue, 27 Apr 2021 05:00:00 +0000 (00:00 -0500)]
top: document all of top's new smaps_rollup provisions

[ of course, we had to renumber most existing fields ]
[ with these additions. plus, some typos were fixed. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: exploit some of those new smaps_rollup provisions
Jim Warner [Tue, 27 Apr 2021 05:00:00 +0000 (00:00 -0500)]
top: exploit some of those new smaps_rollup provisions

My, how time flies. Here we are finally attending to a
2 year old issue at long last (well, at least top is).

In truth, this change was prompted by that more recent
issue #201 and simply represents my initial picks from
among those available with the new library provisions.

Note: we have to bump that rcfile version whenever new
fields are added. That will mean older top programs no
longer can read this top's rcfile. But that's Ok since
top offers a warning before replacing an older rcfile.

Doubtless, more smaps_rollup fields will be introduced
under top as we get more experience with this feature.
However, any such usage comes with tremendoud costs as
was reported for the previous patch and repeated here:

Here is a small preview of just what you will discover
when using this command line: time top/top -d0 -n1000.

------------------------------------ as a regular user
    with only PID + RES (statm)
real       0m2.605s
user       0m1.060s
sys        0m1.377s
    with only PID + RSS (smaps)
real      0m26.397s                    10x more costly
user       0m1.253s
sys       0m24.915s

----------------- as a root (thus smaps for all tasks)
    with only PID + RES (statm)
real       0m2.651s
user       0m1.177s
sys        0m1.286s
    with only PID + RSS (smaps)
real      0m33.040s                    12x more costly
user       0m1.256s
sys       0m31.533s

Reference(s):
. top/ps: add support for PSS reporting
https://gitlab.com/procps-ng/procps/-/issues/112
. ps: expose shared/private memory separately
https://gitlab.com/procps-ng/procps/-/issues/201

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: add support for smaps_rollup file, <pids> api
Jim Warner [Mon, 26 Apr 2021 05:00:00 +0000 (00:00 -0500)]
library: add support for smaps_rollup file, <pids> api

A couple of people have suggested that smaps_rollup be
added to the ps program and/or top program. This patch
is intended to set the stage for just such extensions.

There are currently 20 displayable items in the rollup
file. And newlib sometimes uses sscanf when populating
the target, sometimes hsearch and one customized gperf
approach. None of these fit well with the smaps items.

Thus, an approach using a simple table lookup was used
and, by disabling 1 code line, it could be made immune
from changes to the items order (unlike a sscanf call)
and doesn't carry the greater cost of a hsearch/gperf.

Note: The next patch will allow top to display some of
these new fields. Then, it'll be possible to determine
the colossal costs of accessing the smaps_rollup file.

Here is a small preview of just what you will discover
when using the command 'time top/top -d0 -n1000' while
configured with just two fields: PID + 1 memory field.

------------------------------------ as a regular user
    with only PID + RES (statm)
real       0m2.605s
user       0m1.060s
sys        0m1.377s
    with only PID + RSS (smaps)
real      0m26.397s                    10x more costly
user       0m1.253s
sys       0m24.915s

----------------- as a root (thus smaps for all tasks)
    with only PID + RES (statm)
real       0m2.651s
user       0m1.177s
sys        0m1.286s
    with only PID + RSS (smaps)
real      0m33.040s                    12x more costly
user       0m1.256s
sys       0m31.533s

Reference(s):
. ps: expose shared/private memory separately
https://gitlab.com/procps-ng/procps/-/issues/201
. top/ps: add support for PSS reporting
https://gitlab.com/procps-ng/procps/-/issues/112

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: some miscellaneous tweaks before smaps_rollup
Jim Warner [Mon, 26 Apr 2021 05:00:00 +0000 (00:00 -0500)]
library: some miscellaneous tweaks before smaps_rollup

This commit is strictly cosmetic. It was an attempt to
normalize/standardize/alphabetize those #define/#undef
statements. Some missing #undef's were added plus some
comments regarding sources corrected/standardized too.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: extend end-of-job report to reflect unused fields
Jim Warner [Sun, 25 Apr 2021 05:00:00 +0000 (00:00 -0500)]
top: extend end-of-job report to reflect unused fields

In anticipation of adding some smaps_rollup stuff, our
end-of-job report will now offer some insight into the
current unused entries for a window's fieldscur array.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agovmstat: add guest time to stat
Christian Borntraeger [Wed, 28 Apr 2021 08:51:34 +0000 (18:51 +1000)]
vmstat: add guest time to stat

Since 2.6.24/33 the kernel knows about guest and guest nice time. That
is the time that is spend in KVM guests. To handle userspace programs
that do not know about this the guest time is also added to user.

Let us provide a guest time column in vmstat that collects both guest
and guest nice into a gu value.

We also subtract that value from the user time as we are now aware of
the guest value.

This commit is different to !113 in several ways:
 * newlib already knows about these to values
 * vmstat summary already shows these values
 * non-wide vmstat squishes the values

So its around the wide vmstat output.

References:
 procps-ng/procps!113
Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agolibrary: fix alignment with new 'io' types, <pids> api
Jim Warner [Sat, 24 Apr 2021 05:00:00 +0000 (00:00 -0500)]
library: fix alignment with new 'io' types, <pids> api

The commit referenced below was well done but needed a
small whitespace tweak to preserve existing alignment.

Reference(s):
. io accounting added
commit a7afe06e6f1b397b7404fbee724a51f88cc8a59c

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agomisc: Add NEWS item for previous
Craig Small [Sat, 24 Apr 2021 13:17:35 +0000 (23:17 +1000)]
misc: Add NEWS item for previous

3 years agops: Add IO Accounting fields
Craig Small [Sat, 24 Apr 2021 13:13:38 +0000 (23:13 +1000)]
ps: Add IO Accounting fields

Add the fields for the IO accounting to ps as the library now
has them added from previous commit.

References:
 commit a7afe06e6f1b397b7404fbee724a51f88cc8a59c

3 years agolibrary: adding IO accounting
Craig Small [Sat, 24 Apr 2021 12:38:48 +0000 (22:38 +1000)]
library: adding IO accounting

This is a modification of MR !122 by @renit1609 to fit the new
library.

Problem statement:
The procps library has no PROC_FILLIO flag to
fetch the proc field "/proc/[pid]/io" data
process-wise.
IO Accounting is not included as part of procps.

Requirement:
We have a requirement to fetch process wise
IO utilization which can be used for monitoring.

When looking through the procps library, I see
that IO Accounting (/proc/[pid]/io) is not being
included as part of procps. There is no such
flag like PROC_FILLIO being included in readproc.h .

Solution:
While looking at the implementation done for
other proc fields, I used the spare bits in app code.
I renamed PROC_SPARE_1 as PROC_FILLIO, the spare bit from
PROC_SPARE_* and used it for fetching /proc/[pid]/io
data as part of the procps library similar to other
fields. I moved the PROC_SPARE_* bits each by 1 bit
to retain the spare bits. Meanwhile added the IO fields
in proc_t structure.

References:
 procps-ng/procps!122
 procps-ng/procps#184

3 years agowatch.1: Correct long option for no linewrap.
Craig Small [Sat, 24 Apr 2021 02:01:49 +0000 (12:01 +1000)]
watch.1: Correct long option for no linewrap.

The correct long option for -w is --no-wrap but the man page
said it was --no-linewrap

References:
 procps-ng/procps#203

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agobuild-sys: find split systemd libraries
Christian Hermann [Wed, 14 Apr 2021 07:42:53 +0000 (09:42 +0200)]
build-sys: find split systemd libraries

With 4e7f4237 and 5e73c832, systemd library detection through pkg-config
was changed to unconditionally look for unified libsystemd.

This adds a fallback to match the previous behavior and find the split
libs as well.

References:
 procps-ng/procps!128

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agoescape.c: Fix missing nl_langinfo on certain configs
Issam E. Maghni [Sat, 24 Apr 2021 01:46:48 +0000 (11:46 +1000)]
escape.c: Fix missing nl_langinfo on certain configs

nl_langinfo and CODESET are undefined in a musl system. Instead of
uncondionally including langinfo.h, this change includes include/nls.h
which has the tests and work-arounds for systems that don't have these
features. This is similar to how other programs within procps include
langinfo.h via nls.h

References:
 procps-ng/procps!130

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agoconfigure: Add --disable-w
Issam E. Maghni [Fri, 23 Apr 2021 19:58:36 +0000 (15:58 -0400)]
configure: Add --disable-w

Some systems implement utmp as a stub so it doesn't make sense to have
a non-functioning w.  This change mitigates #193 and !126

References:
 procps-ng/procps!129
 procps-ng/procps!126
 procps-ng/procps#193

3 years agolibrary: fix an insidious bug affecting TICS_ALL_DELTA
Jim Warner [Thu, 22 Apr 2021 05:00:00 +0000 (00:00 -0500)]
library: fix an insidious bug affecting TICS_ALL_DELTA

This simple two line code change fixes an intermittent
bug whereby %CPU for parent(s) with collapsed children
could be vastly understated from those displayed under
the current 3.3.17 publicly available top & libprocps.

If one started several top instances in the background
using very a small delay interval (zero?), then if the
shell under which they were running was collapsed, you
would see similar %CPU results for both the libraries.

However, when running a demanding 'make' like a kernel
compile (especially if backed by fast processors and a
SSD), then newlib would generally show only 1/3 to 1/2
of the collapsed %CPU values that appeared for 3.3.17.

Of course, now that the bug has been swatted with this
commit the disparities between those results is easily
explained. Since newly created tasks never contributed
tics during the interval where they were created, only
with many short lived tasks would differences surface.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: lower addr resolution cost for TICS_ALL_DELTA
Jim Warner [Wed, 21 Apr 2021 05:00:00 +0000 (00:00 -0500)]
library: lower addr resolution cost for TICS_ALL_DELTA

Rather than run risks of more expensive and repetitive
address resolution, we will establish this local index
for a one time cost and avoid any potential gcc bloat.

[ this commit was made in pursuit of a bug involving ]
[ the distortion of elapsed task tics. but, it turns ]
[ out these changes had nothing to do with that bug. ]
[ however, the patch is being retained as desirable. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: respond to library type change for TICS_ALL_DELTA
Jim Warner [Wed, 21 Apr 2021 05:00:00 +0000 (00:00 -0500)]
top: respond to library type change for TICS_ALL_DELTA

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: lessen chance of distortion on TICS_ALL_DELTA
Jim Warner [Wed, 21 Apr 2021 05:00:00 +0000 (00:00 -0500)]
library: lessen chance of distortion on TICS_ALL_DELTA

That old library defined this field as 'unsigned int'.
However, here it was known as a 'signed int'. Thus for
consistency we'll now also treat it as 'unsigned int'.

[ this commit was made in pursuit of a bug involving ]
[ the distortion of elapsed task tics. but, it turns ]
[ out these changes had nothing to do with that bug. ]
[ however, the patch is being retained as desirable. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agodocs: fix a couple of spelling errors in new man pages
Jim Warner [Sat, 3 Apr 2021 05:00:00 +0000 (00:00 -0500)]
docs: fix a couple of spelling errors in new man pages

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: eliminate the #define VER_J_RCFILE as superfluous
Jim Warner [Wed, 31 Mar 2021 05:00:00 +0000 (00:00 -0500)]
top: eliminate the #define VER_J_RCFILE as superfluous

With that commit referenced below, which preserved the
'4' and + '!' toggles in the rcfile, this VER_J_RCFILE
macro was made superfluous. But, it was never removed.

Reference(s):
commit b46af6d21399a78f70e349c4476bd5545fbb44ce

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agopkill: Add lt- variants
Craig Small [Mon, 5 Apr 2021 04:40:00 +0000 (14:40 +1000)]
pkill: Add lt- variants

The pgrep code checks to see if the program is run as pkill or pidwait
and changes its behaviour accordingly.  Some older versions of libtool
run the programs as lt-pkill and lt-pidwait which means the tests fail.

We add these two program names to the checks.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agodocs: escape circumflex in sysctl.8
Craig Small [Mon, 29 Mar 2021 11:28:30 +0000 (22:28 +1100)]
docs: escape circumflex in sysctl.8

Groff says special characters should be escaped and some gettext
versions choke on it, so escape the ^

References:
 procps-ng/procps#147

3 years agobuild-sys: Handle zero length diskstats in tests
Craig Small [Mon, 29 Mar 2021 11:23:03 +0000 (22:23 +1100)]
build-sys: Handle zero length diskstats in tests

vmstat -d testsuite will fail if your /proc/diskstats is present
but zero length. While this seems buggy behaviour from lxcfs, its
there and its a simple matter to test for it and skip those tests
if we are run on a zero length /proc/diskstats system.

3 years agodocs: psr ps field is last run processor
Craig Small [Mon, 29 Mar 2021 11:11:27 +0000 (22:11 +1100)]
docs: psr ps field is last run processor

The ps.1 manpage incorrectly stated that psr field showed the
processor the process was assigned to. However if the assignment
has changed but the process has not run, then the field doesn't
change.

Some digging by @srikard showed it wasn't the processor assigned
but the last one it was run on. The man page now correctly
describes psr in that way.

References:
 procps-ng/procps#187

3 years agodocs: Explain sysctl --system better
Craig Small [Mon, 29 Mar 2021 11:07:08 +0000 (22:07 +1100)]
docs: Explain sysctl --system better

The sysctl.8 manpage explained the directory order but not that the
files were then ordered and run in lexiographic order no matter
the directory name.

References:
 procps-ng/procps#200

3 years agotop: replaced one use of fputs(3) with a write(2) call
Shaohua Zhan [Sun, 21 Mar 2021 16:00:00 +0000 (00:00 +0800)]
top: replaced one use of fputs(3) with a write(2) call

This patch is ported from a merge request shown below,
and the following represents the original commit text.

------------------------------------------------------
top: In the bye_bye function, replace fputs with the write interface.

When top calls malloc, if a signal is received, it will
call sig_endpgm to process the signal. In the bye_bye function, if the
-b option is enable, the Batch variable is set, the fputs function
will calls malloc at the same time. The malloc function is not reentrant, so
it will cause the program to crash.

Signed-off-by: Shaohua Zhan <shaohua.zhan@windriver.com>
------------------------------------------------------

Reference(s):
https://gitlab.com/procps-ng/procps/-/merge_requests/127

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agoslabtop: Check for bad d and o option combination
Craig Small [Thu, 11 Mar 2021 11:10:37 +0000 (22:10 +1100)]
slabtop: Check for bad d and o option combination

If you run slabtop with the -d option and then -o option the
delay gets set to zero and it runs forever. slabtop now checks
for this combination and errors.

Adding a DEJAGNU test also found that none of the slabtop
checks were running so they got added to the list and only the
ones that need /proc/slabinfo (if not readable) are skipped.

References:
 #160

3 years agow: Remove unreachable l option code
Craig Small [Thu, 11 Mar 2021 10:48:14 +0000 (21:48 +1100)]
w: Remove unreachable l option code

@ruihongw quite rightly pointed out we removed the l option
from the man page and getopt but the iunreachable case statement
remained.

References:
 commit 94468ac0b3be07495c1f4eccc9806bb812d93718
 #162

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agofree: Typo fix in error messages
Craig Small [Thu, 11 Mar 2021 10:45:14 +0000 (21:45 +1100)]
free: Typo fix in error messages

doesn't to don't

References:
 #195

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agomisc: needed adaptations for the changes in <pids> api
Jim Warner [Tue, 9 Mar 2021 06:00:00 +0000 (00:00 -0600)]
misc: needed adaptations for the changes in <pids> api

That snowball, which began as a simple removal of some
brackets, now ends with this third patch restoring the
ability to build our project. It was made necessary by
the renaming (and rearranging) of several enumerators.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: fix a few source/origin notations, <pids> api
Jim Warner [Tue, 9 Mar 2021 06:00:00 +0000 (00:00 -0600)]
library: fix a few source/origin notations, <pids> api

After removing brackets from those 'derived' notations
I was surprised to discover that several origin/source
comments were wrong. So this patch fixes those errors.

[ along the way a couple enumerators were renamed to ]
[ better (i hope) reflect what they're representing. ]

[ that, in turn, also required a little rearranging. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: clean 'derived' origins in header, <pids> api
Jim Warner [Tue, 9 Mar 2021 06:00:00 +0000 (00:00 -0600)]
library: clean 'derived' origins in header, <pids> api

None of the other four new api headers use brackets on
derived items. With this patch we normalize the fifth.

[ it makes for a cleaner, less confusing, appearance ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: enabled arbitrarily large numbers in 'scale' guys
Jim Warner [Mon, 8 Mar 2021 12:08:21 +0000 (06:08 -0600)]
top: enabled arbitrarily large numbers in 'scale' guys

While experimenting with a new feature, wherein select
fields display the total upon request, the capacity of
the 'num' passed to some 'scale' guys became an issue.

So this commit will, with the compiler's help, put the
responsibility for converting the integer into a float
within the calling code (instead of the called logic).

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agops: Add OOM and OOMADJ fields
Craig Small [Fri, 5 Mar 2021 06:22:29 +0000 (17:22 +1100)]
ps: Add OOM and OOMADJ fields

top has had the OOMs and OOMa fields since 2011. Ten years its
probably time that ps had these fields added too.

ps output options have oom and oomadj for OOM Score and OOM Adjustment
respectively.

References:
 procps-ng/procps#198
 commit 367fd902dab64b51ba49709004b5011440e3105a
 https://www.freelists.org/post/procps/PATCH-12-Add-missed-oom-support-to-libproc

3 years agolibrary: tweaked key used in hash table, <meminfo> api
Jim Warner [Tue, 23 Feb 2021 06:00:00 +0000 (00:00 -0600)]
library: tweaked key used in hash table, <meminfo> api

This small change was a result of some experimentation
trading our current 'hsearch' hash scheme for 'gperf'.

I discovered that when the ':' character was a part of
each 'gperf' key, that generated search logic was more
complicated and thus slower. But without a ':', it was
a little cleaner/leaner and therefore slightly faster.

Assuming that the same trailing ':' *might* affect the
current 'hsearch' logic, to be safe we will remove it.

[ while the 'gperf' version will slightly outperform ]
[ an 'hsearch', too many ugly implementation details ]
[ were exposed which complicates future maintenance. ]

[ thus, we'll retain our current 'hsearch' approach. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: normalized the 'read_failed' guys across APIs
Jim Warner [Mon, 22 Feb 2021 06:00:00 +0000 (00:00 -0600)]
library: normalized the 'read_failed' guys across APIs

This patch will condense some logic in those functions
associated with the file input operations. The changes
will not, for the most part, alter any generated code.

More significantly (though not very) was the change to
two 'strtoul' calls. Since the returned 'endptr' value
isn't exploited, when that parm is set to NULL, we can
save one instruction on each side of such calls (wow).

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agobuild-sys: Fix the uninstall-man target
Craig Small [Wed, 24 Feb 2021 09:58:28 +0000 (20:58 +1100)]
build-sys: Fix the uninstall-man target

If automake doesn't see a dist_man_MANS then there is no
uninstall-man target. This fix uses the main Makefile
targets.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agotests: Fix paths for testsuite
Craig Small [Wed, 24 Feb 2021 09:41:38 +0000 (20:41 +1100)]
tests: Fix paths for testsuite

make distcheck gets confused what is in srcdir and what is in
topdir

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agodocs: tweak two man pages due to renaming of libproc-2
Jim Warner [Sat, 20 Feb 2021 17:11:11 +0000 (11:11 -0600)]
docs: tweak two man pages due to renaming of libproc-2

Reference(s):
commit 9aa09d8862c00a8dc85910d0365332c8c99b59ce

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: eliminate a useless conditional in readproc.h
Jim Warner [Thu, 18 Feb 2021 06:00:00 +0000 (00:00 -0600)]
library: eliminate a useless conditional in readproc.h

When #define QUICK_THREADS was introduced, for copying
some task data for a child thread, one proc_t pad byte
was used to mark, then later identify, those children.

Later the QUICK_THREADS was recycled as FALSE_THREADS,
and used for a different purpose, but a conditional in
the header file erroneously remained. Now, it is gone!

Reference(s):
. Jul, 2016 - QUICK_THREADS become FALSE_THREADS
commit c546d9dd4409ee11cd466c99a820a3b5dadfe3f4
. Aug, 2011 - QUICK_THREADS intruduced
commit bb4f08ba297a67a043f7547670aa8623b54c2e67

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: Rename to libproc-2
Craig Small [Sat, 20 Feb 2021 11:30:31 +0000 (22:30 +1100)]
library: Rename to libproc-2

What to call the new library?

Keep using libprocps wouldn't do, its a very different library from
the programs' point of view. It would also mean we could have some
clashes around the packages (two package names, same library name).

The ancient procps used libproc or libproc-a.b.c where a.b.c was the
package version. Kept the revision numbers down (it was always 0.0.0)
but the name of the library changed.

So if we use libproc-2 is there a clash with an ancient procps?
procps v 2.0.0 was around in 1999 so it was 22 years ago, also the
name of the library would have been libproc-2.0.0.so not libproc-2.so
so we're fine with that.

libproc-2 seems to fit, our second major re-work of the procps
library.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agodocs: adjust revision date for our three new man pages
Jim Warner [Tue, 16 Feb 2021 06:00:00 +0000 (00:00 -0600)]
docs: adjust revision date for our three new man pages

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agodocs: expand 2 man pages 'Usage' to include VAL macros
Jim Warner [Mon, 15 Feb 2021 06:00:00 +0000 (00:00 -0600)]
docs: expand 2 man pages 'Usage' to include VAL macros

Maybe, the biggest obstacle to successfully exploiting
this new library is after those `stacks' are returned.

Unless a user requests all available `items', there is
always a need to translate an actual enumerator into a
relative position within returned stack(s) of results.

So, this patch attempts to bridge that gap by adding a
brief explanation to the existing discussion in Usage.

[ along the way, 'Usage' & 'Caveats' were refactored ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: tweak logic for /proc not mounted, <pids> api
Jim Warner [Sun, 14 Feb 2021 06:00:00 +0000 (00:00 -0600)]
library: tweak logic for /proc not mounted, <pids> api

Since 'procps_uptime' will access the /proc filesystem
the <pids> 'new' guy should should protect against the
possibility /proc isn't mounted when 'boot_seconds' is
established. A zero is better than the negative value.

[ the only distortion would be to PIDS_TIME_ELAPSED. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: normalized 'extents_free_all' use across APIs
Jim Warner [Sat, 13 Feb 2021 06:00:00 +0000 (00:00 -0600)]
library: normalized 'extents_free_all' use across APIs

With the way those 'extents_free_all' guys were coded,
there's no real need to check for a NULL this->extents
before calling 'em. That's how <stat> already does it.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agonls: Update man translations for pidwait
Craig Small [Tue, 16 Feb 2021 10:05:05 +0000 (21:05 +1100)]
nls: Update man translations for pidwait

3 years agopidwait: Add missing name change line
Craig Small [Mon, 15 Feb 2021 19:48:51 +0000 (06:48 +1100)]
pidwait: Add missing name change line

Missed one of the lines that changes from pwait to pidwait
in referenced commit.

References:
 commit 9c1a62b6373abe1a88d8cb51a67090950c5097e6

3 years agopidwait: Rename from pwait
Craig Small [Mon, 15 Feb 2021 10:10:06 +0000 (21:10 +1100)]
pidwait: Rename from pwait

pwait is already in at least Debian in a different package

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

3 years agobuild-sys: Ignore temp directory for POTFILES.in
Craig Small [Thu, 28 Jan 2021 11:35:33 +0000 (22:35 +1100)]
build-sys: Ignore temp directory for POTFILES.in

Sometimes the testing sequence would leave a source tree
under procps-ng-(version) which, if update-potfiles was
run, would include these temporary files in the list, causing issues
later.

The script now explicitly ignores those temporary files.

3 years agonls: Update the man po files
Craig Small [Mon, 15 Feb 2021 10:46:53 +0000 (21:46 +1100)]
nls: Update the man po files

Takes into account the procps*.3 manpages and updates them to the
corrected latest versions.

3 years agonls: Update translation files
Craig Small [Mon, 15 Feb 2021 10:37:56 +0000 (21:37 +1100)]
nls: Update translation files

3 years agobuild-sys: Update building of translations
Craig Small [Mon, 15 Feb 2021 10:36:57 +0000 (21:36 +1100)]
build-sys: Update building of translations

newlib was lagging behind oldlib in how the build system created
the translation files.

3 years agolibrary: update those source files for copyright dates
Jim Warner [Fri, 5 Feb 2021 06:00:00 +0000 (00:00 -0600)]
library: update those source files for copyright dates

In addition to copyright date, the initial descriptive
line was changed from a generic statement to one which
reflects the specific portion of the proc/ filesystem.

[ such descriptions alternate between 'declarations' ]
[ (h files) & corresponding 'definitions' (c files). ]

Also, a few missing copyright attributions were added.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: update the man page & source file copyright dates
Jim Warner [Thu, 4 Feb 2021 06:00:00 +0000 (00:00 -0600)]
top: update the man page & source file copyright dates

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agodocs: bring 2 man pages into agreement regarding sorts
Jim Warner [Wed, 3 Feb 2021 06:00:00 +0000 (00:00 -0600)]
docs: bring 2 man pages into agreement regarding sorts

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: tweak 'other' user/group names for efficiency
Jim Warner [Tue, 2 Feb 2021 06:00:00 +0000 (00:00 -0600)]
library: tweak 'other' user/group names for efficiency

This commit just ensures that the relatively expensive
ID to name conversions aren't performed unless they're
explicitly requested. It also internalizes those flags
that required the PROC_FILLSTATUS flag to also be set.

[ requiring a caller, in our case pids.c, to provide ]
[ two flags when a single field was the objective is ]
[ wrong & represents a future potential toe-stubber. ]

[ moreover, what's worse is that those two flags are ]
[ seemingly unrelated. but, without both, a SEGV can ]
[ can be expected when a result.str pointer is NULL. ]

[ by contrast, in the master branch those fields are ]
[ arrays which, when set to zeroes, produce an empty ]
[ string. So, there is no abend (but no name either) ]
[ when one of those two required flags were omitted. ]

[ and worth noting, in that branch it's not just one ]
[ caller required to observe a two flag requirement. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agodocs: vmstat.8 - swap is not virtual memory
Craig Small [Thu, 21 Jan 2021 06:58:48 +0000 (17:58 +1100)]
docs: vmstat.8 - swap is not virtual memory

Chanson Shen rightly pointed out that vmstat swpd stat is
swap memory used not virtual memory used.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
3 years agomisc: Update Craig's email
Craig Small [Thu, 21 Jan 2021 06:37:48 +0000 (17:37 +1100)]
misc: Update Craig's email

3 years agodocs: adapt procps_misc.3 for new 'misc.h' header file
Jim Warner [Wed, 20 Jan 2021 06:00:00 +0000 (00:00 -0600)]
docs: adapt procps_misc.3 for new 'misc.h' header file

This commit adapts our man page for a new consolidated
'misc.h' header file. Along the way, some descriptions
were shortened, others lengthened and whitespace added
in an effort to (hopefully) improve readability a bit.

[ the #include subdirectory was also corrected while ]
[ rearranging & grouping functions into 3 categories ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agoall: make buildable again for new 'misc.h' header file
Jim Warner [Tue, 19 Jan 2021 06:00:00 +0000 (00:00 -0600)]
all: make buildable again for new 'misc.h' header file

With the 4 header files removed in the previous patch,
this commit just changes all those obsolete references
to that new consolidated 'misc.h' header file instead.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: combine 4 files into new 'misc.h' header file
Jim Warner [Mon, 18 Jan 2021 06:00:00 +0000 (00:00 -0600)]
library: combine 4 files into new 'misc.h' header file

Prior to this patch, we had four separate header files
dealing with miscellaneous functions. Those four files
were documented in the single man page: procps_misc.3.

Now, we will have just a single header file documented
in a single man page (that is what's called symmetry).

[ and while we're at it, we will shorten that overly ]
[ long struct 'procps_namespaces' name to agree with ]
[ the function naming conventions, e.g. 'procps_ns'. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agodocs: update copyright, revision plus name for 2 pages
Jim Warner [Thu, 14 Jan 2021 06:00:00 +0000 (00:00 -0600)]
docs: update copyright, revision plus name for 2 pages

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: reduce overhead for another 'escape' function
Jim Warner [Wed, 13 Jan 2021 06:00:00 +0000 (00:00 -0600)]
library: reduce overhead for another 'escape' function

The preceding commit made that 'esc_all' function more
efficient by using direct pointer manipulation instead
of an indexed string reference approach within a loop.

This commit applies the same approach to the 'esc_ctl'
function. Now we'll save 12 more iterated instructions
while decreasing the function's code size by 43 bytes.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agolibrary: improve performance for one 'escape' function
Jim Warner [Tue, 12 Jan 2021 06:00:00 +0000 (00:00 -0600)]
library: improve performance for one 'escape' function

While this patch has some cosmetic whitespace changes,
more importantly it makes that 'esc_all' function more
efficient. By abandoning the indexed loop approach for
a direct pointer manipulation, we will save 9 iterated
machine instructions, for a total of 33 bytes of code.

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: a silly change forcing right margin justification
Jim Warner [Mon, 11 Jan 2021 06:00:00 +0000 (00:00 -0600)]
top: a silly change forcing right margin justification

Signed-off-by: Jim Warner <james.warner@comcast.net>
3 years agotop: allow setting variable width col scroll (1 vs. 8)
Jim Warner [Wed, 30 Dec 2020 06:00:00 +0000 (00:00 -0600)]
top: allow setting variable width col scroll (1 vs. 8)

The Inspection feature already offered an INSP_SLIDE_1
provision. This patch now offers similar extensions to
variable width column scrolling (assuming SCROLLVAR_NO
isn't defined). Such a provision was useful during the
development of some recent library UTF-8 enhancements.

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