Commit Graph

3716 Commits

Author SHA1 Message Date
Ingo Saitz
7e24816538 vmstat: Update memory statistics
vmstat <n> would update most fields, but the memory statistics
were only fetched the first time.

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

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2023-01-06 13:30:39 +11:00
Craig Small
dd3cb0892d ps: Correct BSD c option
procps 3.3.17 the c option changed the command/args field
to cmd but this got removed as part of newlib

Functionality is back in with a test case.

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

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-12-19 16:50:12 +11:00
Craig Small
ab978d62ae docs: ps.1 - comm can show command name changes
The man page said it cannot show changes to comm, such as when you
use prctl(). In fact, ps can see this. The args field may not change
because its due to the path of the executable but comm can.
2022-12-13 16:36:56 +11:00
Craig Small
838de1de67 docs: ps.1 remove defunct from comm
The field comm no longer shows defunct for zombie processes, use the
state field for this as it could be obscured if not the last
column anyhow.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-12-12 16:59:23 +11:00
Craig Small
20d1e70b48 Merge branch 'master' of gitlab.com:procps-ng/procps 2022-12-12 16:48:21 +11:00
Craig Small
f7a33746f8 skill: Restore the -p flag functionality
When the skill program was ported to the new API the code to filter
on PID, used by the -p option, was missed. It is now restored.

References:
 https://bugs.debian.org/1025915
