2015-02-06 10:44:35 +01:00
|
|
|
---
|
2018-04-20 17:24:44 +02:00
|
|
|
free.1 | 6 ++++++
|
2015-02-06 10:44:35 +01:00
|
|
|
free.c | 7 ++++++-
|
2022-04-14 17:23:21 +02:00
|
|
|
proc/sysinfo.c | 4 ++++
|
|
|
|
vmstat.c | 6 +++++-
|
|
|
|
4 files changed, 21 insertions(+), 2 deletions(-)
|
2015-02-06 10:44:35 +01:00
|
|
|
|
|
|
|
--- free.1
|
2022-04-14 17:23:21 +02:00
|
|
|
+++ free.1 2019-12-11 06:20:16.659772479 +0000
|
2016-08-18 09:15:06 +02:00
|
|
|
@@ -100,6 +100,12 @@ Switch to the wide mode. The wide mode p
|
2015-02-06 10:44:35 +01:00
|
|
|
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
|
2016-08-18 09:15:06 +02:00
|
|
|
+the \fBNFS_Unstable\fR pages sent to the server, but not yet committed to stable storage
|
2015-02-06 10:44:35 +01:00
|
|
|
+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
|
2022-04-14 17:23:21 +02:00
|
|
|
+++ free.c 2019-12-11 06:20:16.659772479 +0000
|
|
|
|
@@ -90,6 +90,7 @@ static void __attribute__ ((__noreturn__
|
|
|
|
fputs(_(" -t, --total show total for RAM + swap\n"), out);
|
2015-02-06 10:44:35 +01:00
|
|
|
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);
|
2022-04-14 17:23:21 +02:00
|
|
|
@@ -231,6 +232,7 @@ int main(int argc, char **argv)
|
|
|
|
{ "total", no_argument, NULL, 't' },
|
2015-02-06 10:44:35 +01:00
|
|
|
{ "seconds", required_argument, NULL, 's' },
|
|
|
|
{ "count", required_argument, NULL, 'c' },
|
2022-04-14 17:23:21 +02:00
|
|
|
+ { "full-cache",required_argument, NULL, HELP_OPTION },
|
2015-02-06 10:44:35 +01:00
|
|
|
{ "wide", no_argument, NULL, 'w' },
|
|
|
|
{ "help", no_argument, NULL, HELP_OPTION },
|
|
|
|
{ "version", no_argument, NULL, 'V' },
|
2022-04-14 17:23:21 +02:00
|
|
|
@@ -250,7 +252,7 @@ int main(int argc, char **argv)
|
2015-02-06 10:44:35 +01:00
|
|
|
textdomain(PACKAGE);
|
|
|
|
atexit(close_stdout);
|
|
|
|
|
2022-04-14 17:23:21 +02:00
|
|
|
- while ((c = getopt_long(argc, argv, "bkmghltc:ws:V", longopts, NULL)) != -1)
|
|
|
|
+ while ((c = getopt_long(argc, argv, "bkmghltCc:ws:V", longopts, NULL)) != -1)
|
2015-02-06 10:44:35 +01:00
|
|
|
switch (c) {
|
|
|
|
case 'b':
|
2015-09-24 07:17:26 +02:00
|
|
|
check_unit_set(&unit_set);
|
2022-04-14 17:23:21 +02:00
|
|
|
@@ -333,6 +335,9 @@ int main(int argc, char **argv)
|
2015-02-06 10:44:35 +01:00
|
|
|
case 'w':
|
|
|
|
flags |= FREE_WIDE;
|
|
|
|
break;
|
|
|
|
+ case 'C':
|
|
|
|
+ setenv("PS_FULL_CACHE", "yes", 1);
|
|
|
|
+ break;
|
|
|
|
case HELP_OPTION:
|
|
|
|
usage(stdout);
|
|
|
|
case 'V':
|
2022-04-14 17:23:21 +02:00
|
|
|
--- proc/sysinfo.c
|
|
|
|
+++ proc/sysinfo.c 2019-12-11 06:20:16.659772479 +0000
|
2015-02-06 10:44:35 +01:00
|
|
|
@@ -3,6 +3,7 @@
|
2022-04-14 17:23:21 +02:00
|
|
|
* Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
|
|
|
|
* Copyright 1998-2003 Albert Cahalan
|
|
|
|
* June 2003, Fabian Frederick, disk and slab info
|
2015-02-06 10:44:35 +01:00
|
|
|
+ * 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
|
2022-04-14 17:23:21 +02:00
|
|
|
@@ -700,6 +701,7 @@ void meminfo(void){
|
|
|
|
int linux_version_code = procps_linux_version();
|
|
|
|
mem_table_struct findme = { namebuf, NULL};
|
|
|
|
mem_table_struct *found;
|
|
|
|
+ const char *ev;
|
|
|
|
char *head;
|
|
|
|
char *tail;
|
|
|
|
static const mem_table_struct mem_table[] = {
|
|
|
|
@@ -779,6 +781,8 @@ nextline:
|
|
|
|
kb_inactive = kb_inact_dirty + kb_inact_clean + kb_inact_laundry;
|
|
|
|
}
|
|
|
|
kb_main_cached = kb_page_cache + kb_slab_reclaimable;
|
|
|
|
+ if ((ev=getenv("PS_FULL_CACHE")))
|
|
|
|
+ kb_main_cached += kb_swap_cached + kb_nfs_unstable;
|
|
|
|
kb_swap_used = kb_swap_total - kb_swap_free;
|
2015-02-06 10:44:35 +01:00
|
|
|
|
2022-04-14 17:23:21 +02:00
|
|
|
/* if kb_main_available is greater than kb_main_total or our calculation of
|
2015-02-06 10:44:35 +01:00
|
|
|
--- vmstat.c
|
2022-04-14 17:23:21 +02:00
|
|
|
+++ vmstat.c 2019-12-11 06:22:44.716984764 +0000
|
|
|
|
@@ -103,6 +103,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(USAGE_SEPARATOR, out);
|
|
|
|
fputs(USAGE_HELP, out);
|
|
|
|
@@ -899,7 +900,7 @@ int main(int argc, char *argv[])
|
|
|
|
atexit(close_stdout);
|
2015-02-06 10:44:35 +01:00
|
|
|
|
2022-04-14 17:23:21 +02:00
|
|
|
while ((c =
|
|
|
|
- getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts,
|
|
|
|
+ getopt_long(argc, argv, "aCfmnsdDp:S:wthV", longopts,
|
|
|
|
NULL)) != -1)
|
|
|
|
switch (c) {
|
|
|
|
case 'V':
|
|
|
|
@@ -968,6 +969,9 @@ int main(int argc, char *argv[])
|
|
|
|
case 't':
|
|
|
|
t_option = 1;
|
|
|
|
break;
|
|
|
|
+ case 'C':
|
|
|
|
+ setenv("PS_FULL_CACHE", "yes", 1);
|
|
|
|
+ break;
|
|
|
|
default:
|
|
|
|
/* no other aguments defined yet. */
|
|
|
|
usage(stderr);
|