Update to 3.3.12

This commit is contained in:
Michael Cronenworth 2018-02-21 16:57:58 -06:00
parent 3ed7941f0b
commit 0568cb60bf
8 changed files with 445 additions and 251 deletions

10
.gitignore vendored
View File

@ -1,9 +1 @@
/procps-ng-3.3.2.tar.xz /procps-ng-3.3.12.tar.xz
/procps-ng-3.3.4-20120807git.tar.xz
/procps-ng-3.3.3-20120807git.tar.xz
/procps-ng-3.3.4.tar.xz
/procps-ng-3.3.6.tar.xz
/procps-ng-3.3.7.tar.xz
/procps-ng-3.3.8.tar.xz
/procps-ng-3.3.9.tar.xz
/procps-ng-3.3.10.tar.xz

52
README.md Normal file
View File

@ -0,0 +1,52 @@
[![build status](https://gitlab.com/ci/projects/2142/status.png?ref=master)](https://gitlab.com/ci/projects/2142?ref=master)
procps
======
procps is a set of command line and full-screen utilities that provide
information out of the pseudo-filesystem most commonly located at /proc.
This filesystem provides a simple interface to the kernel data structures.
The programs of procps generally concentrate on the structures that describe
the processess running on the system.
The following programs are found in procps:
* *free* - Report the amount of free and used memory in the system
* *kill* - Send a signal to a process based on PID
* *pgrep* - List processes based on name or other attributes
* *pkill* - Send a signal to a process based on name or other attributes
* *pmap* - Report memory map of a process
* *ps* - Report information of processes
* *pwdx* - Report current directory of a process
* *skill* - Obsolete version of pgrep/pkill
* *slabtop* - Display kernel slab cache information in real time
* *snice* - Renice a process
* *sysctl* - Read or Write kernel parameters at run-time
* *tload* - Graphical representation of system load average
* *top* - Dynamic real-time view of running processes
* *uptime* - Display how long the system has been running
* *vmstat* - Report virtual memory statistics
* *w* - Report logged in users and what they are doing
* *watch* - Execute a program periodically, showing output fullscreen
## Reporting Bugs
There are a few ways of reporting bugs or feature requests:
1. Your distributions bug reporter. If you are using a distribution your first
port of call is their bug tracker. This is because each distribution has their
own patches and way of dealing with bugs. Also bug reporting often does not need
any subscription to websites.
2. GitLab Issues - To the left of this page is the issue tracker. You can report
bugs here.
3. Email list - We have an email list (see below) where you can report bugs.
The problem with this method is bug reports often get lost and cannot be
tracked. This is especially a big problem when its something that will take
time to resolve.
If you need to report bugs, there is more details on the
[Bug Reporting](https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md)
page.
## Email List
The email list for the developers and users of procps is found at
http://www.freelists.org/archive/procps/
This email list discusses the development of procps and is used by distributions
to also forward or discuss bugs.

377
README.top Normal file
View File

@ -0,0 +1,377 @@
This file summarizes changes to the top program and supporting documentation
introduced on March 31, 2011.
Contents:
DOCUMENT Changes
INTERNAL Improvements
EXTERNAL Improvements
BUGS Previously Fixed and Preserved
BUGS Newly/Nearly Fixed
BUGS/WISH-LISTS That Should Go Bye-bye
BUGS FIXED You Didn't Know You Had
OTHER Changes, Hopefully They Won't Bite You
BENCHMARKS
DOCUMENT Changes =========================================================
. The entire file was cleaned up, standardized and expanded to include:
- a new section "2. SUMMARY Display" added for symmetry with Fields
- nine new fields were added to section "3a. DESCRIPTIONS of Fields"
- a new section "3b. MANAGING Fields" replaced the obsolete section
"2b. SELECTING and ORDERING Columns"
- section "5c. SCROLLING a Window" was added for that new feature
. I don't know when the explanations for CODE and DATA were changed to
show 'virtual' memory, but I think there's a reason their alternate
names contain the word 'resident'. Thus they were changed back to
say 'physical memory'.
. And as I indicated in a previous email, the former string identifier
'ME' was restored as were the 'h' key/command conventions (vs. <h>).
Oops, the 'h' key/command conventions remain restored, but subsequent
testing revealed problems with the .ME string identifier. Thus, it was
changed to .WE (along with the companion .Me/.We id).
. Also previously mentioned, the 'man2html' program translates top.1 to
HTML with near perfect fidelity. I take that to mean there should be
no problems with the top.1 source on most other platforms.
To further improve translation to HTML, several .Bd and .Ed macros
were added to preserve literal (fixed width) spacing.
INTERNAL Improvements ====================================================
. The old restriction of 26 fields has been lifted. With this new-top
100+ fields are now possible. It currently supports up to 55, of
which 35 are in use. Adding a new field is almost too easy.
. Task row construction has been considerably improved -- both from
a programming perspective and a performance perspective.
. The column highlighting costs for sort field visibility were
virtually eliminated.
An optional define (USE_X_COLHDR) can be enabled to completely
eliminate any costs associated with the 'x' command toggle.
. The management of the HST_t structures, used for %cpu calculations,
was optimized with a hashing scheme. Thus the need for a qsort then
a binary search in each frame was completely eliminated.
An optional define can restore the former qsort/bsearch approach but
with an internal inlined binary search function offering substantially
better performance than the old top.
. This far more capable new-top executable is no larger than old top.
. The above combine to produce substantially improved performance
whose details are documented below under BENCHMARKS.
EXTERNAL Improvements ====================================================
. Field management has been completely redesigned. It's now embodied
on a single screen where display-ability, position and sort selection
can be handled in one place -- for all windows at one time!
This function is dependent on cursor motion keys and should a device
not have the customary arrow keys, alternatives are provided and
documented under "Operation" near the beginning of the man page.
. The following new fields have been added:
Group Id
Minor Page Faults
Number of Threads
Process Group Id
Real User Id
Saved User Id
Saved User Name
Session Id
Tty Process Group Id
. Scrolling keys now allow one to move the view of any window vertically
or horizontally to reveal any desired task or column. Previously, only
some tasks were viewable even with reversible, selectable sort columns.
Each of the four windows is capable of maintaining its own scrolled
coordinates and an optional toggle ('C') displays a message aiding
navigation within the available tasks and displayable fields.
. User interactive line oriented input now provides for true line
editing supported by these new keys:
Left/Right arrow keys, Delete key, Backspace and
Home/End keys (likely limited to xterm, not terminal)
. User filtering via the -u | -U interactive commands is now window
based which means that different windows could be used to filter
different users.
. Signal handling has been normalized and is now consistent regardless
of the particular top screen a user may have been using.
. The 'i' toggle now shows any task that has used *some* cpu since the
last screen update. It's no longer limited to just running tasks.
. The summary area 'task states' line now reflects either 'Threads'
or 'Tasks' depending on the -H toggle.
BUGS Previously Fixed and Preserved ======================================
( but not necessarily literally)
. 228822, suspending top leaves xterm in slightly messed-up state
. 256376, segfaults, if the xterm is to small
. 320289, segv on sigwinch
. 351065, wrong highlight 1st column (escape characters displayed)
. 358724, accepts extra numeric args
. 378695, seg fault if "/proc" is not mounted
. 426782, UID field is too narrow
. 458986, should check xterm for EOF/EIO
. 459890, Irix mode should use %#4.1f when threads shown
BUGS Newly/Nearly Fixed ==================================================
. 225542, 'Unknown command' message blocks further commands
The message is now displayed using usleep for 1.25 seconds, instead
of the former full 2 seconds. And while it still blocks further
commands, the delay is much more tolerable.
Can we consider this bug 'nearly' fixed?
. 410292, interface error when using backspace
Full line editing was added but could be disabled via a #define.
And via that define, even under basic termios support, the backspace
problem was cured.
. 567509, top idle command ('i') not working for threaded programs
Since the 'i' command now reflects tasks that have used *some* cpu,
and is no longer dependent on an 'R' state, I *believe/hope* this
bug has been swatted.
BUGS/WISH-LISTS That Should Go Bye-bye ===================================
. 340751, wish for hostname to benefit multiple top sessions
Craig's suggestion regarding symlinks is the perfect solution.
How dare Craig say that the solution was "not ideal" !
. 586497, wish for graceful degradation on small screen sizes
This objective could be accomplished by setting up 2 symlinks for
top, personalizing them for the 2 tiny phone displays, then writing
the respective configuration files.
I shudder at the programming effort suggested by Paul. And when it
was done you'd find everybody else would have different criteria.
BUGS FIXED You Didn't Know You Had =======================================
. Without amplifying the dirty details, the long standing occasionally
reported display corruption, and an unreported source of performance
degradation, has been eliminated. The cure is in the elimination of
the Pseudo_cols variable and the improved PUFF macro.
. Line oriented input was not sensitive to screen width. Thus a user
could hold down any key and ultimately line wrap, overwriting the
columns header and the entire screen. New top prevents this.
. User filtering (-u|-U) via a user ID (not name) now validates that
number. The old-top just made sure it was numeric, then blindly
displayed no matching users (i.e. an empty window).
. The threads toggle ('H') is no longer window based but more properly
applies to all windows. The previous implementation produced the
following aberration if multiple windows were being shown:
. -H would be acknowledged and applied to all visible windows
. keying 'a' or 'w' would silently turn it off
. then keying -H would turn it back on, but the user expected off
. If you hit ^Z on any help or fields screen to suspend old-top, after
issuing 'fg' you would then be left with a seemingly hung application
inviting ^C. In truth, one could recover with the space bar, but that
was far from intuitive.
. The old-top consistently writes 1 extra byte for each task row or 1
byte too few for columns headers, depending on your perspective.
The new top writes the same number of bytes for each.
. By failing to clear to eol, old top left the display in a terrible
state after exiting a 'fields' screen when only a few columns were
being displayed.
. The old-top used a zero value for the L_NONE library flag which could
cause repeated rebuilding of columns headers with each frame. In truth,
this was not likely to happen in real life since only two fields actually
used that flag. However, if it did happen, performance could be degraded
by 800%.
OTHER Changes, Hopefully They Won't Bite You =============================
. The undocumented TOPRC environment variable is no longer supported.
Any similar need can be met through a symlink alias.
. The use of environment variables to override terminal size is now
off by default but could be enabled through '#define TTYGETENVYES'.
. The global 'bold enable' toggle is active by default and thus agrees
with the documentation. It's been wrong ever since Al's wholesale
'cosmetic' changes in procps-3.2.2.
. Task defaults now show bold (not reverse) and row highlighting.
This agrees with what was always stated in the documentation.
. The 'H' toggle (thread mode) is not persistent. Persistence can be
achieved with a simple shell script employing the -H switch.
. Then 'g' and 'G' commands were reversed to reflect their likely use.
BENCHMARKS ===============================================================
Tested as root with nice -10 and using only common fields
( on a pretty old, slow laptop under Debian Lenny )
but rcfiles specified identical sort fields and identical
settings for the 'B', 'b', 'x' and 'y' toggles (even though
the defaults are not necessarily identical).
In every case new-top outperforms old-top, but I've shown %
improvements for only the most significant. Those cases mostly
involve colors with both row & column highlighting. I suggested
above that the highlighting cost was virtually eliminated in
new-top, and these tests bare that out.
Note the much smaller differences for new-top between the 24x80
window results and full screen (but don't mix apples_terminal
with oranges_xterm). This is a reflection of the simplification
of task row construction, also mentioned above.
It's always been the case that any top in an xterm outperforms
that top under the terminal application, even when the xterm
provides additional rows and columns. It's true below with
Gnome and it was true nine years ago under KDE.
----------------------------------------------------------
The following comparisons were run with:
100 tasks & 160 threads
-d0 -n5000
new-top old-top
xterm 24x80
a 1 win, lflgs_none 11.2 secs 51.8 secs + 462.6%
1 win, default 61.0 secs 66.8 secs
1 win, colors w/ x+y 61.3 secs 83.0 secs + 135.4%
1 win, thread mode 88.3 secs 94.2 secs
b 1 win, every field on 99.7 secs 106.0 secs
1 win, cmdline 71.2 secs 76.6 secs
4 wins, defaults 101.3 secs 107.2 secs
4 wins, colors w/ x+y 101.5 secs 122.8 secs + 121.0%
xterm, full screen (53x170)
a 1 win, lflgs_none 15.9 secs 54.2 secs + 340.9%
1 win, default 70.0 secs 73.2 secs
1 win, colors w/ x+y 69.4 secs 131.3 secs + 189.2%
1 win, thread mode 97.6 secs 102.6 secs
c 1 win, every field on 122.1 secs 128.1 secs
1 win, cmdline 80.8 secs 83.7 secs
4 wins, defaults 111.4 secs 115.8 secs
4 wins, colors w/ x+y 112.0 secs 172.9 secs + 154.4%
terminal 24x80
a 1 win, lflgs_none 8.9 secs 58.6 secs + 658.4%
1 win, default 70.1 secs 80.3 secs
1 win, colors w/ x+y 70.6 secs 157.3 secs + 222.8%
1 win, thread mode 104.7 secs 120.5 secs
b 1 win, every field on 111.2 secs 134.5 secs
1 win, cmdline 83.8 secs 94.5 secs
4 wins, defaults 125.6 secs 146.7 secs
4 wins, colors w/ x+y 125.6 secs 206.9 secs + 176.7%
terminal, full screen (39x125)
a 1 win, lflgs_none 9.1 secs 60.6 secs + 665.9%
1 win, default 74.3 secs 88.0 secs
1 win, colors w/ x+y 73.9 secs 314.5 secs + 425.6%
1 win, thread mode 113.0 secs 140.9 secs
b 1 win, every field on 117.7 secs 154.9 secs
1 win, cmdline 87.4 secs 107.2 secs
4 wins, defaults 139.1 secs 166.7 secs
4 wins, colors w/ x+y 157.3 secs 423.2 secs + 269.0%
----------------------------------------------------------
The following comarisons were run with:
300 tasks & 360 threads
-d0 -n3000
new-top old-top
xterm, full screen (53x170)
a 1 win, lflgs_none 14.3 secs 79.0 secs + 552.4%
1 win, default 101.1 secs 104.5 secs
1 win, colors w/ x+y 101.3 secs 140.0 secs + 138.2%
1 win, thread mode 120.1 secs 123.1 secs
c 1 win, every field on 179.8 secs 185.6 secs
1 win, cmdline 124.9 secs 132.8 secs
4 wins, defaults 174.8 secs 179.2 secs
4 wins, colors w/ x+y 175.0 secs 215.2 secs + 123.0%
terminal, full screen (39x125)
a 1 win, lflgs_none 12.3 secs 98.5 secs + 800.8%
1 win, default 117.4 secs 134.0 secs
1 win, colors w/ x+y 111.6 secs 296.1 secs + 265.3%
1 win, thread mode 141.3 secs 155.3 secs
b 1 win, every field on 197.7 secs 204.8 secs
1 win, cmdline 143.9 secs 157.3 secs
4 wins, defaults 204.0 secs 226.2 secs
4 wins, colors w/ x+y 216.9 secs 434.5 secs + 200.3%
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
notes:
a these results represent the library flags L_NONE zero value and
thus the hidden cost of rebuilding column headers w/ every frame
b while every common field was turned on, not all fields could be
displayed due to limited screen width
c only in a full screen xterm window could all common fields
actually be displayed
BENCHMARKS, Redux (for NLS) ==============================================
December, 2011 benchmarks produced on a much more modern
platform containing:
Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz
SMP with 4 cpus
reflected in the substantially reduced elapsed times.
Tested as root with nice -10 and using only common fields
but rcfiles specified identical sort fields and identical
settings for the 'B', 'b', 'x' and 'y' toggles (even though
the defaults are not necessarily identical).
Each test was run outside of X-windows at a linux console
offering 48 rows and 170 columns. This was done to reduce
contention which sometimes made comparisons problematic.
old-top = procps-3.2.8 (debian patched and memory leaking)
new-top = procps-ng-3.3.2 with NLS support
----------------------------------------------------------
The following comparisons were run with
-d0 -n5000
140 tasks & 275 threads
linux console (48x170) new-top old-top
d 1 win, lflgs_none 2.6 secs 15.0 secs + 577.0%
1 win, default 16.1 secs 19.3 secs
1 win, colors w/ x+y 16.6 secs 35.0 secs + 210.8%
e 1 win, show cpus 16.2 secs 20.1 secs + 124.1%
1 win, thread mode 31.8 secs 34.1 secs
f 1 win, every field on 30.5 secs 34.0 secs
1 win, cmdline 19.9 secs 23.1 secs
4 wins, default 31.9 secs 35.2 secs
4 wins, colors w/ x+y 29.2 secs 47.4 secs + 162.3%
g 1 win, b&w w/ bold x 30.0 secs 33.2 secs
h 1 win, scroll msg on 31.1 secs 33.9 secs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
notes:
d these represent the same anamoly as the original 'a' footnote
e these represent the '1' toggle, where each of 4 cpus was shown
(not possible on the original uniprocessor)
f every common field was turned on and all fields were visible
g on a black and white display, sort column was shown in bold
(further proof of column highlighting improvements)
h similar to 'g', but new top was showing scroll msg
(old top has no such provision)

View File

@ -1,78 +0,0 @@
diff -Naur procps-ng-3.3.10.orig/proc/sysinfo.c procps-ng-3.3.10/proc/sysinfo.c
--- procps-ng-3.3.10.orig/proc/sysinfo.c 2014-09-23 13:40:36.000000000 +0200
+++ procps-ng-3.3.10/proc/sysinfo.c 2016-01-14 13:46:42.710000000 +0100
@@ -36,6 +36,9 @@
#include <netinet/in.h> /* htons */
#endif
+#include <link.h>
+#include <elf.h>
+
long smp_num_cpus; /* number of CPUs */
long page_bytes; /* this architecture's page size */
@@ -249,14 +252,58 @@
extern char** environ;
-/* for ELF executables, notes are pushed before environment and args */
-static unsigned long find_elf_note(unsigned long findme){
+static unsigned long find_elf_note(unsigned long type)
+{
+ ElfW(auxv_t) auxv_struct;
+ ElfW(auxv_t) *auxv_temp;
+ FILE *fd;
+ int i;
+ static ElfW(auxv_t) *auxv = NULL;
unsigned long *ep = (unsigned long *)environ;
- while(*ep++);
- while(*ep){
- if(ep[0]==findme) return ep[1];
- ep+=2;
+
+ if(!auxv) {
+
+ fd = fopen("/proc/self/auxv", "rb");
+
+ if(!fd) { // can't open auxv? that could be caused by euid change
+ // ... and we need to fall back to the old and unsafe
+ // ... method that doesn't work when calling library
+ // ... functions with dlopen -> FIXME :(
+
+ while(*ep++); // for ELF executables, notes are pushed
+ while(*ep){ // ... before environment and args
+ if(ep[0]==type) return ep[1];
+ ep+=2;
+ }
+ return NOTE_NOT_FOUND;
+ }
+
+ auxv = (ElfW(auxv_t) *) malloc(getpagesize());
+ if (!auxv) {
+ perror("malloc");
+ exit(EXIT_FAILURE);
+ }
+
+ i = 0;
+ do {
+ fread(&auxv_struct, sizeof(ElfW(auxv_t)), 1, fd);
+ auxv[i] = auxv_struct;
+ i++;
+ } while (auxv_struct.a_type != AT_NULL);
+
+ fclose(fd);
+
}
+
+ auxv_temp = auxv;
+ i = 0;
+ do {
+ if(auxv_temp[i].a_type == type) {
+ return (unsigned long)auxv_temp[i].a_un.a_val;
+ }
+ i++;
+ } while (auxv_temp[i].a_type != AT_NULL);
+
return NOTE_NOT_FOUND;
}

View File

@ -1,37 +0,0 @@
From 4e7f42375a9aa860365e6007a53a357df60964f1 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Thu, 9 Jul 2015 22:12:10 +1000
Subject: [PATCH] build-sys: use merged systemd library
Since systemd 209 released in Feb 2014 three systemd libraries
including systemd-login have been merged. This change merely
checks for, and links to, the new library.
References:
http://lists.freedesktop.org/archives/systemd-devel/2014-February/017146.html
https://bugs.debian.org/731256
---
configure.ac | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 612097f..48d4a59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,10 +150,10 @@ AC_ARG_WITH([systemd],
[], [with_systemd=no]
)
if test "x$with_systemd" != xno; then
- PKG_CHECK_MODULES([SYSTEMD], [libsystemd-login >= 206], [], [
- AC_CHECK_LIB(systemd-login, sd_pid_get_slice, [have_systemd=yes], [have_systemd=no])
+ PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [], [
+ AC_CHECK_LIB(systemd, sd_pid_get_slice, [have_systemd=yes], [have_systemd=no])
if test "x$have_systemd" = xno; then
- AC_MSG_ERROR([systemd support missing/incomplete (requires >= 206)])
+ AC_MSG_ERROR([systemd support missing/incomplete (requires >= 209)])
fi
SYSTEMD_LIBS="-lsystemd-login"
])
--
2.9.3

View File

@ -1,115 +0,0 @@
diff --git a/top/top.c b/top/top.c
index 39c8545..ce63508 100644
--- a/top/top.c
+++ b/top/top.c
@@ -3524,8 +3524,9 @@ static void configs_read (void) {
case 'g': // from 3.3.4 thru 3.3.8
scat(w->rc.fieldscur, RCF_PLUS_H);
case 'h': // this is release 3.3.9
- /* w->rc.graph_cpus = 0; */// for documentation only, since
- /* w->rc.graph_mems = 0; */// DEF_RCFILE zeroes them for us
+ w->rc.graph_cpus = w->rc.graph_mems = 0;
+ // these next 2 are really global, but best documented here
+ Rc.summ_mscale = Rc.task_mscale = SK_Kb;
case 'i': // actual RCF_VERSION_ID
default: // and a future version?
if (strlen(w->rc.fieldscur) != sizeof(DEF_FIELDS) - 1)
@@ -4894,27 +4895,36 @@ static void keys_xtra (int ch) {
* ( plus, maintain alphabetical order with carefully chosen )
* ( function names: forest_a, forest_b, forest_c & forest_d )
* ( each with exactly one letter more than its predecessor! ) */
-static proc_t **Seed_ppt; // temporary window ppt ptr
-static proc_t **Tree_ppt; // resized by forest_create
-static int Tree_idx; // frame_make initializes
+static proc_t **Seed_ppt; // temporary win ppt pointer
+static proc_t **Tree_ppt; // forest_create will resize
+static int Tree_idx; // frame_make resets to zero
/*
* This little recursive guy is the real forest view workhorse.
* He fills in the Tree_ppt array and also sets the child indent
* level which is stored in an unused proc_t padding byte. */
-static void forest_adds (const int self, const int level) {
+static void forest_adds (const int self, int level) {
int i;
- Tree_ppt[Tree_idx] = Seed_ppt[self]; // add this as root or child
- Tree_ppt[Tree_idx++]->pad_3 = level; // borrow 1 byte, 127 levels
- for (i = self + 1; i < Frame_maxtask; i++) {
- if (Seed_ppt[self]->tid == Seed_ppt[i]->tgid
- || (Seed_ppt[self]->tid == Seed_ppt[i]->ppid && Seed_ppt[i]->tid == Seed_ppt[i]->tgid))
- forest_adds(i, level + 1); // got one child any others?
+ if (Tree_idx < Frame_maxtask) { // immunize against insanity
+ if (level > 100) level = 101; // our arbitrary nests limit
+ Tree_ppt[Tree_idx] = Seed_ppt[self]; // add this as root or child
+ Tree_ppt[Tree_idx++]->pad_3 = level; // borrow 1 byte, 127 levels
+#ifdef TREE_SCANALL
+ for (i = 0; i < Frame_maxtask; i++) {
+ if (i == self) continue;
+#else
+ for (i = self + 1; i < Frame_maxtask; i++) {
+#endif
+ if (Seed_ppt[self]->tid == Seed_ppt[i]->tgid
+ || (Seed_ppt[self]->tid == Seed_ppt[i]->ppid && Seed_ppt[i]->tid == Seed_ppt[i]->tgid))
+ forest_adds(i, level + 1); // got one child any others?
+ }
}
} // end: forest_adds
+#ifndef TREE_SCANALL
/*
* Our qsort callback to order a ppt by the non-display start_time
* which will make us immune from any pid, ppid or tgid anomalies
@@ -4924,6 +4934,7 @@ static int forest_based (const proc_t **x, const proc_t **y) {
if ( (*x)->start_time < (*y)->start_time ) return -1;
return 0;
} // end: forest_based
+#endif
/*
@@ -4941,7 +4952,9 @@ static void forest_create (WIN_t *q) {
hwmsav = Frame_maxtask;
Tree_ppt = alloc_r(Tree_ppt, sizeof(proc_t*) * hwmsav);
}
+#ifndef TREE_SCANALL
qsort(Seed_ppt, Frame_maxtask, sizeof(proc_t*), (QFP_t)forest_based);
+#endif
for (i = 0; i < Frame_maxtask; i++) // avoid any hidepid distortions
if (!Seed_ppt[i]->pad_3) // identify real or pretend trees
forest_adds(i, 1); // add as parent plus its children
@@ -4962,7 +4975,8 @@ static inline const char *forest_display (const WIN_t *q, const proc_t *p) {
const char *which = (CHKw(q, Show_CMDLIN)) ? *p->cmdline : p->cmd;
if (!CHKw(q, Show_FOREST) || 1 == p->pad_3) return which;
- snprintf(buf, sizeof(buf), "%*s%s", 4 * (p->pad_3 - 1), " `- ", which);
+ if (p->pad_3 > 100) snprintf(buf, sizeof(buf), "%400s%s", " + ", which);
+ else snprintf(buf, sizeof(buf), "%*s%s", 4 * (p->pad_3 - 1), " `- ", which);
return buf;
} // end: forest_display
diff --git a/top/top.h b/top/top.h
index 8f61d82..1b1b1a1 100644
--- a/top/top.h
+++ b/top/top.h
@@ -59,6 +59,7 @@
//#define STRINGCASENO /* case insenstive compare/locate versions */
//#define TERMIOS_ONLY /* just limp along with native input only */
//#define TREE_NORESET /* sort keys do NOT force forest view OFF */
+//#define TREE_SCANALL /* rescan array w/ forest view, avoid sort */
//#define USE_X_COLHDR /* emphasize header vs. whole col, for 'x' */
//#define VALIDATE_NLS /* validate the integrity of all nls tbls */
@@ -780,8 +781,10 @@ typedef struct WIN_t {
//atic void keys_window (int ch);
//atic void keys_xtra (int ch);
/*------ Forest View support -------------------------------------------*/
-//atic void forest_adds (const int self, const int level);
+//atic void forest_adds (const int self, int level);
+#ifndef TREE_SCANALL
//atic int forest_based (const proc_t **x, const proc_t **y);
+#endif
//atic void forest_create (WIN_t *q);
//atic inline const char *forest_display (const WIN_t *q, const proc_t *p);
/*------ Main Screen routines ------------------------------------------*/

View File

@ -3,22 +3,24 @@
Summary: System and process monitoring utilities Summary: System and process monitoring utilities
Name: procps-ng Name: procps-ng
Version: 3.3.10 Version: 3.3.12
Release: 18%{?dist} Release: 1%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+ License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
Group: Applications/System Group: Applications/System
URL: https://sourceforge.net/projects/procps-ng/ URL: https://sourceforge.net/projects/procps-ng/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
# README files are missing in latest tarball
Patch0: procps-ng-3.3.10-top-fix-deep-forking-forest-crash.patch # wget https://gitlab.com/procps-ng/procps/raw/e0784ddaed30d095bb1d9a8ad6b5a23d10a212c4/README.md
Patch1: procps-ng-3.3.10-find_elf_note-memory-error-fix.patch Source1: README.md
Patch2: procps-ng-3.3.10-libsystemd.patch # wget https://gitlab.com/procps-ng/procps/raw/e0784ddaed30d095bb1d9a8ad6b5a23d10a212c4/top/README.top
Source2: README.top
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: libtool BuildRequires: libtool
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: gcc
BuildRequires: gettext-devel BuildRequires: gettext-devel
BuildRequires: systemd-devel BuildRequires: systemd-devel
@ -84,10 +86,9 @@ Internationalization pack for procps-ng
%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
cp -p %{SOURCE1} .
cp -p %{SOURCE2} top/
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build %build
# The following stuff is needed for git archives only # The following stuff is needed for git archives only
@ -132,7 +133,7 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%ldconfig_scriptlets %ldconfig_scriptlets
%files %files
%doc AUTHORS Documentation/BUGS Documentation/FAQ NEWS README top/README.top Documentation/TODO %doc AUTHORS Documentation/bugs.md Documentation/FAQ NEWS README.md top/README.top Documentation/TODO
%{!?_licensedir:%global license %%doc} %{!?_licensedir:%global license %%doc}
%license COPYING COPYING.LIB %license COPYING COPYING.LIB
%{_libdir}/libprocps.so.* %{_libdir}/libprocps.so.*
@ -143,7 +144,6 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%{_mandir}/man5/* %{_mandir}/man5/*
%{_mandir}/*/man1/* %{_mandir}/*/man1/*
%{_mandir}/*/man8/* %{_mandir}/*/man8/*
%{_mandir}/*/man5/*
%exclude %{_libdir}/libprocps.la %exclude %{_libdir}/libprocps.la
%exclude /unwanted/* %exclude /unwanted/*
@ -159,6 +159,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%files i18n -f %{name}.lang %files i18n -f %{name}.lang
%changelog %changelog
* Wed Feb 21 2018 Michael Cronenworth <mike@cchtml.com> - 3.3.12-1
- Upgrading to 3.3.12
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.3.10-18 * Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.3.10-18
- Escape macros in %%changelog - Escape macros in %%changelog

View File

@ -1 +1 @@
1fb7f3f6bf92ce6c5c9ed9949ae858fe procps-ng-3.3.10.tar.xz SHA512 (procps-ng-3.3.12.tar.xz) = ea816740ff72cc53d99b5d2e78a511b627ea5b295e0efff67605c56d1ab075abc6b0e2da3df4facbfe903fc9d679e892d351b6884a966d37c6f4bfd9141a924b