2022-12-12 16:46:36 +11:00
Craig Small
c444c55ce8 nls: Update man translation files 2022-12-09 22:56:14 +11:00
Werner Fink
31117ae10e build-sys: Remove duplicate manpages
Fix the building of the man pages instead of installing the same
english ones twice.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-12-06 22:30:35 +11:00
Craig Small
82d8e3faf3 tests: Fix type for check_fatal_proc_unmounted
While ps used the correct type for PIDS_VM_RSS the test
did not. For some reason this only appeared to be an issue
for s390x

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

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-12-06 22:23:08 +11:00
Craig Small
3c7a0c7cea Integrate the 'newlib' branch with the 'master' branch
[ with the histories of both branches also preserved ]

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-12-05 22:44:27 +11:00
Craig Small
135069f2b2 build-sys: Set library to 0:1:0
There was a bug fix in the library but no functions add/moved/changed
Revision incremented.
2022-12-05 21:04:05 +11:00
Craig Small
04ba0d5111 nls: update po and ro 2022-12-05 21:01:48 +11:00
Craig Small
493198dce3 nls: Update translations
Added po and ro languages too.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-12-05 20:59:00 +11:00
Craig Small
86d1f9fd82 NEWS: Change to 4.0.2 2022-11-26 08:55:21 +11:00
Craig Small
9bfa9a3e56 nls: Update 2022-11-26 08:53:54 +11:00
Craig Small
c594a742a3 nls: Update translations
Side-effect of previous commit

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-11-10 21:56:22 +11:00
Craig Small
5ed8add969 nls: Update the man-po logic
Put the man-po pot file under version control like its po/*.pot sibling.

Makefile now auto-matically generates the list of man pages as they are
in a single directory. There were some missing!

pot file target is dependent on the untranslated man pages

When downloading from translation project, run po4a to sync the new
po files correctly.

Downloaded man po files from translation project and synched.

Thanks to @gorean for the info

References:
 procps-ng/procps#258

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-11-10 21:52:19 +11:00
Chris Down
c92da2adc5 pkill: Don't show --echo twice
Commit c8384e682c ("pgrep: add pwait") changed from the old i_am_pkill
logic, but mistakenly missed a break in the pkill case. This results in
showing -e/--echo twice when running `pkill -h'.

Signed-off-by: Chris Down <chris@chrisdown.name>
2022-11-09 10:51:12 +00:00
Craig Small
d9c3e3676d revert: pidfd_open check
This change confused the pidfd_open check with the existance
of NR_pidfd_open
2022-11-09 21:32:26 +11:00
Fabrice Fontaine
17f94796a9 fix pifd_open check
Replace AC_CHECK_FUNC by AC_CHECK_FUNCS otherwise HAVE_PIDFD_OPEN will
never be defined resulting in the following build failure if pidfd_open
is available but __NR_pidfd_open is not available:

pgrep.c: In function 'pidfd_open':
pgrep.c:748:17: error: '__NR_pidfd_open' undeclared (first use in this function); did you mean 'pidfd_open'?
  748 |  return syscall(__NR_pidfd_open, pid, flags);
      |                 ^~~~~~~~~~~~~~~
      |                 pidfd_open

This build failure is raised since the addition of pwait in version
3.3.17 and
c8384e682c

Fixes:
 - http://autobuild.buildroot.org/results/f23a5156e641b2ebdd673973dec0f9c87760c688

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2022-11-09 10:15:05 +00:00
Craig Small
d99c213af9 w: Show time with TIME_BITS=64 on 32bit env
Thanks to @kabe-gl for this patch.

w command shows ????? for LOGIN@ column when compiled on 32bit environment with -D_TIME_BITS=64.

References:
 #256

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-11-09 21:02:09 +11:00
Jim Warner
2647eb57da top: also adapted to absent 'core id' in /proc/cpuinfo
Just as our library was made responsive to a potential
missing 'core id', the top program should also change.

That's because he has his own PRETENDECORE #define and
if that was activated on a platform without 'core id',
the 'CpP' notations would have otherwise been omitted.

Reference(s):
. Oct, 2022 - library fix for missing 'core id'
commit b89e3230b2

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-30 21:18:30 +11:00
Craig Small
474e22eb0b misc: Add NEWS item for missing core_id
Tracking what we do to the library so the N:N:N version strings are
updated. This is just a NEWS item for previous commit.

References:
 commit b89e3230b2
2022-10-25 20:18:35 +11:00
Jim Warner
b89e3230b2 library: adapted for absent 'core id' in /proc/cpuinfo
A big oops on my part - with a big thanks to Dr. Fink.

[ this version eliminates an extraneous startup call ]
[ to the 'stat_cores_verify' function as superfluous ]

Reference(s):
https://www.freelists.org/post/procps/For-procpsng4001-No-core-id-in-eg-aarch65-or-ppc64le-proccpuinfo

Prototyped by: Dr. Werner Fink <werner@suse.de>
Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-25 20:16:12 +11:00
Craig Small
a423367450 nls: Fix polish translation (again) 2022-10-20 22:15:31 +11:00
Jim Warner
6eba357054 top: whack an obsolete string plus its associated code <=== port of newlib 244f2b33
______________________________ original newlib message
----------------------------------- ( minus git hash )

When long command line options were introduced, in the
patch shown below, the string associated with the enum
'WRONG_switch_fmt' became obsolete. However, that enum
and its string were never removed. Well, now they are.

Reference(s):
. Sep, 2021 - getopt and long cmdline options
commit ........................................

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-20 21:44:14 +11:00
Craig Small
06e3cd6e51 NEWS: Set version to 4.0.1 2022-10-20 20:58:25 +11:00
Craig Small
06bb25ee4a nls: Last translation update for 4.0.1 2022-10-20 20:56:17 +11:00
Craig Small
c2092ad537 nls: Update translations 2022-10-16 20:06:14 +11:00
Jim Warner
57774f0332 top: restore missing support for 'MEMGRAPH_OLD' define
When support for graphs was refactored, in that commit
referenced below, the logic for our 'MEMGRAPH_OLD' was
lost while the #define itself remained in the .h file.

Faced with deleting the #define or restoring the logic
I chose the latter. Thus, if one wanted to be reminded
how overstated 'used' memory once was, it can be done.

Reference(s):
. Sep, 2022 - refactored graph support
commit 2d5b51d1a2

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-16 19:56:19 +11:00
Jim Warner
244f2b33f2 top: whack an obsolete string plus its associated code
When long command line options were introduced, in the
patch shown below, the string associated with the enum
'WRONG_switch_fmt' became obsolete. However, that enum
and its string were never removed. Well, now they are.

Reference(s):
. Sep, 2021 - getopt and long cmdline options
commit c91b371485

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-16 19:56:19 +11:00
Jim Warner
ab05a3785f top: fix a flaw in excluding a string from translation
In that commit referenced below, I removed the command
line help text from any translation so the TP wouldn't
delay our 4.0.1 release any further. In looking to the
future, when we might be able to reverse that, I found
gettext tools blocking use of the compile conditional.

They are too primitive for the original approach so we
must modify that exclusion mechanism hack accordingly.

____________________________excerpted program comments

The provision excluding some strings is intended to be
used very sparingly. It exists in case we collide with
some translation project person in a position to delay
a future release over his or her personal preferences.

If it's ever enabled, it will produce a fatal compiler
error as our only option since those gettext tools are
far too primitive to be influenced with a conditional.
They always ignore a '_X()' macro no matter its state.

Reference(s):
commit 8a368bfb05

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-06 22:05:36 +11:00
Craig Small
993bd1b7ab nls: man translation updates 2022-10-04 22:36:48 +11:00
Craig Small
db886736d1 nls: Update translations 2022-10-04 11:02:04 +11:00
Jim Warner
8a368bfb05 top: enable exclusion of some strings from translation
The provision excluding some strings is intended to be
used very sparingly. It exists in case we collide with
some translation project person in a position to delay
a future release over his or her personal preferences.

(it's currently used only on v4.0.1 command line help)

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-04 10:57:34 +11:00
Jim Warner
c7568b28fb top: always validate that p-core/e-core identification
Prior to this commit, when the '5' key was struck, top
would check for the presence of e-cores just one time.

That meant if a some cpu was brought online, and it in
turn exposed a new e-core after top has started, users
needed a top restart to activate the  new '5' feature.

So, now we'll check for any e-cores with each '5' key.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-04 10:57:34 +11:00
Jim Warner
f571746af2 library: tweak support of p-core/e-core identification
Wow, after this we'll eliminate one 'jmp' instruction!

[ plus we can also save a single precious whitespace ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-10-04 10:57:34 +11:00
Craig Small
850548bdb4 nls: Update translations 2022-09-30 08:28:58 +10:00
Craig Small
8f1b7070b7 NEWS: Add entry for free --si fix
References:
 procps-ng/procps!163
2022-09-28 17:59:23 +10:00
Jan Rybar
3ea211fab8 free: --si changes base of default output 2022-09-28 07:57:03 +00:00
Craig Small
f9f5f6ad38 build-sys: Allow enable-watch9bit and with-ncurses
The commit that changed configure.ac was supposed to check for when
someone removes ncurses using the flag --without-ncurses

Unfortunately the change didn't check if the user was specifying
--without or --with meaning if they didn use --with-ncurses the
configure script would error out.

Signed-off-by: Craig Small <csmall@dropbear.xyz>

References:
  commit 8128641814
  procps-ng/procps#251
2022-09-28 17:46:52 +10:00
Jim Warner
4b607edc12 doc: updated with library p-core/e-core identification
Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-28 17:30:56 +10:00
Jim Warner
00f5c74b1b top: exploit that library p-core/e-core identification
I sure hope we won't disappoint the library with these
changes since we're only exploiting one of the two new
enumerators that the immediately prior patch provided.

Now top will be able to offer a visual clue as to each
cpu (thread actually) core association. Is it a P-core
offering multiple threads or a single threaded E-core.

We'll accomplish this feat with a subtle change to the
states portion ('t' toggle) of the summary area. Where
before processors were represented as 'Cpu', they will
now be displayed as 'CpP' (P-core) and 'CpE' (E-core).

[ assuming that new '5' command toggle has been used ]

There are also new provisions for filtering those cpus
by their core type association via the new '5' toggle.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-28 17:30:56 +10:00
Jim Warner
6e51196589 library: provided for cpu p-core/e-core identification
With Intel's 12th generation Alder Lake processors now
providing two distinct types of core, it would be nice
if the library offered some sort of clue to core type.

Well, with this patch it does. We'll have 2 additional
enumerators. One deals with the cpu's core association
and the other provides the type of that core (P or E).

[ now, all we need is for some program to exploit it ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-28 17:30:56 +10:00
Jim Warner
e81b58beaa top: avoid any potential race involving 'BREAK_screen' <=== port of newlib 3e5016c2
______________________________ original newlib message
----------------------------------- ( minus git hash )

When that 'Bottom' window was being finalized, an enum
of BREAK_screen was added to the Frames_signal values.
This was done so some full screen replacement function
could flag the need for that bottom window to go away.

Around that same time, top was made more responsive to
keyboard input so that residual portions of a previous
bottom window would not linger until the next refresh.
This happened if going from a larger (^N, environment)
bottom window to some smaller window (^P, namespaces).

The combined effect of these changes was to create the
potential race condition this commit addresses. If the
user encountered a SIGWINCH while on any of those full
screen replacement displays (help, fields mgmt, etc.),
endless redraws would occur. A ^C was the only option.

Henceforth we will protect against any redraw loops by
clearing Frames_signal each time a redraw is required.

[ along the way, we'll make the 'q' key work on that ]
t secondary 'windows' help screen as it should, even ]
[ though it is not documented on that screen itself. ]

Reference(s):
. May, 2022 - more responsive to keyboard input
commit ........................................
. May, 2022 - maybe force the bottom window off
commit ........................................

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-20 19:34:40 +10:00
Jim Warner
ca182cb894 top: try avoiding the edge of a 'divide by zero' cliff <=== port of newlib 5f9185e0
______________________________ original newlib message
----------------------------------- ( minus git hash )

Darn, after testing on some older, out of date distros
I was embarrassed to find some awful code I created in
the commit shown below. I was rewarded with some 'nan'
floating point values and 'inf' computational results.

Reference(s);
. a missed opportunity to repent
commit ........................................
. true source of my original sin
commit ........................................

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-20 19:34:40 +10:00
Jim Warner
cbc515e208 top: fix 'TOG4_MEM_1UP' if two abreast summary display <=== port of newlib 124f26a4
The 'unrelated' note reflected in the original message
doesn't apply since we already used that correct name.

______________________________ original newlib message

If one per line display of Mem/Swap data was forced by
this #define, screen width was not fully exploited for
graph mode. Rather, those graphs were scaled just like
they would be if aligned with a nonexistent separator.

With this commit, those graphs will expand to fill the
screen width (or be limited by the maximum of '100' ).

[ and in unrelated news a variable used in do_memory ]
[ was changed for consistency. it doesn't affect the ]
[ the results since a part1 of swap was always zero. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-20 19:34:40 +10:00
Jim Warner
2e84fdb05b top: enhance memory graphs two abreast summary display <=== port of newlib 602146a6
______________________________ original newlib message

This patch introduces a new #define TOG4_MEM_FIX which
serves to turn off the new feature it also implements.

The feature, on by default, provides a flexible memory
graph approach which strives to always keep its visual
separator in alignment with cpu separators seen above.

Below is a summary of the algorithm implementing this:

1) First, ascertain the widest graph which corresponds
to the largest number of cpu graphs but doesn't exceed
maximum allowable graph width (i.e. GRAPH_length_max).

2) Next, apply that to the graphed 'Mem' portion which
is likely to remain entirely visible. However, it will
grow or shrink depending on total adjacent cpu graphs.

3) Last, the same width is used for the 'Swap' portion
but that graph is considered sacrificial and very well
could be truncated depending on the width of a screen.

[ along the way, when the cpu graphs revert to their ]
[ abbreviated form, the memory graphs will also show ]
[ an abbreviated prefix. in this way the widths will ]
[ also be maximized, reducing potential distortions. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-20 19:34:40 +10:00
Jim Warner
729a25ee1c top: cosmetic changes with two abreast summary display <=== port of newlib bf916fdf
______________________________ original newlib message

This commit will change some comments, adjust a little
whitespace but mostly rename some #define identifiers.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2022-09-20 19:34:40 +10:00
Jim Warner
ad8a8bee17 top: distinct separator if two abreast summary display <=== port of newlib 96153c0f
______________________________ original newlib message

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>
2022-09-20 19:34:40 +10:00