procps/procps-ng-3.3.10-slab.patch
Dominique Leuenberger 30d135841f Accepting request 966137 from Base:System
- Drop patch procps-ng-4.0.0-aix_sortformats.dif as replaced by
  upstream patch 0002-ps-restore-aix-behavior-while-keeping-an-original-fi.patch
- Add upstream patches
  * 0001-top-update-one-function-prologue-after-rcfile-change.patch
  * 0003-ps-restore-thread-display-when-using-a-pidlist-optio.patch

- Drop not needed patch procps-ng-3.3.9-watch.patch as the API
  has changed here 

- Add patch procps-ng-4.0.0-floats.dif to avoid float errors on
  32bit architectures

- Add patch procps-ng-4.0.0-aix_sortformats.dif to restore AIX sort
  format support as well

- Update to procps-ng-4.0.0
  + Warning: new shared library interface with libproc-2
  * Rename pwait to pidwait
  * free: Add committed line option                        merge #25
  * free: Fix -h --si combined options                     issue #133, #223
  * free: Fix first column justification                   issue #229, #204, #206, Debian #1001689
  * free: Better spacing for Chinese language              issue #213
  * library: renamed to libproc-2 and reset to 0:0:0
  * library: add support for accessing smaps_rollup        issue #112, #201
  * library: add support for accessing autogroups
  * library: add support for LIBPROC_HIDE_KERNEL env var   merge #147
  * library: add support for cpu utilization to pids i/f
  * pkill: Check for lt- variants of program name          issue #192
  * pgrep: Add newline after regex error message           merge #91
  * pgrep: Fix selection where uid/gid > 2^31              merge !146

OBS-URL: https://build.opensuse.org/request/show/966137
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/procps?expand=0&rev=126
2022-04-05 17:55:16 +00:00

127 lines
5.1 KiB
Diff

---
free.1 | 6 ++++++
free.c | 7 ++++++-
proc/meminfo.c | 7 ++++++-
vmstat.c | 7 ++++++-
4 files changed, 24 insertions(+), 3 deletions(-)
--- free.1
+++ free.1 2022-03-28 11:53:32.173182702 +0000
@@ -100,6 +100,12 @@ Switch to the wide mode. The wide mode p
than 80 characters. In this mode \fBbuffers\fR and \fBcache\fR
are reported in two separate columns.
.TP
+\fB\-C\fR, \fB\-\-full\-cache\fR
+Add to the plain \fBCached\fR in-memory cache for files also more cache lines as
+the \fBNFS_Unstable\fR pages sent to the server, but not yet committed to stable storage
+and the \fBSwapCached\fR memory that once was swapped out but is swapped back.
+Can be also enabled by the environment variable \fBPS_FULL_CACHE\fR.
+.TP
\fB\-c\fR, \fB\-\-count\fR \fIcount\fR
Display the result
.I count
--- free.c
+++ free.c 2022-03-28 12:05:01.544663755 +0000
@@ -93,6 +93,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -v, --committed show committed memory and commit limit\n"), out);
fputs(_(" -s N, --seconds N repeat printing every N seconds\n"), out);
fputs(_(" -c N, --count N repeat printing N times, then exit\n"), out);
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
fputs(_(" -w, --wide wide output\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(_(" --help display this help and exit\n"), out);
@@ -244,6 +245,7 @@ int main(int argc, char **argv)
{ "committed", no_argument, NULL, 'v' },
{ "seconds", required_argument, NULL, 's' },
{ "count", required_argument, NULL, 'c' },
+ { "full-cache",no_argument, NULL, 'C' },
{ "wide", no_argument, NULL, 'w' },
{ "help", no_argument, NULL, HELP_OPTION },
{ "version", no_argument, NULL, 'V' },
@@ -263,7 +265,7 @@ int main(int argc, char **argv)
textdomain(PACKAGE);
atexit(close_stdout);
- while ((c = getopt_long(argc, argv, "bkmghltvc:ws:V", longopts, NULL)) != -1)
+ while ((c = getopt_long(argc, argv, "bkmghltvCc:ws:V", longopts, NULL)) != -1)
switch (c) {
case 'b':
check_unit_set(&unit_set);
@@ -349,6 +351,9 @@ int main(int argc, char **argv)
case 'w':
flags |= FREE_WIDE;
break;
+ case 'C':
+ setenv("PS_FULL_CACHE", "yes", 1);
+ break;
case HELP_OPTION:
usage(stdout);
case 'V':
--- proc/meminfo.c
+++ proc/meminfo.c 2022-03-28 12:39:29.291205555 +0000
@@ -3,6 +3,7 @@
*
* Copyright (C) 2015 Craig Small <csmall@dropbear.xyz>
* Copyright (C) 2016-2022 Jim Warner <james.warner@comcast.net>
+ * Copyright (c) 2008 Bart Van Assche.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -640,6 +641,7 @@ static int meminfo_read_failed (
int size;
unsigned long *valptr;
signed long mem_used;
+ const char *ev;
// remember history from last time around
memcpy(&info->hist.old, &info->hist.new, sizeof(struct meminfo_data));
@@ -692,7 +694,10 @@ static int meminfo_read_failed (
if (0 == mHr(MemAvailable))
mHr(MemAvailable) = mHr(MemFree);
- mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable);
+ if ((ev=getenv("PS_FULL_CACHE")))
+ mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable) + mHr(NFS_Unstable);
+ else
+ mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable);
/* if 'available' is greater than 'total' or our calculation of mem_used
overflows, that's symptomatic of running within a lxc container where
--- vmstat.c
+++ vmstat.c 2022-03-28 12:41:52.744612074 +0000
@@ -234,6 +234,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -p, --partition <dev> partition specific statistics\n"), out);
fputs(_(" -S, --unit <char> define display unit\n"), out);
fputs(_(" -w, --wide wide output\n"), out);
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
fputs(_(" -t, --timestamp show timestamp\n"), out);
fputs(_(" -y, --no-first skips first line of output\n"), out);
fputs(USAGE_SEPARATOR, out);
@@ -948,6 +949,7 @@ int main(int argc, char *argv[])
{"partition", required_argument, NULL, 'p'},
{"unit", required_argument, NULL, 'S'},
{"wide", no_argument, NULL, 'w'},
+ {"full-cache", no_argument, NULL, 'C'},
{"timestamp", no_argument, NULL, 't'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
@@ -964,7 +966,7 @@ int main(int argc, char *argv[])
atexit(close_stdout);
while ((c =
- getopt_long(argc, argv, "afmnsdDp:S:wthVy", longopts, NULL)) != -1)
+ getopt_long(argc, argv, "aCfmnsdDp:S:wthVy", longopts, NULL)) != -1)
switch (c) {
case 'V':
printf(PROCPS_NG_VERSION);
@@ -1031,6 +1033,9 @@ int main(int argc, char *argv[])
case 't':
t_option = 1;
break;
+ case 'C':
+ setenv("PS_FULL_CACHE", "yes", 1);
+ break;
case 'y':
/* Don't display stats since system restart */
y_option = 1;