The referenced commit the comm length was increased from 16 to 64
characters to handle the larger command names for things like kernel
threads.
However most user processes are limited to 15 characters which means
if you try something like ps -C myprogramisbiggerthansixteen this would
fail to match because /proc/<PID>/comm would only be myprogramisbigg
ps now checks the comm length and if it is 15 and if the given match
is 15 or more, it will only match the first 15 characters.
This is also how killall has worked for about a year.
Thanks to Jean Delvare <jdelvare@suse.de> for the note.
References:
commit 14005a371e
commit psmisc/psmisc@1188315cd0
Signed-off-by: Craig Small <csmall@dropbear.xyz>
This patch is an outgrowth of that commit shown below.
Many additional potential segmentation faults might be
encountered if interactive commands are opened up to a
user when a '-p' switch has a single non-existent pid.
[ always the 'k', 'L', 'r', 'Y' keys & maybe 'v' too ]
So, this patch will restrict such a loser (oops, user)
to a reduced subset of normal commands until he/she/it
quits then restarts top with something to be displayed
or issues the '=' command overriding that '-p' switch.
Reference(s):
commit f57a0301e3
Signed-off-by: Jim Warner <james.warner@comcast.net>
This patch fixes a nearly decade old bug discovered by
Frederik Deweerdt. His merge request shown below would
be an adequate solution except for iterative overhead.
This alternate patch will represent substantially less
overhead for an admittedly extremely rare possibility.
Reference(s):
https://gitlab.com/procps-ng/procps/-/merge_requests/114
And-thanks-to: Frederik Deweerdt <fdeweerdt@fastly.com>
Signed-off-by: Jim Warner <james.warner@comcast.net>
What had been stated as the contents of the cpu graphs
was never really inclusive enough. Those recent newlib
tweaks highlighted the need for these man doc changes.
Signed-off-by: Jim Warner <james.warner@comcast.net>
[ this is what happens when i've run out of bugs and ]
[ issues and am now left with way too much free time ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
All of these changes are self-explanatory, so I'll not
provide any more comments thus avoiding further shame.
[ everything's perfectly justified and right margins ]
[ are filled entirely, but of course it must be luck ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit just addresses those warnings shown below.
Reference(s):
proc/sysinfo.c: In function `getrunners':
proc/sysinfo.c:491:26: warning: `%s' directive writing up to 255 bytes into a region of size 26 [-Wformat-overflow=]
491 | sprintf(tbuf, "/proc/%s/stat", ent->d_name);
| ^~
pgrep.c: In function `select_procs':
pgrep.c:591:11: warning: suggest explicit braces to avoid ambiguous `else' [-Wdangling-else]
591 | else if (opt_older)
| ^
Signed-off-by: Jim Warner <james.warner@comcast.net>
This patch just repositions some .PP macros so they'll
immediately precede the paragraphs to which they apply
rather than a comment line used as a visual separator.
[ ok we also update the document date to 'July 2020' ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit addresses the errors/warnings shown below.
Reference(s):
ERROR: skipping end of block that is not open: RE
WARNING: skipping paragraph macro: sp after PP
WARNING: skipping paragraph macro: PP empty
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit only eliminates two 'nop' instructions and
one 'jmp' instruction. However, it makes that C source
code look a little bit prettier than it looked before.
[ and yes, some unnecessary parenthesis were used to ]
[ force an alignment of some related lines. it costs ]
[ us nothing in extra code yet helps in readability. ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
This patch eliminates one variable which resulted in a
corresponding elimination of three 'mov' instructions.
[ that was 6 bytes per 'mov' for a total of 18 bytes ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
vmstat - align wording with proc manpage to clarify ambiguities (rhbz#1796043)
watch - manpage presumes ntp tools are present by default (which they're not on rpm and deb distros, rhbz#1583669)
We won't go as far as the merge request shown below in
increasing buffer size, but we'll reduce substantially
total iterations while growing it to achieve one read.
[ and this seems in line with what was recently done ]
[ to accommodate the massively parallel environments ]
[ thru 2 abreast ('4') and combined cpus ('!') modes ]
Reference(s:
https://gitlab.com/procps-ng/procps/-/merge_requests/105
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is prompted by the preceding change to the
library's escape.c module which, in turn, was prompted
by that issue shown below (with thanks to Konstantin).
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/176
Signed-off-by: Jim Warner <james.warner@comcast.net>
Thanks to Konstantin for discovering 2 problems in the
issue referenced below. That 15+ year old logic went a
little too far overboard wrestling with a utf8 string.
Henceforth, we will not treat 'x9b' as special. And we
also will handle a 'combining acute accent' correctly.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/176
Signed-off-by: Jim Warner <james.warner@comcast.net>
I've grown to hate that man document rendering when it
comes to hyphenation. So this patch will eliminate it.
And we'll also eliminate an unnecessary initialization
in that top program code concerned with combined cpus.
Signed-off-by: Jim Warner <james.warner@comcast.net>
This ensures that a single '4' keystroke will reliably
toggle the new 2 abreast mode ON. Depending on whether
an older configuration file existed or whether top was
configured with '--disable-modern-top', keying the '4'
for a second time might otherwise have been necessary.
Signed-off-by: Jim Warner <james.warner@comcast.net>
The previous PRETEND8CPUS #define was recently changed
to PRETEND48CPU to better exercise the new '4' and '!'
toggles. But, the implementation simply duplicated the
/proc/stat summary line for each cpu. Therefore, every
cpu showed the same graph/detail (depending upon 't').
This patch shows the actual individual cpu information
(duplicated, of course, when total cpus are exceeded).
Signed-off-by: Jim Warner <james.warner@comcast.net>
This patch will address Craig's feedback regarding the
original implementation of top's two new toggles. It's
likely other users would have questioned why they were
not saved also, once they discover these new features.
And, since the minimum terminal width was just lowered
to 80 columns, the default for window #1 is also being
changed to show the individual cpu graphs two abreast.
[ assuming no '--disable-modern-top' for ./configure ]
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172https://www.freelists.org/post/procps/two-major-changes-to-top,1
Signed-off-by: Jim Warner <james.warner@comcast.net>
I'm about to break older top rcfile compatibility when
preserving those two new toggles. And, though this has
happened several times over the years, we never issued
any warnings that such thing was just about to happen.
So, this patch corrects the long standing shortcoming.
Signed-off-by: Jim Warner <james.warner@comcast.net>
For the original implementation of the '4' toggle, the
minimum width was set at 165 columns. This was done to
avoid truncations when detailed cpu statistics (versus
graphs) were being displayed. Those can not be scaled.
Upon reflection, it seems more appropriate to give the
user the choice of whether or not to truncate. And, by
reducing that minimum width requirement to 80 columns,
we'll vastly expand potential use of two abreast mode.
[ we'll keep that original as '#define TOG4_NOTRUNC' ]
The patch also updates the man document appropriately.
Along the way, we will trade the potentially confusing
word 'adjacent' for the more natural 'additional' when
detailing the '!' toggle in 4b. Summary-Area-Commands.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172https://www.freelists.org/post/procps/two-major-changes-to-top
Signed-off-by: Jim Warner <james.warner@comcast.net>
This patch attempts to supress the following warnings:
. MISSING_BREAK, TAINTED_SCALAR plus SIZEOF_MISMATCH .
Signed-off-by: Jim Warner <james.warner@comcast.net>
This patch simply allows for better testing of our two
new toggles: '4' (2 abreast) plus '!' (combined cpus).
Signed-off-by: Jim Warner <james.warner@comcast.net>
When implementing that earlier '4' toggle, in response
to the issue referenced below, I got to thinking about
those environments with massively parallel processors.
Such environments may not benefit from the '4' toggle.
So, I decided to implement a feature that could enable
use of those '1' and/or '4' toggles no matter how many
active processors top may have ultimately encountered.
With the new '!' toggle, adjacent cpus can be combined
to any degree, represented as a single cpu group/line.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
Signed-off-by: Jim Warner <james.warner@comcast.net>
In the back of my mind, I've always wanted to enable a
two abreast cpu display. Folks with massively parallel
machines must surely have been frustrated with the '1'
toggle when Off (individual cpus in the Summary Area).
So, I'll use that recently raised issue shown below as
a justification for finally implementing this feature.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/172
Signed-off-by: Jim Warner <james.warner@comcast.net>
Wow, hard to believe the extraneous comment line dates
all way back to an introduction of NLS support (2011).
Signed-off-by: Jim Warner <james.warner@comcast.net>
Reverted the translation hint as the fields are used for both
normal and wide modes, so need to fit the smaller of the two.
Added NEWS item
References:
commit 01c1b2345e
From http://man7.org/linux/man-pages/man5/proc.5.html:
(22) starttime %llu
The time the process started after system boot. In
kernels before Linux 2.6, this value was expressed
in jiffies. Since Linux 2.6, the value is expressed
in clock ticks (divide by sysconf(_SC_CLK_TCK)).
The referenced commits enavled both pkill and kill to send an integer to
the killed or signalled process. The test_process now will report on the
integer if sent and the testsuite changes take advantage of this
new feature.
Another process make/destroy set had to be made as using spawn
instead of exec changes both the SID and TTY for the underlying
process, making other tests fail.
References:
commit 7d55409b82
commit 2b804a532a
Based on the command line option, use 'sigqueue'
instead of 'kill' to pass the integer value with
the signal.
References:
procps-ng/procps!32
Signed-off-by: Craig Small <csmall@dropbear.xyz>