Dr. Werner Fink 2015-02-03 15:31:12 +00:00 committed by Git OBS Bridge
parent f8395d0553
commit 13a27ebb8d
52 changed files with 306 additions and 6775 deletions

View File

@ -1,31 +0,0 @@
From 14ef47af57f48d1e51ab91e80fd8f132fabb665a Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Tue, 3 Dec 2013 15:00:00 -0600
Subject: [PATCH] top: do not forget the fscanf %s terminating null byte
Reference(s):
http://www.freelists.org/post/procps/procpsng-339-defects-found
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git top/top.c top/top.c
index 4d1d912..bb15d01 100644
--- top/top.c
+++ top/top.c
@@ -3445,8 +3445,8 @@ static void configs_read (void) {
WIN_t *w = &Winstk[i];
p = fmtmk(N_fmt(RC_bad_entry_fmt), i+1, Rc_name);
- // note: "fieldscur=%__s" on next line should equal PFLAGSSIZ !
- if (2 != fscanf(fp, "%3s\tfieldscur=%80s\n"
+ // note: "fieldscur=%__s" on next line should equal (PFLAGSSIZ -1) !
+ if (2 != fscanf(fp, "%3s\tfieldscur=%79s\n"
, w->rc.winname, w->rc.fieldscur))
goto default_or_error;
#if PFLAGSSIZ > 80
--
1.7.9.2

View File

@ -1,41 +0,0 @@
From 7f6efed9bb85d1e212e06985ea3e06720f6ca949 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Fri, 27 Dec 2013 23:08:14 +1100
Subject: [PATCH] sysctl --system loads default config file
Commit cdca71e94506fbb921ab2c626be3ad05c4287498 fixed
the loading the sysctl.conf file, but had the logic
for checking the file exists reversed incorrectly.
---
NEWS | 4 ++++
sysctl.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git NEWS NEWS
index 287f867..1c710a3 100644
--- NEWS
+++ NEWS
@@ -1,3 +1,7 @@
+procps-ng-3.3.10
+----------------
+ * sysctl --system loads default config file - Debian #732920
+
procps-ng-3.3.9
---------------
* kernel namespaces support added to skill, pgrep, ps and top
diff --git sysctl.c sysctl.c
index bb3e6b7..33c9403 100644
--- sysctl.c
+++ sysctl.c
@@ -640,7 +640,7 @@ static int PreloadSystem(void)
}
- if (stat(DEFAULT_PRELOAD, &ts) < 0 && S_ISREG(ts.st_mode)) {
+ if (stat(DEFAULT_PRELOAD, &ts) < 0 || S_ISREG(ts.st_mode)) {
if (!Quiet)
printf(_("* Applying %s ...\n"), DEFAULT_PRELOAD);
rc |= Preload(DEFAULT_PRELOAD);
--
1.7.9.2

View File

@ -1,371 +0,0 @@
From 8a38cd5eb449c47450e31aa093635e8cfaaf2f73 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Sat, 28 Dec 2013 09:25:39 +1100
Subject: [PATCH] Split help lines to help translators
To assist translators, the help lines are split so that each translation
chunk has one option. This gives bonus of if we add or change an option,
only that option remains untranslated rather than the entire help block.
Reference:
http://www.freelists.org/post/procps/procpsng-for-Translation-Project,1
Signed-off-by: Craig Small <csmall@enc.com.au>
---
pidof.c | 8 ++--
pmap.c | 26 ++++++------
ps/help.c | 131 +++++++++++++++++++++++++++++--------------------------------
skill.c | 42 ++++++++++----------
slabtop.c | 28 ++++++-------
watch.c | 20 +++++-----
6 files changed, 125 insertions(+), 130 deletions(-)
diff --git pidof.c pidof.c
index 2e0911d..6a38675 100644
--- pidof.c
+++ pidof.c
@@ -60,10 +60,10 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
fputs(USAGE_HEADER, fp);
fprintf(fp, _(" %s [options] [program [...]]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, fp);
- fputs(_(" -s, --single-shot return one PID only\n"
- " -c, --check-root omit processes with different root\n"
- " -x scripts too\n"
- " -o, --omit-pid <PID,...> omit processes with PID\n"), fp);
+ fputs(_(" -s, --single-shot return one PID only\n"), fp);
+ fputs(_(" -c, --check-root omit processes with different root\n"), fp);
+ fputs(_(" -x scripts too\n"), fp);
+ fputs(_(" -o, --omit-pid <PID,...> omit processes with PID\n"), fp);
fputs(USAGE_SEPARATOR, fp);
fputs(USAGE_HELP, fp);
fputs(USAGE_VERSION, fp);
diff --git pmap.c pmap.c
index 8f111a0..4ecabce 100644
--- pmap.c
+++ pmap.c
@@ -108,19 +108,19 @@ usage(FILE * out)
fprintf(out,
_(" %s [options] pid [pid ...]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out);
- fputs(_(" -x, --extended show details\n"
- " -X show even more details\n"
- " WARNING: format changes according to /proc/PID/smaps\n"
- " -XX show everything the kernel provides\n"
- " -c, --read-rc read the default rc\n"
- " -C, --read-rc-from=<file> read the rc from file\n"
- " -n, --create-rc create new default rc\n"
- " -N, --create-rc-to=<file> create new rc to file\n"
- " NOTE: pid arguments are not allowed with -n, -N\n"
- " -d, --device show the device format\n"
- " -q, --quiet do not display header and footer\n"
- " -p, --show-path show path in the mapping\n"
- " -A, --range=<low>[,<high>] limit results to the given range\n"), out);
+ fputs(_(" -x, --extended show details\n"), out);
+ fputs(_(" -X show even more details\n"), out);
+ fputs(_(" WARNING: format changes according to /proc/PID/smaps\n"), out);
+ fputs(_(" -XX show everything the kernel provides\n"), out);
+ fputs(_(" -c, --read-rc read the default rc\n"), out);
+ fputs(_(" -C, --read-rc-from=<file> read the rc from file\n"), out);
+ fputs(_(" -n, --create-rc create new default rc\n"), out);
+ fputs(_(" -N, --create-rc-to=<file> create new rc to file\n"), out);
+ fputs(_(" NOTE: pid arguments are not allowed with -n, -N\n"), out);
+ fputs(_(" -d, --device show the device format\n"), out);
+ fputs(_(" -q, --quiet do not display header and footer\n"), out);
+ fputs(_(" -p, --show-path show path in the mapping\n"), out);
+ fputs(_(" -A, --range=<low>[,<high>] limit results to the given range\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out);
diff --git ps/help.c ps/help.c
index b536f1a..9133903 100644
--- ps/help.c
+++ ps/help.c
@@ -96,85 +96,80 @@ void do_help (const char *opt, int rc) {
" %s [options]\n"), myname);
if (section == HELP_SMP || section == HELP_ALL) {
- fprintf(out, _("\n"
- "Basic options:\n"
- " -A, -e all processes\n"
- " -a all with tty, except session leaders\n"
- " a all with tty, including other users\n"
- " -d all except session leaders\n"
- " -N, --deselect negate selection\n"
- " r only running processes\n"
- " T all processes on this terminal\n"
- " x processes without controlling ttys\n"));
+ fputs(_("\nBasic options:\n"), out);
+ fputs(_(" -A, -e all processes\n"), out);
+ fputs(_(" -a all with tty, except session leaders\n"), out);
+ fputs(_(" a all with tty, including other users\n"), out);
+ fputs(_(" -d all except session leaders\n"), out);
+ fputs(_(" -N, --deselect negate selection\n"), out);
+ fputs(_(" r only running processes\n"), out);
+ fputs(_(" T all processes on this terminal\n"), out);
+ fputs(_(" x processes without controlling ttys\n"), out);
}
if (section == HELP_LST || section == HELP_ALL) {
- fprintf(out, _("\n"
- "Selection by list:\n"
- " -C <command> command name\n"
- " -G, --Group <gid> real group id or name\n"
- " -g, --group <group> session or effective group name\n"
- " -p, --pid <pid> process id\n"
- " --ppid <pid> select by parent process id\n"
- " -s, --sid <session> session id\n"
- " -t, t, --tty <tty> terminal\n"
- " -u, U, --user <uid> effective user id or name\n"
- " -U, --User <uid> real user id or name\n"
- "\n"
+ fputs(_("\nSelection by list:\n"), out);
+ fputs(_(" -C <command> command name\n"), out);
+ fputs(_(" -G, --Group <gid> real group id or name\n"), out);
+ fputs(_(" -g, --group <group> session or effective group name\n"), out);
+ fputs(_(" -p, --pid <pid> process id\n"), out);
+ fputs(_(" --ppid <pid> select by parent process id\n"), out);
+ fputs(_(" -s, --sid <session> session id\n"), out);
+ fputs(_(" -t, t, --tty <tty> terminal\n"), out);
+ fputs(_(" -u, U, --user <uid> effective user id or name\n"), out);
+ fputs(_(" -U, --User <uid> real user id or name\n"), out);
+ fputs(_("\n"
" selection <arguments> take either:\n"
" comma-separated list e.g. '-u root,nobody' or\n"
- " blank-separated list e.g. '-p 123 4567'\n"));
+ " blank-separated list e.g. '-p 123 4567'\n"), out);
}
if (section == HELP_OUT || section == HELP_ALL) {
- fprintf(out, _("\n"
- "Output formats:\n"
- " -F extra full\n"
- " -f full-format, including command lines\n"
- " f, --forest ascii art process tree\n"
- " -H show process hierarchy\n"
- " -j jobs format\n"
- " j BSD job control format\n"
- " -l long format\n"
- " l BSD long format\n"
- " -M, Z add security data (for SELinux)\n"
- " -O <format> preloaded with default columns\n"
- " O <format> as -O, with BSD personality\n"
- " -o, o, --format <format>\n"
- " user defined format\n"
- " s signal format\n"
- " u user-oriented format\n"
- " v virtual memory format\n"
- " X register format\n"
- " -y do not show flags, show rrs vs. addr (used with -l)\n"
- " --context display security context (for SELinux)\n"
- " --headers repeat header lines, one per page\n"
- " --no-headers do not print header at all\n"
- " --cols, --columns, --width <num>\n"
- " set screen width\n"
- " --rows, --lines <num>\n"
- " set screen height\n"));
+ fputs(_("\nOutput formats:\n"), out);
+ fputs(_(" -F extra full\n"), out);
+ fputs(_(" -f full-format, including command lines\n"), out);
+ fputs(_(" f, --forest ascii art process tree\n"), out);
+ fputs(_(" -H show process hierarchy\n"), out);
+ fputs(_(" -j jobs format\n"), out);
+ fputs(_(" j BSD job control format\n"), out);
+ fputs(_(" -l long format\n"), out);
+ fputs(_(" l BSD long format\n"), out);
+ fputs(_(" -M, Z add security data (for SELinux)\n"), out);
+ fputs(_(" -O <format> preloaded with default columns\n"), out);
+ fputs(_(" O <format> as -O, with BSD personality\n"), out);
+ fputs(_(" -o, o, --format <format>\n"
+ " user defined format\n"), out);
+ fputs(_(" s signal format\n"), out);
+ fputs(_(" u user-oriented format\n"), out);
+ fputs(_(" v virtual memory format\n"), out);
+ fputs(_(" X register format\n"), out);
+ fputs(_(" -y do not show flags, show rrs vs. addr (used with -l)\n"), out);
+ fputs(_(" --context display security context (for SELinux)\n"), out);
+ fputs(_(" --headers repeat header lines, one per page\n"), out);
+ fputs(_(" --no-headers do not print header at all\n"), out);
+ fputs(_(" --cols, --columns, --width <num>\n"
+ " set screen width\n"), out);
+ fputs(_(" --rows, --lines <num>\n"
+ " set screen height\n"), out);
}
if (section == HELP_THD || section == HELP_ALL) {
- fprintf(out, _("\n"
- "Show threads:\n"
- " H as if they where processes\n"
- " -L possibly with LWP and NLWP columns\n"
- " -m, m after processes\n"
- " -T possibly with SPID column\n"));
+ fputs(_("\nShow threads:\n"), out);
+ fputs(_(" H as if they where processes\n"), out);
+ fputs(_(" -L possibly with LWP and NLWP columns\n"), out);
+ fputs(_(" -m, m after processes\n"), out);
+ fputs(_(" -T possibly with SPID column\n"), out);
}
if (section == HELP_MSC || section == HELP_ALL) {
+ fputs(_("\nMiscellaneous options:\n"), out);
+ fputs(_(" -c show scheduling class with -l option\n"), out);
+ fputs(_(" c show true command name\n"), out);
+ fputs(_(" e show the environment after command\n"), out);
+ fputs(_(" k, --sort specify sort order as: [+|-]key[,[+|-]key[,...]]\n"), out);
+ fputs(_(" L list format specifiers\n"), out);
+ fputs(_(" n display numeric uid and wchan\n"), out);
+ fputs(_(" S, --cumulative include some dead child process data\n"), out);
+ fputs(_(" -y do not show flags, show rss (only with -l)\n"), out);
+ fputs(_(" -V, V, --version display version information and exit\n"), out);
+ fputs(_(" -w, w unlimited output width\n"), out);
fprintf(out, _("\n"
- "Miscellaneous options:\n"
- " -c show scheduling class with -l option\n"
- " c show true command name\n"
- " e show the environment after command\n"
- " k, --sort specify sort order as: [+|-]key[,[+|-]key[,...]]\n"
- " L list format specifiers\n"
- " n display numeric uid and wchan\n"
- " S, --cumulative include some dead child process data\n"
- " -y do not show flags, show rss (only with -l)\n"
- " -V, V, --version display version information and exit\n"
- " -w, w unlimited output width\n"
- "\n"
" --%s <%s|%s|%s|%s|%s|%s>\n"
" display help and exit\n")
, the_word_help
diff --git skill.c skill.c
index 01b29cb..5c8192a 100644
--- skill.c
+++ skill.c
@@ -324,11 +324,11 @@ static void __attribute__ ((__noreturn__)) kill_usage(FILE * out)
fprintf(out,
_(" %s [options] <pid> [...]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out);
- fputs(_(" <pid> [...] send signal to every <pid> listed\n"
- " -<signal>, -s, --signal <signal>\n"
- " specify the <signal> to be sent\n"
- " -l, --list=[<signal>] list all signal names, or convert one to a name\n"
- " -L, --table list all signal names in a nice table\n"), out);
+ fputs(_(" <pid> [...] send signal to every <pid> listed\n"), out);
+ fputs(_(" -<signal>, -s, --signal <signal>\n"
+ " specify the <signal> to be sent\n"), out);
+ fputs(_(" -l, --list=[<signal>] list all signal names, or convert one to a name\n"), out);
+ fputs(_(" -L, --table list all signal names in a nice table\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out);
@@ -351,25 +351,25 @@ static void __attribute__ ((__noreturn__)) skillsnice_usage(FILE * out)
program_invocation_short_name);
}
fputs(USAGE_OPTIONS, out);
- fputs(_(" -f, --fast fast mode (not implemented)\n"
- " -i, --interactive interactive\n"
- " -l, --list list all signal names\n"
- " -L, --table list all signal names in a nice table\n"
- " -n, --no-action no action\n"
- " -v, --verbose explain what is being done\n"
- " -w, --warnings enable warnings (not implemented)\n"), out);
+ fputs(_(" -f, --fast fast mode (not implemented)\n"), out);
+ fputs(_(" -i, --interactive interactive\n"), out);
+ fputs(_(" -l, --list list all signal names\n"), out);
+ fputs(_(" -L, --table list all signal names in a nice table\n"), out);
+ fputs(_(" -n, --no-action no action\n"), out);
+ fputs(_(" -v, --verbose explain what is being done\n"), out);
+ fputs(_(" -w, --warnings enable warnings (not implemented)\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(_("Expression can be: terminal, user, pid, command.\n"
- "The options below may be used to ensure correct interpretation.\n"
- " -c, --command <command> expression is a command name\n"
- " -p, --pid <pid> expression is a process id number\n"
- " -t, --tty <tty> expression is a terminal\n"
- " -u, --user <username> expression is a username\n"), out);
+ "The options below may be used to ensure correct interpretation.\n"), out);
+ fputs(_(" -c, --command <command> expression is a command name\n"), out);
+ fputs(_(" -p, --pid <pid> expression is a process id number\n"), out);
+ fputs(_(" -t, --tty <tty> expression is a terminal\n"), out);
+ fputs(_(" -u, --user <username> expression is a username\n"), out);
fputs(USAGE_SEPARATOR, out);
- fputs(_("Alternatively, expression can be:\n"
- " --ns <pid> match the processes that belong to the same\n"
- " namespace as <pid>\n"
- " --nslist <ns,...> list which namespaces will be considered for\n"
+ fputs(_("Alternatively, expression can be:\n"), out);
+ fputs(_(" --ns <pid> match the processes that belong to the same\n"
+ " namespace as <pid>\n"), out);
+ fputs(_(" --nslist <ns,...> list which namespaces will be considered for\n"
" the --ns option.\n"
" Available namespaces: ipc, mnt, net, pid, user, uts\n"), out);
diff --git slabtop.c slabtop.c
index dc89c4d..c135ec5 100644
--- slabtop.c
+++ slabtop.c
@@ -188,24 +188,24 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
fputs(USAGE_HEADER, out);
fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out);
- fputs(_(" -d, --delay <secs> delay updates\n"
- " -o, --once only display once, then exit\n"
- " -s, --sort <char> specify sort criteria by character (see below)\n"), out);
+ fputs(_(" -d, --delay <secs> delay updates\n"), out);
+ fputs(_(" -o, --once only display once, then exit\n"), out);
+ fputs(_(" -s, --sort <char> specify sort criteria by character (see below)\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out);
- fputs(_("\nThe following are valid sort criteria:\n"
- " a: sort by number of active objects\n"
- " b: sort by objects per slab\n"
- " c: sort by cache size\n"
- " l: sort by number of slabs\n"
- " v: sort by number of active slabs\n"
- " n: sort by name\n"
- " o: sort by number of objects (the default)\n"
- " p: sort by pages per slab\n"
- " s: sort by object size\n"
- " u: sort by cache utilization\n"), out);
+ fputs(_("\nThe following are valid sort criteria:\n"), out);
+ fputs(_(" a: sort by number of active objects\n"), out);
+ fputs(_(" b: sort by objects per slab\n"), out);
+ fputs(_(" c: sort by cache size\n"), out);
+ fputs(_(" l: sort by number of slabs\n"), out);
+ fputs(_(" v: sort by number of active slabs\n"), out);
+ fputs(_(" n: sort by name\n"), out);
+ fputs(_(" o: sort by number of objects (the default)\n"), out);
+ fputs(_(" p: sort by pages per slab\n"), out);
+ fputs(_(" s: sort by object size\n"), out);
+ fputs(_(" u: sort by cache utilization\n"), out);
fprintf(out, USAGE_MAN_TAIL("slabtop(1)"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
diff --git watch.c watch.c
index 436d213..032dfb7 100644
--- watch.c
+++ watch.c
@@ -88,16 +88,16 @@ static void __attribute__ ((__noreturn__))
fprintf(out,
_(" %s [options] command\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out);
- fputs(_(" -b, --beep beep if command has a non-zero exit\n"
- " -c, --color interpret ANSI color sequences\n"
- " -d, --differences[=<permanent>]\n"
- " highlight changes between updates\n"
- " -e, --errexit exit if command has a non-zero exit\n"
- " -g, --chgexit exit when output from command changes\n"
- " -n, --interval <secs> seconds to wait between updates\n"
- " -p, --precise attempt run command in precise intervals\n"
- " -t, --no-title turn off header\n"
- " -x, --exec pass command to exec instead of \"sh -c\"\n"), out);
+ fputs(_(" -b, --beep beep if command has a non-zero exit\n"), out);
+ fputs(_(" -c, --color interpret ANSI color sequences\n"), out);
+ fputs(_(" -d, --differences[=<permanent>]\n"
+ " highlight changes between updates\n"), out);
+ fputs(_(" -e, --errexit exit if command has a non-zero exit\n"), out);
+ fputs(_(" -g, --chgexit exit when output from command changes\n"), out);
+ fputs(_(" -n, --interval <secs> seconds to wait between updates\n"), out);
+ fputs(_(" -p, --precise attempt run command in precise intervals\n"), out);
+ fputs(_(" -t, --no-title turn off header\n"), out);
+ fputs(_(" -x, --exec pass command to exec instead of \"sh -c\"\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
fputs(_(" -v, --version output version information and exit\n"), out);
--
1.7.9.2

View File

@ -1,25 +0,0 @@
From 38cbeedeb7dc94c95482343e547addc1748344b0 Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Thu, 2 Jan 2014 18:21:31 +0100
Subject: [PATCH] library: fixing uninitialized variable 'pos' in whattime.c
---
proc/whattime.c | 2 ++
1 file changed, 2 insertions(+)
diff --git proc/whattime.c proc/whattime.c
index 9d6abb3..eb345fb 100644
--- proc/whattime.c
+++ proc/whattime.c
@@ -58,6 +58,8 @@ char *sprint_uptime(int human_readable) {
realtime = localtime(&realseconds);
pos = sprintf(buf, " %02d:%02d:%02d ",
realtime->tm_hour, realtime->tm_min, realtime->tm_sec);
+ } else {
+ pos = 0;
}
/* read and calculate the amount of uptime */
--
1.7.9.2

View File

@ -1,26 +0,0 @@
From 69de8db3e27b63fdcd8e3dce4d63e725d80bf05b Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Thu, 2 Jan 2014 18:39:27 +0100
Subject: [PATCH] pgrep: Fixing memory leak in do_regcomp()
---
pgrep.c | 3 +++
1 file changed, 3 insertions(+)
diff --git pgrep.c pgrep.c
index 6290ec5..93a7c89 100644
--- pgrep.c
+++ pgrep.c
@@ -460,6 +460,9 @@ static regex_t * do_regcomp (void)
}
re_err = regcomp (preg, re, REG_EXTENDED | REG_NOSUB | opt_case);
+
+ if (opt_exact) free(re);
+
if (re_err) {
regerror (re_err, preg, errbuf, sizeof(errbuf));
fputs(errbuf,stderr);
--
1.7.9.2

View File

@ -1,30 +0,0 @@
From 8622b582da06fb93a8f06d302215269835fca9a9 Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Thu, 2 Jan 2014 19:49:36 +0100
Subject: [PATCH] sysctl: Fixing memory leaks in PreloadSystem()
---
sysctl.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git sysctl.c sysctl.c
index 33c9403..51af15d 100644
--- sysctl.c
+++ sysctl.c
@@ -645,6 +645,13 @@ static int PreloadSystem(void)
printf(_("* Applying %s ...\n"), DEFAULT_PRELOAD);
rc |= Preload(DEFAULT_PRELOAD);
}
+
+ /* cleaning */
+ for (i = 0; i < ncfgs; ++i) {
+ free(cfgs[i]);
+ }
+ if (cfgs) free(cfgs);
+
return rc;
}
--
1.7.9.2

View File

@ -1,47 +0,0 @@
From d06aaaaf2bd8f3b5f0235e75f4f04c0ad69c7d6d Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Tue, 14 Jan 2014 22:23:58 +1100
Subject: [PATCH] ps: ignore SIGCONT
SIGCONT is a continue signal. It seems that some zsh setups can send
this signal, causing ps to abort. This is not what "continue" means.
This change just uses the default handler which will continue a stopped
process.
References:
http://bugs.debian.org/732410
http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=32251
Signed-off-by: Craig Small <csmall@enc.com.au>
---
NEWS | 1 +
ps/display.c | 1 +
2 files changed, 2 insertions(+)
diff --git NEWS NEWS
index 1c710a3..a2afaa3 100644
--- NEWS
+++ NEWS
@@ -1,6 +1,7 @@
procps-ng-3.3.10
----------------
* sysctl --system loads default config file - Debian #732920
+ * ps doesn't exit on SIGCONT
procps-ng-3.3.9
---------------
diff --git ps/display.c ps/display.c
index c20285d..693154b 100644
--- ps/display.c
+++ ps/display.c
@@ -563,6 +563,7 @@ int main(int argc, char *argv[]){
default:
sigaction(i,&sa,NULL);
case 0:
+ case SIGCONT:
case SIGINT: /* ^C */
case SIGTSTP: /* ^Z */
case SIGTTOU: /* see stty(1) man page */
--
1.7.9.2

View File

@ -1,47 +0,0 @@
From 1baf31be9bbfd6fb82629176e595d2d2cef85ef3 Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Mon, 20 Jan 2014 19:59:39 +0100
Subject: [PATCH] vmstat: wide output still not wide enough?
8 digits per memory column is apparently still too low
for systems with 128TB of RAM. Anyway, setting the limit
to 999TB (12 digits) must be sufficient for now as it
produces wide gaps on "regular" computers.
This commit also increases the number of digits per cpu
columns from 2 to 3 as some of them can hit the 100%
maximum in corner cases.
---
vmstat.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git vmstat.c vmstat.c
index 67515c1..c01351d 100644
--- vmstat.c
+++ vmstat.c
@@ -187,12 +187,12 @@ static void new_header(void)
const char header[] =
"procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----\n";
const char wide_header[] =
- "procs ---------------memory-------------- ---swap-- -----io---- -system-- ------cpu-----\n";
+ "procs -----------------------memory---------------------- ---swap-- -----io---- -system-- --------cpu--------\n";
const char format[] =
"%2s %2s %6s %6s %6s %6s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s\n";
const char wide_format[] =
- "%2s %2s %8s %8s %8s %8s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s\n";
+ "%2s %2s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s\n";
printf(w_option ? _(wide_header) : _(header));
printf(
@@ -249,7 +249,7 @@ static void new_format(void)
const char format[] =
"%2u %2u %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u\n";
const char wide_format[] =
- "%2u %2u %8lu %8lu %8lu %8lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u\n";
+ "%2u %2u %12lu %12lu %12lu %12lu %4u %4u %5u %5u %4u %4u %3u %3u %3u %3u %3u\n";
unsigned int tog = 0; /* toggle switch for cleaner code */
unsigned int i;
--
1.7.9.2

View File

@ -1,43 +0,0 @@
From ae9676a337e38526b994d189444f3fd02ab800ad Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Fri, 24 Jan 2014 18:07:34 +0100
Subject: [PATCH] library: skip replacement of trailing '\0' in
read_unvectored()
Under some circumstances the ksh shell doesn't fork new processes
when executing scripts and the script is interpreted by the
parent process. That makes the execution faster, but it means
ksh needs to reuse the /proc/PID/cmdline for the new script name
and arguments while the file length needs to stay untouched.
The fork is skipped only when the new cmdline is shorter than
the parent's cmdline and the rest of the file is filled
with '\0'. This is perfectly ok until we try to read the cmdline
of such process. As the read_unvectored() function replaces
all zeros with chosen separator, these trailing zeros are replaced
with spaces in case of the ps tool. Consequently it appends
multiple spaces at the end of the arguments string even when these
zeros do not represent any separators and therefore shouldn't
be replaced.
With this commit the read_unvectored() function skips the
replacement of trailing zeros and separates valid content only.
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1057600
---
proc/readproc.c | 1 +
1 file changed, 1 insertion(+)
diff --git proc/readproc.c proc/readproc.c
index 286e173..46dfa10 100644
--- proc/readproc.c
+++ proc/readproc.c
@@ -686,6 +686,7 @@ static int read_unvectored(char *restrict const dst, unsigned sz, const char* wh
close(fd);
if(n){
int i=n;
+ while(i && dst[i-1]=='\0') --i; // skip trailing zeroes
while(i--)
if(dst[i]=='\n' || dst[i]=='\0') dst[i]=sep;
if(dst[n-1]==' ') dst[n-1]='\0';
--
1.7.9.2

View File

@ -1,41 +0,0 @@
From 4359cf069819d9fb53493933e00d9af5c37bced5 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Tue, 28 Jan 2014 22:35:26 +1100
Subject: [PATCH] kill for PID -1 restored
Both the man page and the shell builtin kill mention you can
use PID -1, which means nuke everything you can get at.
Alas this "fun" option was missing and the only way to get
around it was with "kill -HUP -- -1".
This small change means kill -HUP -1 is back for all those
destructive types. The error was introduced when the argument
parser was fixed for other problems.
Thanks to Mike for pointing this out.
Signed-off-by: Craig Small <csmall@enc.com.au>
---
skill.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git skill.c skill.c
index 5c8192a..1c99985 100644
--- skill.c
+++ skill.c
@@ -477,6 +477,12 @@ static void __attribute__ ((__noreturn__))
display_kill_version();
exit(EXIT_SUCCESS);
case '?':
+ /* Special case is -1 which means all except init */
+ if (optopt == '1') {
+ if (kill(-1, signo) != 0)
+ exitvalue = EXIT_FAILURE;
+ exit(exitvalue);
+ }
if (!isdigit(optopt)) {
xwarnx(_("invalid argument %c"), optopt);
kill_usage(stderr);
--
1.7.9.2

View File

@ -1,79 +0,0 @@
From 5a34ff0a99a3c5e7ba4f7982d5de3d0dcc9e3045 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Wed, 29 Jan 2014 22:22:11 +1100
Subject: [PATCH] Check for presence of disks in vmstat
vmstat -d or vmstat -p would crash mysteriously under different
circumstances. The problem was eventually tracked down to /sys not
being mounted which meant is_disk() always returned false.
The partition would then be attempted to be linked to a non-existent
disk causing a segfault.
vmstat will now not link to a disk if none exists.
The change in testing will skip those tests when /sys/block doesn't
exist.
Many thanks to Daniel Schepler for his analysis and suggestions.
Bug-Debian: http://bugs.debian.org/736628
---
proc/sysinfo.c | 7 +++++--
testsuite/vmstat.test/vmstat.exp | 22 +++++++++++++++-------
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git proc/sysinfo.c proc/sysinfo.c
index f318376..1680cc4 100644
--- proc/sysinfo.c
+++ proc/sysinfo.c
@@ -938,8 +938,11 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
&(*partitions)[cPartition].writes,
&(*partitions)[cPartition].requested_writes
);
- (*partitions)[cPartition++].parent_disk = cDisk-1;
- (*disks)[cDisk-1].partitions++;
+
+ if (cDisk > 0) {
+ (*partitions)[cPartition++].parent_disk = cDisk-1;
+ (*disks)[cDisk-1].partitions++;
+ }
}
}
diff --git testsuite/vmstat.test/vmstat.exp testsuite/vmstat.test/vmstat.exp
index fb5de14..f470afc 100644
--- testsuite/vmstat.test/vmstat.exp
+++ testsuite/vmstat.test/vmstat.exp
@@ -26,15 +26,23 @@ expect_pass "$test" "^Cache\\s+Num\\s+Total\\s+Size\\s+Pages\\s+\(\[\(\)A-Za-z0-
}
set test "vmstat disk information (-d option)"
-spawn $vmstat -d
-expect_pass "$test" "^disk\[ -\]+reads\[ -\]+writes\[ -\]+IO\[ -\]+\\s+total\\s+merged\\s+sectors\\s+ms\\s+total\\s+merged\\s+sectors\\s+ms\\s+cur\\s+sec\\s+"
+if { [ file readable "/sys/block" ] == 0 } {
+ unsupported "$test /sys/block not readable"
+} else {
+ spawn $vmstat -d
+ expect_pass "$test" "^disk\[ -\]+reads\[ -\]+writes\[ -\]+IO\[ -\]+\\s+total\\s+merged\\s+sectors\\s+ms\\s+total\\s+merged\\s+sectors\\s+ms\\s+cur\\s+sec\\s+"
+}
# Need a partition
set diskstats [ exec cat /proc/diskstats ]
-if [ regexp "\\s+\\d+\\s+\\d+\\s+\(\[a-z\]+\\d+\)\\s+\[0-9\]\[0-9\]+" $diskstats line partition == 1 ] {
- set test "vmstat partition (using $partition)"
- spawn $vmstat -p $partition
- expect_pass "$test" "^${partition}\\s+reads"
+if { [ file readable "/sys/block" ] == 0 } {
+ unsupported "vmstat partition /sys/block not readable"
} else {
- unsupported "vmstat partition (cannot find partition)"
+ if [ regexp "\\s+\\d+\\s+\\d+\\s+\(\[a-z\]+\\d+\)\\s+\[0-9\]\[0-9\]+" $diskstats line partition == 1 ] {
+ set test "vmstat partition (using $partition)"
+ spawn $vmstat -p $partition
+ expect_pass "$test" "^${partition}\\s+reads"
+ } else {
+ unsupported "vmstat partition (cannot find partition)"
+ }
}
--
1.7.9.2

View File

@ -1,53 +0,0 @@
From 39210a89debaff023fa97250bee63c57fe9dfcfb Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Wed, 29 Jan 2014 22:28:02 +1100
Subject: [PATCH] PID -2 to -9 for kill too
Commit 4359cf069819d9fb53493933e00d9af5c37bced5 restored kill's ability
to kill PID -1. This however left PIDs -2 to -9 (or rather process
groups 2 to 9) still having this problem. The check is now generically
looking for a digit and parses it correctly.
---
skill.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git skill.c skill.c
index 1c99985..60ed274 100644
--- skill.c
+++ skill.c
@@ -195,7 +195,8 @@ static void check_proc(int pid, struct run_time_conf_t *run_time)
if (i == -1)
goto closure;
}
- read(fd, buf, 128);
+ if (read(fd, buf, 128) <= 0)
+ goto closure;
buf[127] = '\0';
tmp = strrchr(buf, ')');
*tmp++ = '\0';
@@ -477,15 +478,16 @@ static void __attribute__ ((__noreturn__))
display_kill_version();
exit(EXIT_SUCCESS);
case '?':
- /* Special case is -1 which means all except init */
- if (optopt == '1') {
- if (kill(-1, signo) != 0)
- exitvalue = EXIT_FAILURE;
- exit(exitvalue);
- }
if (!isdigit(optopt)) {
xwarnx(_("invalid argument %c"), optopt);
kill_usage(stderr);
+ } else {
+ /* Special case for signal digit negative
+ * PIDs */
+ pid = (long)('0' - optopt);
+ if (kill((pid_t)pid, signo) != 0)
+ exitvalue = EXIT_FAILURE;
+ exit(exitvalue);
}
loop=0;
break;
--
1.7.9.2

View File

@ -1,139 +0,0 @@
From b6fcb602ce0f80e818004340e6ddb5a788bb832d Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Sun, 5 Jan 2014 00:00:00 -0600
Subject: [PATCH] top: provide for discontinuous (not active) NUMA nodes
Apparently there are occasions when NUMA nodes may not
always be contiguous. Under such conditions nodes that
were not used would still occupy precious Summary Area
space showing 100% idle, under the '2' command toggle.
With this commit top will no longer display numa nodes
that have no associated cpu when the '2' toggle is on.
But just in case we wish to return to former behavior,
a new #define called OFF_NUMASKIP has been introduced.
And as an aside, a recent refactor mentioned below set
the stage for this patch to be 'self-tuning'. In other
words, if an inactive/non-displayed node should become
active (if even possible), then top will begin showing
such a node automatically with the next screen update.
Unfortunately, all inactive nodes now 'suppressed' are
still accessible via the '3' command. Those nodes will
just be displayed as empty (no associated cpus shown).
This is not really a top problem but more of a libnuma
and/or user deficiency. The library lacks the means to
validate a node id and the user then input a node that
was not even shown under a '2' toggle Summary display.
( too bad libnuma does not offer an 'is_node_active' )
( type function so top could warn a user when such a )
( discontinuous node was requested using his '3' cmd )
( sure, top could achieve this objective himself but )
( that would require making yet another array global )
( which i'm just not in the mood to do - besides, we )
( have already made enough concessions to libnuma.so )
Lastly, an existing #define (PRETEND_NUMA) was changed
to 'disable' node #1 so as to simulate a discontinuous
node. This allows testing of the '2' and '3' commands.
Reference(s):
http://www.spinics.net/lists/util-linux-ng/msg08671.html
. set stage for self tuning
commit f12c0d5c6e84f9409ac3a73c066841a8ff5aab0b
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 16 +++++++++++++++-
top/top.h | 8 ++++++--
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git top/top.c top/top.c
index bb15d01..cb1a063 100644
--- top/top.c
+++ top/top.c
@@ -223,7 +223,11 @@ static void *Libnuma_handle;
static int Stderr_save = -1;
#if defined(PRETEND_NUMA) || defined(PRETEND8CPUS)
static int Numa_max_node(void) { return 3; }
+#ifndef OFF_NUMASKIP
+static int Numa_node_of_cpu(int num) { return (1 == (num % 4)) ? 0 : (num % 4); }
+#else
static int Numa_node_of_cpu(int num) { return (num % 4); }
+#endif
#else
static int (*Numa_max_node)(void);
static int (*Numa_node_of_cpu)(int num);
@@ -2430,6 +2434,9 @@ static CPU_t *cpus_refresh (CPU_t *cpus) {
nod_ptr->edge = sum_ptr->edge;
#endif
cpu_ptr->node = node;
+#ifndef OFF_NUMASKIP
+ nod_ptr->id = -1;
+#endif
}
#endif
} // end: for each cpu
@@ -5056,10 +5063,17 @@ static void summary_show (void) {
Msg_row += 1;
// display each cpu node's states
for (i = 0; i < Numa_node_tot; i++) {
+ CPU_t *nod_ptr = &smpcpu[1 + smp_num_cpus + i];
if (!isROOM(anyFLG, 1)) break;
+#ifndef OFF_NUMASKIP
+ if (nod_ptr->id) {
+#endif
snprintf(tmp, sizeof(tmp), N_fmt(NUMA_nodenam_fmt), i);
- summary_hlp(&smpcpu[1 + smp_num_cpus + i], tmp);
+ summary_hlp(nod_ptr, tmp);
Msg_row += 1;
+#ifndef OFF_NUMASKIP
+ }
+#endif
}
} else {
// display the node summary, then the associated cpus (if room)
diff --git top/top.h top/top.h
index 16f7668..8e83b61 100644
--- top/top.h
+++ top/top.h
@@ -41,12 +41,13 @@
//#define INSP_SAVEBUF /* preserve 'Insp_buf' contents in a file */
//#define INSP_SLIDE_1 /* when scrolling left/right don't move 8 */
//#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */
+//#define OFF_NUMASKIP /* do NOT skip numa nodes if discontinuous */
//#define OFF_SCROLLBK /* disable tty emulators scrollback buffer */
//#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */
//#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */
//#define PRETEND8CPUS /* pretend we're smp with 8 ticsers (sic) */
//#define PRETENDNOCAP /* use a terminal without essential caps */
-//#define PRETEND_NUMA /* pretend we've got some linux NUMA Nodes */
+//#define PRETEND_NUMA /* pretend 4 (or 3 w/o OFF_NUMASKIP) Nodes */
//#define RCFILE_NOERR /* rcfile errs silently default, vs. fatal */
//#define RECALL_FIXED /* don't reorder saved strings if recalled */
//#define RMAN_IGNORED /* don't consider auto right margin glitch */
@@ -277,7 +278,7 @@ typedef struct CPU_t {
#ifndef CPU_ZEROTICS
SIC_t edge; // tics adjustment threshold boundary
#endif
- int id; // the cpu id number (0 - nn)
+ int id; // cpu number (0 - nn), or numa active flag
#ifndef NUMA_DISABLE
int node; // the numa node it belongs to
#endif
@@ -628,6 +629,9 @@ typedef struct WIN_t {
#if defined(PRETEND_NUMA) && defined(NUMA_DISABLE)
# error 'PRETEND_NUMA' confilcts with 'NUMA_DISABLE'
#endif
+#if defined(OFF_NUMASKIP) && defined(NUMA_DISABLE)
+# error 'OFF_NUMASKIP' confilcts with 'NUMA_DISABLE'
+#endif
#if (LRGBUFSIZ < SCREENMAX)
# error 'LRGBUFSIZ' must NOT be less than 'SCREENMAX'
#endif
--
1.7.9.2

View File

@ -1,42 +0,0 @@
From 6f1c04259d979ff04d129f235c950e48e94c7e76 Mon Sep 17 00:00:00 2001
From: Elliott Forney <elliott.forney@gmail.com>
Date: Thu, 30 Jan 2014 21:36:26 +1100
Subject: [PATCH] pgrep fails to show full command line with -au
pgrep does not show the full command line when the -a and -u flags are
combined. The -a flag is ignored when the -u flag is used as well.
In addition, the supplied patch by Elliot did not fix the problem
when invert flag ( -v ) was used; a very small tweak to the patch
fixed this problem as well. This problem existed before.
Signed-off-by: Craig Small <csmall@enc.com.au>
---
pgrep.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git pgrep.c pgrep.c
index 93a7c89..2a0ee19 100644
--- pgrep.c
+++ pgrep.c
@@ -417,7 +417,7 @@ static PROCTAB *do_openproc (void)
PROCTAB *ptp;
int flags = 0;
- if (opt_pattern || opt_full)
+ if (opt_pattern || opt_full || opt_longlong)
flags |= PROC_FILLCOM;
if (opt_ruid || opt_rgid)
flags |= PROC_FILLSTATUS;
@@ -538,7 +538,7 @@ static struct el * select_procs (int *num)
match = match_strlist (tty, opt_term);
}
}
- if (task.cmdline && (opt_longlong || opt_full) && match && opt_pattern) {
+ if (task.cmdline && (opt_longlong || opt_full) ) {
int i = 0;
int bytes = sizeof (cmdline) - 1;
--
1.7.9.2

View File

@ -1,124 +0,0 @@
From bcf4f5a830ad008e0bd9341105db825a22ea3906 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Thu, 20 Feb 2014 00:00:00 -0600
Subject: [PATCH] top: restore the former behavior after stderr redirect
When top originally responded to the potential libnuma
stderr write, the library was consistently called with
each refresh cycle. That, in turn, guaranteed that any
warning message would be seen at program end by virtue
of: 1) having been issued before the 2nd refresh cycle
and; 2) benefiting from inherited /dev/null buffering.
A later efficiency refactor meant the numa library may
not always be called with every refresh cycle. Rather,
it was only called if top was in one of two numa views
(the '2' or '3' toggles). That, in turn, resulted in a
loss of any warning message at program end unless numa
mode had been preserved in the rcfile. In other words,
if top was started normally then a single cycle stderr
redirect would have long passed by the time the '2' or
'3' toggle was activated. The warning message actually
was spewed but quickly lost to the full screen refresh
which follows all keyboard interactions with the user.
This commit simply moves the restoration of our stderr
redirect to program end (instead of that first display
refresh). Now, any libnuma stderr warning message will
appear as the concluding output line upon quitting top
without regard to when any numa mode view was invoked.
And since this technique might be useful in some other
context (as an example of how to 'buffer' stderr) it's
been generalized with its own #define. But to maximize
its usefulness, the original redirect should be issued
much earlier in pgm startup than top has chosen to do.
Reference(s):
. original libnuma stderr response (msg seen)
commit 35dc6dcc49cc9cf8cff4300cb03a38dbe44c05db
. numa refractoring for efficiency (msg lost)
commit f12c0d5c6e84f9409ac3a73c066841a8ff5aab0b
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 25 +++++++++++++------------
top/top.h | 1 +
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git top/top.c top/top.c
index cb1a063..23dad92 100644
--- top/top.c
+++ top/top.c
@@ -216,11 +216,13 @@ static int Autox_array [P_MAXPFLGS],
/* Support for NUMA Node display, node expansion/targeting and
run-time dynamic linking with libnuma.so treated as a plugin */
+#ifndef OFF_STDERROR
+static int Stderr_save = -1;
+#endif
static int Numa_node_tot;
static int Numa_node_sel = -1;
#ifndef NUMA_DISABLE
static void *Libnuma_handle;
-static int Stderr_save = -1;
#if defined(PRETEND_NUMA) || defined(PRETEND8CPUS)
static int Numa_max_node(void) { return 3; }
#ifndef OFF_NUMASKIP
@@ -377,6 +379,15 @@ static void at_eoj (void) {
#endif
}
fflush(stdout);
+#ifndef OFF_STDERROR
+ /* we gotta reverse the stderr redirect which was employed during start up
+ and needed because the two libnuma 'weak' functions were useless to us! */
+ if (-1 < Stderr_save) {
+ dup2(Stderr_save, fileno(stderr));
+ close(Stderr_save);
+ Stderr_save = -1; // we'll be ending soon anyway but what the heck
+ }
+#endif
} // end: at_eoj
@@ -4070,7 +4081,7 @@ static void wins_stage_2 (void) {
// fill in missing Fieldstab members and build each window's columnhdr
zap_fieldstab();
-#ifndef NUMA_DISABLE
+#ifndef OFF_STDERROR
/* there's a chance that damn libnuma may spew to stderr so we gotta
make sure he does not corrupt poor ol' top's first output screen!
Yes, he provides some overridable 'weak' functions to change such
@@ -5564,16 +5575,6 @@ static void frame_make (void) {
the normal non-interactive output optimization... */
if (!Cap_can_goto) PSU_CLREOS(0);
-#ifndef NUMA_DISABLE
- /* we gotta reverse the stderr redirect which was employed in wins_stage_2
- and needed because the two libnuma 'weak' functions were useless to us! */
- if (-1 < Stderr_save) {
- dup2(Stderr_save, fileno(stderr));
- close(Stderr_save);
- Stderr_save = -1;
- }
-#endif
-
/* lastly, check auto-sized width needs for the next iteration */
if (AUTOX_MODE && Autox_found)
widths_resize();
diff --git top/top.h top/top.h
index 8e83b61..862568c 100644
--- top/top.h
+++ top/top.h
@@ -43,6 +43,7 @@
//#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */
//#define OFF_NUMASKIP /* do NOT skip numa nodes if discontinuous */
//#define OFF_SCROLLBK /* disable tty emulators scrollback buffer */
+//#define OFF_STDERROR /* disable our stderr buffering (redirect) */
//#define OFF_STDIOLBF /* disable our own stdout _IOFBF override */
//#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */
//#define PRETEND8CPUS /* pretend we're smp with 8 ticsers (sic) */
--
1.7.9.2

View File

@ -1,38 +0,0 @@
From c304ffa994c2beacf3eabf9986a67d2065b60cc4 Mon Sep 17 00:00:00 2001
From: Ryan Cox <ryan_cox@byu.edu>
Date: Mon, 28 Oct 2013 21:05:35 -0600
Subject: [PATCH] fail on null string for arguments
---
pgrep.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git pgrep.c pgrep.c
index 6290ec5..38c380b 100644
--- pgrep.c
+++ pgrep.c
@@ -142,13 +142,19 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
static struct el *split_list (const char *restrict str, int (*convert)(const char *, struct el *))
{
- char *copy = xstrdup (str);
- char *ptr = copy;
+ char *copy;
+ char *ptr;
char *sep_pos;
int i = 0;
int size = 0;
struct el *list = NULL;
+ if (str[0] == '\0')
+ return NULL;
+
+ copy = xstrdup (str);
+ ptr = copy;
+
do {
if (i == size) {
size = size * 5 / 4 + 4;
--
1.7.9.2

File diff suppressed because it is too large Load Diff

View File

@ -1,176 +0,0 @@
From 8e7ef322e21b2232d2a1ff9482ec8ce2808fc5c3 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Sun, 2 Feb 2014 18:13:01 +1100
Subject: [PATCH] Update help files
Benno Schulenberg suggested some changes to the help messages
to provide some consistency and clarity for both the users and
translators of procps.
The test needed to be updated as the pmap output changed too.
Signed-off-by: Craig Small <csmall@enc.com.au>
---
pgrep.c | 14 +++++++-------
pidof.c | 2 +-
pmap.c | 2 +-
ps/help.c | 22 +++++++++++-----------
skill.c | 6 +++---
testsuite/pmap.test/pmap.exp | 2 +-
6 files changed, 24 insertions(+), 24 deletions(-)
diff --git pgrep.c pgrep.c
index fda7924..d8d3dcb 100644
--- pgrep.c
+++ pgrep.c
@@ -115,19 +115,19 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
}
fputs(_(" -c, --count count of matching processes\n"), fp);
fputs(_(" -f, --full use full process name to match\n"), fp);
- fputs(_(" -g, --pgroup <id,...> match listed process group IDs\n"), fp);
- fputs(_(" -G, --group <gid,...> match real group IDs\n"), fp);
+ fputs(_(" -g, --pgroup <PGID,...> match listed process group IDs\n"), fp);
+ fputs(_(" -G, --group <GID,...> match real group IDs\n"), fp);
fputs(_(" -n, --newest select most recently started\n"), fp);
fputs(_(" -o, --oldest select least recently started\n"), fp);
- fputs(_(" -P, --parent <ppid,...> match only child processes of the given parent\n"), fp);
- fputs(_(" -s, --session <sid,...> match session IDs\n"), fp);
+ fputs(_(" -P, --parent <PPID,...> match only child processes of the given parent\n"), fp);
+ fputs(_(" -s, --session <SID,...> match session IDs\n"), fp);
fputs(_(" -t, --terminal <tty,...> match by controlling terminal\n"), fp);
- fputs(_(" -u, --euid <id,...> match by effective IDs\n"), fp);
- fputs(_(" -U, --uid <id,...> match by real IDs\n"), fp);
+ fputs(_(" -u, --euid <ID,...> match by effective IDs\n"), fp);
+ fputs(_(" -U, --uid <ID,...> match by real IDs\n"), fp);
fputs(_(" -x, --exact match exactly with the command name\n"), fp);
fputs(_(" -F, --pidfile <file> read PIDs from file\n"), fp);
fputs(_(" -L, --logpidfile fail if PID file is not locked\n"), fp);
- fputs(_(" --ns <pid> match the processes that belong to the same\n"
+ fputs(_(" --ns <PID> match the processes that belong to the same\n"
" namespace as <pid>\n"), fp);
fputs(_(" --nslist <ns,...> list which namespaces will be considered for\n"
" the --ns option.\n"
diff --git pidof.c pidof.c
index 6a38675..d1a9f31 100644
--- pidof.c
+++ pidof.c
@@ -62,7 +62,7 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
fputs(USAGE_OPTIONS, fp);
fputs(_(" -s, --single-shot return one PID only\n"), fp);
fputs(_(" -c, --check-root omit processes with different root\n"), fp);
- fputs(_(" -x scripts too\n"), fp);
+ fputs(_(" -x also find shells running the named scripts\n"), fp);
fputs(_(" -o, --omit-pid <PID,...> omit processes with PID\n"), fp);
fputs(USAGE_SEPARATOR, fp);
fputs(USAGE_HELP, fp);
diff --git pmap.c pmap.c
index 4ecabce..66c1c2d 100644
--- pmap.c
+++ pmap.c
@@ -106,7 +106,7 @@ usage(FILE * out)
{
fputs(USAGE_HEADER, out);
fprintf(out,
- _(" %s [options] pid [pid ...]\n"), program_invocation_short_name);
+ _(" %s [options] PID [PID ...]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, out);
fputs(_(" -x, --extended show details\n"), out);
fputs(_(" -X show even more details\n"), out);
diff --git ps/help.c ps/help.c
index 9133903..1b98b73 100644
--- ps/help.c
+++ ps/help.c
@@ -109,18 +109,18 @@ void do_help (const char *opt, int rc) {
if (section == HELP_LST || section == HELP_ALL) {
fputs(_("\nSelection by list:\n"), out);
fputs(_(" -C <command> command name\n"), out);
- fputs(_(" -G, --Group <gid> real group id or name\n"), out);
+ fputs(_(" -G, --Group <GID> real group id or name\n"), out);
fputs(_(" -g, --group <group> session or effective group name\n"), out);
- fputs(_(" -p, --pid <pid> process id\n"), out);
- fputs(_(" --ppid <pid> select by parent process id\n"), out);
+ fputs(_(" -p, --pid <PID> process id\n"), out);
+ fputs(_(" --ppid <PID> select by parent process id\n"), out);
fputs(_(" -s, --sid <session> session id\n"), out);
fputs(_(" -t, t, --tty <tty> terminal\n"), out);
- fputs(_(" -u, U, --user <uid> effective user id or name\n"), out);
- fputs(_(" -U, --User <uid> real user id or name\n"), out);
+ fputs(_(" -u, U, --user <UID> effective user id or name\n"), out);
+ fputs(_(" -U, --User <UID> real user id or name\n"), out);
fputs(_("\n"
- " selection <arguments> take either:\n"
- " comma-separated list e.g. '-u root,nobody' or\n"
- " blank-separated list e.g. '-p 123 4567'\n"), out);
+ " The selection options take as their argument either:\n"
+ " a comma-separated list e.g. '-u root,nobody' or\n"
+ " or a blank-separated list e.g. '-p 123 4567'\n"), out);
}
if (section == HELP_OUT || section == HELP_ALL) {
fputs(_("\nOutput formats:\n"), out);
@@ -136,7 +136,7 @@ void do_help (const char *opt, int rc) {
fputs(_(" -O <format> preloaded with default columns\n"), out);
fputs(_(" O <format> as -O, with BSD personality\n"), out);
fputs(_(" -o, o, --format <format>\n"
- " user defined format\n"), out);
+ " user-defined format\n"), out);
fputs(_(" s signal format\n"), out);
fputs(_(" u user-oriented format\n"), out);
fputs(_(" v virtual memory format\n"), out);
@@ -152,7 +152,7 @@ void do_help (const char *opt, int rc) {
}
if (section == HELP_THD || section == HELP_ALL) {
fputs(_("\nShow threads:\n"), out);
- fputs(_(" H as if they where processes\n"), out);
+ fputs(_(" H as if they were processes\n"), out);
fputs(_(" -L possibly with LWP and NLWP columns\n"), out);
fputs(_(" -m, m after processes\n"), out);
fputs(_(" -T possibly with SPID column\n"), out);
@@ -163,7 +163,7 @@ void do_help (const char *opt, int rc) {
fputs(_(" c show true command name\n"), out);
fputs(_(" e show the environment after command\n"), out);
fputs(_(" k, --sort specify sort order as: [+|-]key[,[+|-]key[,...]]\n"), out);
- fputs(_(" L list format specifiers\n"), out);
+ fputs(_(" L show format specifiers\n"), out);
fputs(_(" n display numeric uid and wchan\n"), out);
fputs(_(" S, --cumulative include some dead child process data\n"), out);
fputs(_(" -y do not show flags, show rss (only with -l)\n"), out);
diff --git skill.c skill.c
index 60ed274..9f3b4fc 100644
--- skill.c
+++ skill.c
@@ -356,7 +356,7 @@ static void __attribute__ ((__noreturn__)) skillsnice_usage(FILE * out)
fputs(_(" -i, --interactive interactive\n"), out);
fputs(_(" -l, --list list all signal names\n"), out);
fputs(_(" -L, --table list all signal names in a nice table\n"), out);
- fputs(_(" -n, --no-action no action\n"), out);
+ fputs(_(" -n, --no-action do not actually kill processes; just print what would happen\n"), out);
fputs(_(" -v, --verbose explain what is being done\n"), out);
fputs(_(" -w, --warnings enable warnings (not implemented)\n"), out);
fputs(USAGE_SEPARATOR, out);
@@ -371,8 +371,8 @@ static void __attribute__ ((__noreturn__)) skillsnice_usage(FILE * out)
fputs(_(" --ns <pid> match the processes that belong to the same\n"
" namespace as <pid>\n"), out);
fputs(_(" --nslist <ns,...> list which namespaces will be considered for\n"
- " the --ns option.\n"
- " Available namespaces: ipc, mnt, net, pid, user, uts\n"), out);
+ " the --ns option; available namespaces are\n:"
+ " ipc, mnt, net, pid, user, uts\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_SEPARATOR, out);
diff --git testsuite/pmap.test/pmap.exp testsuite/pmap.test/pmap.exp
index bc2550a..5a9e603 100644
--- testsuite/pmap.test/pmap.exp
+++ testsuite/pmap.test/pmap.exp
@@ -22,7 +22,7 @@ set pmap_ext_footer "\[ -\]+\\s+total kB\\s+\\d+(\\s+\[\\d-\]+){2,3}\\s*\$"
set test "pmap with no arguments"
spawn $pmap
#expect_pass "$test" "^\(lt-\)\?pmap: argument missing"
-expect_pass "$test" "Usage:\\s+\(lt-\)?pmap \\\[options\\\] pid \\\[pid \.\.\.\\\]"
+expect_pass "$test" "Usage:\\s+\(lt-\)?pmap \\\[options\\\] PID \\\[PID \.\.\.\\\]"
set test "pmap standard output"
spawn $pmap $mypid
--
1.7.9.2

View File

@ -1,81 +0,0 @@
From 22e658297494e11ef92a81069b49a40420b8d824 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Fri, 25 Apr 2014 00:00:00 -0500
Subject: [PATCH] top: protect against distortion when system time reset
If a system's time is adjusted backwards, then elapsed
time could appear as negative. This yielded a negative
%CPU value. Alternately if zeros were suppressed ('0')
the result was a blank %CPU column. In both cases that
distortion would last for one display cycle or until a
user forced a display refresh via some keyboard input.
The original recommendation was trading gettimeofday()
for clock_gettime() using CLOCK_MONOTONIC. But on some
systems that might not be possible, forcing the use of
CLOCK_REALTIME instead. Not only would that complicate
the build system, but it may leave us with minus %CPU.
Another approach was to ensure that elapsed time could
never be negative. Of course, this produced distortion
of %CPU values but it would be proportionally correct.
This wasn't dissimilar to a distortion already present
should the time be adjusted forward or backward within
any 'remaining' top delay intervals. These aberrations
would be avoided with clock_gettime & CLOCK_MONOTONIC,
but that is a less than ideal solution as noted above.
This final solution, which originated down under, will
simply rely on the /proc/uptime seconds, which will be
immune to *any* tampering with the system clock. Thus,
we now have a fix for the distortion we didn't know we
suffered plus a negative %CPU that began this odyssey.
Thanks to:
sk.alvin.x@gmail.com, for the original effort
jcapik@redhat.com, for a heads up on CLOCK_MONOTONIC
csmall-procps@enc.com.au, for the best suggestion of all
Reference(s):
. original post/patch
http://www.freelists.org/post/procps/PATCH-top-use-clock-gettime-instead-of-gettimeofday
. heads up on CLOCK_MONOTONIC
http://www.freelists.org/post/procps/PATCH-top-use-clock-gettime-instead-of-gettimeofday,2
. the final solution
http://www.freelists.org/post/procps/PATCH-top-use-clock-gettime-instead-of-gettimeofday,11
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git top/top.c top/top.c
index d767495..cbcb152 100644
--- top/top.c
+++ top/top.c
@@ -2518,17 +2518,14 @@ static void procs_hlp (proc_t *this) {
HST_t *h;
if (!this) {
- static struct timeval oldtimev;
- struct timeval timev;
- struct timezone timez;
+ static double uptime_sav;
+ double uptime_cur;
float et;
void *v;
- gettimeofday(&timev, &timez);
- et = (timev.tv_sec - oldtimev.tv_sec)
- + (float)(timev.tv_usec - oldtimev.tv_usec) / 1000000.0;
- oldtimev.tv_sec = timev.tv_sec;
- oldtimev.tv_usec = timev.tv_usec;
+ uptime(&uptime_cur, NULL);
+ et = uptime_cur - uptime_sav;
+ uptime_sav = uptime_cur;
// if in Solaris mode, adjust our scaling for all cpus
Frame_etscale = 100.0f / ((float)Hertz * (float)et * (Rc.mode_irixps ? 1 : smp_num_cpus));
--
1.7.9.2

View File

@ -1,386 +0,0 @@
Based on 4fcd56bf582ee2ef5b205625ca3d1bfed90364e9 Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Tue, 4 Feb 2014 19:10:42 +0100
Subject: [PATCH] vmstat: Support for timestamps with '-t' & fix for '-wd'
From now the vmstat can append a timestamp to each line in the
VMSTAT and DISKSTAT mode. You can achieve that with the '-t'
switch.
The '-w' switch now works in the DISKSTAT mode too.
---
vmstat.8 | 3 +
vmstat.c | 197 +++++++++++++++++++++++++++++++++++++++++++++++++++-----------
2 files changed, 167 insertions(+), 33 deletions(-)
diff --git vmstat.8 vmstat.8
index ef6cbe9..420d9f3 100644
--- vmstat.8
+++ vmstat.8
@@ -74,6 +74,9 @@ or 1048576
bytes. Note this does not change the swap (si/so) or block (bi/bo)
fields.
.TP
+\fB\-t\fR, \fB\-\-timestamp\fR
+Append timestamp to each line
+.TP
\fB\-w\fR, \fB\-\-wide\fR
Wide output mode (useful for systems with higher amount of memory,
where the default output mode suffers from unwanted column breakage).
diff --git vmstat.c vmstat.c
index c01351d..a84d2d2 100644
--- vmstat.c
+++ vmstat.c
@@ -43,6 +43,7 @@
#include <sys/stat.h>
#include <termios.h>
#include <unistd.h>
+#include <time.h>
#include "c.h"
#include "fileutils.h"
#include "nls.h"
@@ -75,6 +76,9 @@ static int a_option;
/* "-w" means "wide output" */
static int w_option;
+/* "-t" means "show timestamp" */
+static int t_option;
+
static unsigned sleep_time = 1;
static int infinite_updates = 0;
static unsigned long num_updates;
@@ -100,6 +104,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(_(" -t, --timestamp show timestamp\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out);
@@ -180,21 +185,33 @@ static int format_1000(unsigned long long val64, char *restrict dst)
static void new_header(void)
{
+ struct tm *tm_ptr;
+ time_t the_time;
+ char timebuf[32];
+
/* Translation Hint: Translating folloging header & fields
* that follow (marked with max x chars) might not work,
* unless manual page is translated as well. */
-
- const char header[] =
- "procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----\n";
- const char wide_header[] =
- "procs -----------------------memory---------------------- ---swap-- -----io---- -system-- --------cpu--------\n";
+ const char *header =
+ _("procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----");
+ const char *wide_header =
+ _("procs -----------------------memory---------------------- ---swap-- -----io---- -system-- --------cpu--------");
+ const char *timestamp_header = _(" -----timestamp-----");
const char format[] =
- "%2s %2s %6s %6s %6s %6s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s\n";
+ "%2s %2s %6s %6s %6s %6s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s";
const char wide_format[] =
- "%2s %2s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s\n";
+ "%2s %2s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s";
+
+
+ printf(w_option ? wide_header : header);
+
+ if (t_option) {
+ printf(timestamp_header);
+ }
+
+ printf("\n");
- printf(w_option ? _(wide_header) : _(header));
printf(
w_option ? wide_format : format,
/* Translation Hint: max 2 chars */
@@ -235,6 +252,19 @@ static void new_header(void)
_("wa"),
/* Translation Hint: max 2 chars */
_("st"));
+
+ if (t_option) {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ if (strftime(timebuf, sizeof(timebuf), "%Z", tm_ptr)) {
+ timebuf[strlen(timestamp_header) - 1] = '\0';
+ } else {
+ timebuf[0] = '\0';
+ }
+ printf(" %*s", (int)(strlen(timestamp_header) - 1), timebuf);
+ }
+
+ printf("\n");
}
static unsigned long unitConvert(unsigned long size)
@@ -247,9 +277,9 @@ static unsigned long unitConvert(unsigned long size)
static void new_format(void)
{
const char format[] =
- "%2u %2u %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u\n";
+ "%2u %2u %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u";
const char wide_format[] =
- "%2u %2u %12lu %12lu %12lu %12lu %4u %4u %5u %5u %4u %4u %3u %3u %3u %3u %3u\n";
+ "%2u %2u %12lu %12lu %12lu %12lu %4u %4u %5u %5u %4u %4u %3u %3u %3u %3u %3u";
unsigned int tog = 0; /* toggle switch for cleaner code */
unsigned int i;
@@ -263,6 +293,9 @@ static void new_format(void)
unsigned int sleep_half;
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
long long debt = 0; /* handle idle ticks running backwards */
+ struct tm *tm_ptr;
+ time_t the_time;
+ char timebuf[32];
sleep_half = (sleep_time / 2);
new_header();
@@ -272,6 +305,12 @@ static void new_format(void)
cpu_zzz, pgpgin, pgpgout, pswpin, pswpout, intr, ctxt, &running,
&blocked, &dummy_1, &dummy_2);
+ if (t_option) {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm_ptr);
+ }
+
duse = *cpu_use + *cpu_nic;
dsys = *cpu_sys + *cpu_xxx + *cpu_yyy;
didl = *cpu_idl;
@@ -298,6 +337,12 @@ static void new_format(void)
(unsigned)( (100*dstl + divo2) / Div )
);
+ if (t_option) {
+ printf(" %s", timebuf);
+ }
+
+ printf("\n");
+
/* main loop */
for (i = 1; infinite_updates || i < num_updates; i++) {
sleep(sleep_time);
@@ -313,6 +358,12 @@ static void new_format(void)
pgpgout + tog, pswpin + tog, pswpout + tog, intr + tog,
ctxt + tog, &running, &blocked, &dummy_1, &dummy_2);
+ if (t_option) {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm_ptr);
+ }
+
duse =
cpu_use[tog] - cpu_use[!tog] + cpu_nic[tog] - cpu_nic[!tog];
dsys =
@@ -364,6 +415,12 @@ static void new_format(void)
/* st */
(unsigned)( (100*dstl+divo2)/Div )
);
+
+ if (t_option) {
+ printf(" %s", timebuf);
+ }
+
+ printf("\n");
}
}
@@ -453,11 +510,33 @@ static int diskpartition_format(const char *partition_name)
static void diskheader(void)
{
+ struct tm *tm_ptr;
+ time_t the_time;
+ char timebuf[32];
+
/* Translation Hint: Translating folloging header & fields
* that follow (marked with max x chars) might not work,
* unless manual page is translated as well. */
- printf(_("disk- ------------reads------------ ------------writes----------- -----IO------\n"));
- printf("%5s %6s %6s %7s %7s %6s %6s %7s %7s %6s %6s\n",
+ const char *header =
+ _("disk- ------------reads------------ ------------writes----------- -----IO------");
+ const char *wide_header =
+ _("disk- -------------------reads------------------- -------------------writes------------------ ------IO-------");
+ const char *timestamp_header = _(" -----timestamp-----");
+
+ const char format[] =
+ "%5s %6s %6s %7s %7s %6s %6s %7s %7s %6s %6s";
+ const char wide_format[] =
+ "%5s %9s %9s %11s %11s %9s %9s %11s %11s %7s %7s";
+
+ printf(w_option ? wide_header : header);
+
+ if (t_option) {
+ printf(timestamp_header);
+ }
+
+ printf("\n");
+
+ printf(w_option ? wide_format : format,
" ",
/* Translation Hint: max 6 chars */
_("total"),
@@ -479,25 +558,53 @@ static void diskheader(void)
_("cur"),
/* Translation Hint: max 6 chars */
_("sec"));
+
+ if (t_option) {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ if (strftime(timebuf, sizeof(timebuf), "%Z", tm_ptr)) {
+ timebuf[strlen(timestamp_header) - 1] = '\0';
+ } else {
+ timebuf[0] = '\0';
+ }
+ printf(" %*s", (int)(strlen(timestamp_header) - 1), timebuf);
+ }
+
+ printf("\n");
}
static void diskformat(void)
{
+ const char format[] =
+ "%-5s %6u %6u %7llu %7u %6u %6u %7llu %7u %6u %6u";
+ const char wide_format[] =
+ "%-5s %9u %9u %11llu %11u %9u %9u %11llu %11u %7u %7u";
+
FILE *fDiskstat;
struct disk_stat *disks;
struct partition_stat *partitions;
unsigned long ndisks, i, j, k;
- const char format[] = "%-5s %6u %6u %7llu %7u %6u %6u %7llu %7u %6u %6u\n";
+ struct tm *tm_ptr;
+ time_t the_time;
+ char timebuf[32];
+
if ((fDiskstat = fopen("/proc/diskstats", "rb"))) {
fclose(fDiskstat);
ndisks = getdiskstat(&disks, &partitions);
+
+ if (t_option) {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm_ptr);
+ }
+
if (!moreheaders)
diskheader();
for (k = 0; k < ndisks; k++) {
if (moreheaders && ((k % height) == 0))
diskheader();
- printf(format,
+ printf(w_option ? wide_format : format,
disks[k].disk_name,
disks[k].reads,
disks[k].merged_reads,
@@ -510,31 +617,51 @@ static void diskformat(void)
disks[k].inprogress_IO ? disks[k].inprogress_IO / 1000 : 0,
disks[k].milli_spent_IO ? disks[k].
milli_spent_IO / 1000 : 0);
+
+ if (t_option) {
+ printf(" %s", timebuf);
+ }
+
+ printf("\n");
fflush(stdout);
}
free(disks);
free(partitions);
+
for (j = 1; infinite_updates || j < num_updates; j++) {
sleep(sleep_time);
ndisks = getdiskstat(&disks, &partitions);
- for (i = 0; i < ndisks; i++, k++) {
- if (moreheaders && ((k % height) == 0))
- diskheader();
- printf(format,
- disks[i].disk_name,
- disks[i].reads,
- disks[i].merged_reads,
- disks[i].reads_sectors,
- disks[i].milli_reading,
- disks[i].writes,
- disks[i].merged_writes,
- disks[i].written_sectors,
- disks[i].milli_writing,
- disks[i].inprogress_IO ? disks[i].inprogress_IO / 1000 : 0,
- disks[i].milli_spent_IO ? disks[i].
- milli_spent_IO / 1000 : 0);
- fflush(stdout);
- }
+
+ if (t_option) {
+ (void) time( &the_time );
+ tm_ptr = localtime( &the_time );
+ strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S", tm_ptr);
+ }
+
+ for (i = 0; i < ndisks; i++, k++) {
+ if (moreheaders && ((k % height) == 0))
+ diskheader();
+ printf(w_option ? wide_format : format,
+ disks[i].disk_name,
+ disks[i].reads,
+ disks[i].merged_reads,
+ disks[i].reads_sectors,
+ disks[i].milli_reading,
+ disks[i].writes,
+ disks[i].merged_writes,
+ disks[i].written_sectors,
+ disks[i].milli_writing,
+ disks[i].inprogress_IO ? disks[i].inprogress_IO / 1000 : 0,
+ disks[i].milli_spent_IO ? disks[i].
+ milli_spent_IO / 1000 : 0);
+
+ if (t_option) {
+ printf(" %s", timebuf);
+ }
+
+ printf("\n");
+ fflush(stdout);
+ }
free(disks);
free(partitions);
}
@@ -740,6 +867,7 @@ int main(int argc, char *argv[])
{"partition", required_argument, NULL, 'p'},
{"unit", required_argument, NULL, 'S'},
{"wide", no_argument, NULL, 'w'},
+ {"timestamp", no_argument, NULL, 't'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
@@ -754,7 +882,7 @@ int main(int argc, char *argv[])
atexit(close_stdout);
while ((c =
- getopt_long(argc, argv, "afmnsdDp:S:whV", longopts,
+ getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts,
NULL)) != EOF)
switch (c) {
case 'V':
@@ -820,6 +948,9 @@ int main(int argc, char *argv[])
case 'w':
w_option = 1;
break;
+ case 't':
+ t_option = 1;
+ break;
default:
/* no other aguments defined yet. */
usage(stderr);
--
1.7.9.2

View File

@ -1,34 +0,0 @@
From 835b6294d18a6ad79ff56aaeb0038bc6d006384b Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Tue, 4 Feb 2014 09:46:58 -0800
Subject: [PATCH] watch: Don't leak extra fds to the child
Once the write side of the pipe has been duped to stdout for the child,
the original pipefd is no longer needed, so it can be closed to avoid
leaking to the child.
The leak can easily be seen with "watch ls -l /proc/self/fd", but I
found this due to "watch lvs" diagnosing itself:
File descriptor 4 (pipe:[3163616]) leaked on lvs invocation.
Signed-off-by: Josh Stone <jistone@redhat.com>
---
watch.c | 1 +
1 file changed, 1 insertion(+)
diff --git watch.c watch.c
index 032dfb7..f0a3ec3 100644
--- watch.c
+++ watch.c
@@ -387,6 +387,7 @@ static int run_command(char *restrict command, char **restrict command_argv)
if (dup2(pipefd[1], 1) < 0) { /* replace stdout with write side of pipe */
xerr(3, _("dup2 failed"));
}
+ close(pipefd[1]); /* once duped, the write fd isn't needed */
dup2(1, 2); /* stderr should default to stdout */
if (flags & WATCH_EXEC) { /* pass command to exec instead of system */
--
1.7.9.2

View File

@ -1,46 +0,0 @@
From dc072aced7250fed9b01fb05f0d672678752a63e Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Wed, 5 Feb 2014 17:09:45 +0100
Subject: [PATCH] vmstat: Fixing format-security flaws
Previously the headers were printed directly without
the format specifier. That way is considered insecure
and leads to build errors with -Werror=format-security
flag set.
---
vmstat.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git vmstat.c vmstat.c
index a84d2d2..a2fd351 100644
--- vmstat.c
+++ vmstat.c
@@ -204,10 +204,10 @@ static void new_header(void)
"%2s %2s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s";
- printf(w_option ? wide_header : header);
+ printf("%s", w_option ? wide_header : header);
if (t_option) {
- printf(timestamp_header);
+ printf("%s", timestamp_header);
}
printf("\n");
@@ -528,10 +528,10 @@ static void diskheader(void)
const char wide_format[] =
"%5s %9s %9s %11s %11s %9s %9s %11s %11s %7s %7s";
- printf(w_option ? wide_header : header);
+ printf("%s", w_option ? wide_header : header);
if (t_option) {
- printf(timestamp_header);
+ printf("%s", timestamp_header);
}
printf("\n");
--
1.7.9.2

View File

@ -1,27 +0,0 @@
From 2ade4b082b8c970bb1e1a6711d79f82b90075431 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@enc.com.au>
Date: Sat, 22 Feb 2014 11:34:53 +1100
Subject: [PATCH] Added get-trans target to Makefile
The get-trans target rsyncs the latest copies of translation files
from the translation project. I put this target in because I always
forget the exact syntax of the command.
Signed-off-by: Craig Small <csmall@enc.com.au>
---
Makefile.am | 2 ++
1 file changed, 2 insertions(+)
diff --git Makefile.am Makefile.am
index 7075e67..335fbc5 100644
--- Makefile.am
+++ Makefile.am
@@ -123,3 +123,5 @@ $(top_srcdir)/.version:
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
+get-trans:
+ rsync -Lrtvz translationproject.org::tp/latest/procps/ po
--
1.7.9.2

View File

@ -1,32 +0,0 @@
From fe37ad15cd394af021af7a3e5ad11bad70af4bfd Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Sun, 27 Apr 2014 00:00:00 -0500
Subject: [PATCH] top: avoid a 'nan' when the delay interval is very low
The granularity of /proc/uptime is fixed at hundredths
of a second. And, since we can cycle faster than that,
we are exposed to 'nan' when calculating elapsed time.
This commit will protect us from that outcome when the
delay interval has been set to an extremely low value.
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 1 +
1 file changed, 1 insertion(+)
diff --git top/top.c top/top.c
index 0428496..0ae5388 100644
--- top/top.c
+++ top/top.c
@@ -2525,6 +2525,7 @@ static void procs_hlp (proc_t *this) {
uptime(&uptime_cur, NULL);
et = uptime_cur - uptime_sav;
+ if (et < 0.01) et = 0.005;
uptime_sav = uptime_cur;
// if in Solaris mode, adjust our scaling for all cpus
--
1.7.9.2

View File

@ -1,155 +0,0 @@
Based on 3569c0351fae7797e8d62feae7229d2d6d2aa0a1 Mon Sep 17 00:00:00 2001
From: Jakob Unterwurzacher <jakobunt@gmail.com>
Date: Tue, 18 Feb 2014 22:12:21 +0100
Subject: [PATCH] library: properly handle memory used by tmpfs
tmpfs has become much more widely used since distributions use it for
/tmp (Fedora 18+). In /proc/meminfo, memory used by tmpfs is accounted
into "Cached" (aka "NR_FILE_PAGES",
http://lxr.free-electrons.com/source/mm/shmem.c#L301 ).
The tools just pass it on, so what top, free and vmstat report as
"cached" is the sum of page cache and tmpfs.
free has the extremely useful "-/+ buffers/cache" output. However, now
that tmpfs is accounted into "cached", those numbers are way off once
you have big files in /tmp.
Fortunately, kernel 2.6.32 introduces "Shmem", which makes tmpfs memory
usage accessible from userspace (
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4b02108ac1b3354a22b0d83c684797692efdc395 ).
This patch substracts Shmem from Cached to get the actual page cache
memory. This makes both issues mentioned above disappear. For older
kernels, Shmem is not available (hence zero) and this patch is no-op.
Additionally:
* Update the man pages of free and vmstat to explain what is happening
* Finally drop "MemShared" from the /proc/meminfo parser, it has been
dead for 10+ years and is only causing confusion ( removed in kernel
2.5.54, see
https://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/?id=fe04e9451e5a159247cf9f03c615a4273ac0c571 )
---
free.1 | 29 ++++++++++++++++++++++++-----
proc/sysinfo.c | 8 ++++----
proc/sysinfo.h | 3 +--
vmstat.8 | 3 ++-
4 files changed, 31 insertions(+), 12 deletions(-)
diff --git free.1 free.1
index 1e8e7ef..21cce28 100644
--- free.1
+++ free.1
@@ -11,11 +11,30 @@ free \- Display amount of free and used memory in the system
.SH DESCRIPTION
.B free
displays the total amount of free and used physical and swap memory in the
-system, as well as the buffers used by the kernel.
-The shared memory column represents either the MemShared value (2.4 series
-kernels) or the Shmem value (2.6 series kernels and later) taken from the
-/proc/meminfo file. The value is zero if none of the entries is exported
-by the kernel.
+system, as well as the buffers and caches used by the kernel. The
+information is gathered by parsing /proc/meminfo. The displayed
+columns are:
+.TP
+\fBtotal\fR
+Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
+.TP
+\fBused\fR
+Used memory (calculated as total - free)
+.TP
+\fBfree\fR
+Unused memory (MemFree and SwapFree in /proc/meminfo)
+.TP
+\fBshared\fR
+Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available on
+kernels 2.6.32, displayed as zero if not available)
+.TP
+\fBbuffers\fR
+Memory used by kernel buffers (Buffers in /proc/meminfo)
+.TP
+\fBcached\fR
+Memory used by the page cache (calculated as Cached - Shmem in
+/proc/meminfo - the Cached value is actually the sum of page cache and
+tmpfs memory)
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-bytes\fR
diff --git proc/sysinfo.c proc/sysinfo.c
index 1680cc4..e07ca86 100644
--- proc/sysinfo.c
+++ proc/sysinfo.c
@@ -533,7 +533,6 @@ static int compare_mem_table_structs(con
*
* MemTotal: 61768 kB old
* MemFree: 1436 kB old
- * MemShared: 0 kB old (now always zero; not calculated)
* Buffers: 1312 kB old
* Cached: 20932 kB old
* Active: 12464 kB new
@@ -562,7 +561,7 @@ static int compare_mem_table_structs(con
* Hugepagesize: 4096 kB 2.5.??+
*/
-/* obsolete since 2.6.x, but reused for shmem in 2.6.32+ */
+/* Shmem in 2.6.32+ */
unsigned long kb_main_shared;
/* old but still kicking -- the important stuff */
unsigned long kb_main_buffers;
@@ -634,14 +633,13 @@ void meminfo(void){
{"LowTotal", &kb_low_total},
{"Mapped", &kb_mapped}, // kB version of vmstat nr_mapped
{"MemFree", &kb_main_free}, // important
- {"MemShared", &kb_main_shared}, // obsolete since kernel 2.6! (sharing the variable with Shmem replacement)
{"MemTotal", &kb_main_total}, // important
{"NFS_Unstable", &kb_nfs_unstable},
{"PageTables", &kb_pagetables}, // kB version of vmstat nr_page_table_pages
{"ReverseMaps", &nr_reversemaps}, // same as vmstat nr_page_table_pages
{"SReclaimable", &kb_swap_reclaimable}, // "swap reclaimable" (dentry and inode structures)
{"SUnreclaim", &kb_swap_unreclaimable},
- {"Shmem", &kb_main_shared}, // kernel 2.6 and later (sharing the output variable with obsolete MemShared)
+ {"Shmem", &kb_main_shared}, // kernel 2.6.32 and later
{"Slab", &kb_slab}, // kB version of vmstat nr_slab
{"SwapCached", &kb_swap_cached},
{"SwapFree", &kb_swap_free}, // important
@@ -697,6 +695,8 @@ nextline:
}
if ((ev=getenv("PS_FULL_CACHE")))
kb_main_cached += kb_swap_reclaimable + kb_swap_cached + kb_nfs_unstable;
+ /* "Cached" includes "Shmem" - we want only the page cache here */
+ kb_main_cached -= kb_main_shared;
}
/*****************************************************************/
diff --git proc/sysinfo.h proc/sysinfo.h
index 1eb3472..2291631 100644
--- proc/sysinfo.h
+++ proc/sysinfo.h
@@ -20,8 +20,7 @@ extern int uptime (double *uptime_secs, double *idle_secs);
extern unsigned long getbtime(void);
extern void loadavg(double *av1, double *av5, double *av15);
-
-/* obsolete */
+/* Shmem in 2.6.32+ */
extern unsigned long kb_main_shared;
/* old but still kicking -- the important stuff */
extern unsigned long kb_main_buffers;
diff --git vmstat.8 vmstat.8
index 420d9f3..2782a42 100644
--- vmstat.8
+++ vmstat.8
@@ -102,7 +102,8 @@ b: The number of processes in uninterruptible sleep.
swpd: the amount of virtual memory used.
free: the amount of idle memory.
buff: the amount of memory used as buffers.
-cache: the amount of memory used as cache.
+cache: the amount of memory used as cache (excluding tmpfs memory for
+kernels 2.6.32+)
inact: the amount of inactive memory. (\-a option)
active: the amount of active memory. (\-a option)
.fi
--
1.7.9.2

View File

@ -1,287 +0,0 @@
From bef6b0f025a0638c37bf987039b65272f0fff587 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Sun, 27 Apr 2014 00:00:00 -0500
Subject: [PATCH] top: standardize <Esc> key support with prompted input
In release 3.3.6, some commands were equipped with the
concept of a 'default pid'. The initial implementation
meant that the intuitive <Esc> key would not always be
treated as one would expect under any well behaved UI.
This patch ensures the expected <Esc> key behavior of:
terminating user input while still making possible the
necessary distinction between 'no input' & 'defaults'.
Reference(s):
http://www.freelists.org/post/procps/top-Escape-doesnt-abort-kill-command
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.1 | 2 ++
top/top.c | 105 ++++++++++++++++++++++++++++++++++++-------------------------
2 files changed, 65 insertions(+), 42 deletions(-)
diff --git top/top.1 top/top.1
index c15a871..67b8b35 100644
--- top/top.1
+++ top/top.1
@@ -1082,6 +1082,7 @@ depending on your progress:
.nf
1) at the pid prompt, type an invalid number
2) at the signal prompt, type 0 (or any invalid signal)
+ 3) at any prompt, type <Esc>
.fi
.TP 7
@@ -1106,6 +1107,7 @@ depending on your progress:
.nf
1) at the pid prompt, type an invalid number
2) at the nice prompt, type <Enter> with no input
+ 3) at any prompt, type <Esc>
.fi
.TP 7
diff --git top/top.c top/top.c
index 0ae5388..9f33a05 100644
--- top/top.c
+++ top/top.c
@@ -1150,8 +1150,11 @@ static char *ioline (const char *prompt) {
key = iokey(2);
switch (key) {
case 0:
+ buf[0] = '\0';
+ return buf;
case kbd_ESC:
- buf[0] = '\0'; // fall through !
+ buf[0] = kbd_ESC;
+ return buf;
case kbd_ENTER:
continue;
case kbd_INS:
@@ -1197,7 +1200,7 @@ static char *ioline (const char *prompt) {
}
putp(fmtmk("%s%s%s", tg2(beg, Msg_row), Cap_clr_eol, buf));
putp(tg2(beg+pos, Msg_row));
- } while (key && key != kbd_ENTER && key != kbd_ESC);
+ } while (key != kbd_ENTER);
// weed out duplicates, including empty strings (top-of-stack)...
for (i = 0, plin = anchor; ; i++) {
@@ -1275,6 +1278,10 @@ static int readfile (FILE *fp, char **baddr, size_t *bsize, size_t *bread) {
/*###### Small Utility routines ########################################*/
+#define GET_NUM_BAD INT_MIN
+#define GET_NUM_ESC (INT_MIN + 1)
+#define GET_NUM_NOT (INT_MIN + 2)
+
/*
* Get a float from the user */
static float get_float (const char *prompt) {
@@ -1282,20 +1289,18 @@ static float get_float (const char *prompt) {
float f;
line = ioline(prompt);
- if (!line[0] || Frames_signal) return -1.0;
+ if (line[0] == kbd_ESC || Frames_signal) return GET_NUM_ESC;
+ if (!line[0]) return GET_NUM_NOT;
// note: we're not allowing negative floats
if (strcspn(line, "+,.0123456789")) {
show_msg(N_txt(BAD_numfloat_txt));
- return -1.0;
+ return GET_NUM_BAD;
}
sscanf(line, "%f", &f);
return f;
} // end: get_float
-#define GET_INT_BAD INT_MIN
-#define GET_INTNONE (INT_MIN + 1)
-
/*
* Get an integer from the user, returning INT_MIN for error */
static int get_int (const char *prompt) {
@@ -1303,12 +1308,12 @@ static int get_int (const char *prompt) {
int n;
line = ioline(prompt);
- if (Frames_signal) return GET_INT_BAD;
- if (!line[0]) return GET_INTNONE;
+ if (line[0] == kbd_ESC || Frames_signal) return GET_NUM_ESC;
+ if (!line[0]) return GET_NUM_NOT;
// note: we've got to allow negative ints (renice)
if (strcspn(line, "-+0123456789")) {
show_msg(N_txt(BAD_integers_txt));
- return GET_INT_BAD;
+ return GET_NUM_BAD;
}
sscanf(line, "%d", &n);
return n;
@@ -2918,7 +2923,9 @@ static void insp_find_str (int ch, int *col, int *row) {
return;
}
if (ch == 'L' || ch == '/') {
- snprintf(Insp_sel->fstr, FNDBUFSIZ, "%s", ioline(N_txt(GET_find_str_txt)));
+ char *str = ioline(N_txt(GET_find_str_txt));
+ if (*str == kbd_ESC) return;
+ snprintf(Insp_sel->fstr, FNDBUFSIZ, "%s", str);
Insp_sel->flen = strlen(Insp_sel->fstr);
found = 0;
}
@@ -4135,7 +4142,9 @@ static void find_string (int ch) {
return;
}
if ('L' == ch) {
- snprintf(Curwin->findstr, FNDBUFSIZ, "%s", ioline(N_txt(GET_find_str_txt)));
+ char *str = ioline(N_txt(GET_find_str_txt));
+ if (*str == kbd_ESC) return;
+ snprintf(Curwin->findstr, FNDBUFSIZ, "%s", str);
Curwin->findlen = strlen(Curwin->findstr);
found = 0;
#ifndef USE_X_COLHDR
@@ -4225,7 +4234,9 @@ static void other_selection (int ch) {
sel = strstr;
}
glob = ioline(fmtmk(N_fmt(OSEL_prompts_fmt), Curwin->osel_tot + 1, typ));
- if (!snprintf(raw, sizeof(raw), "%s", glob)) return;
+ if (*glob == kbd_ESC
+ || !snprintf(raw, sizeof(raw), "%s", glob))
+ return;
for (osel = Curwin->osel_1st; osel; ) {
if (!strcmp(osel->raw, glob)) { // #1: is criteria duplicate?
show_msg(N_txt(OSEL_errdups_txt));
@@ -4343,7 +4354,7 @@ static void keys_global (int ch) {
else {
float tmp =
get_float(fmtmk(N_fmt(DELAY_change_fmt), Rc.delay_time));
- if (-1 < tmp) Rc.delay_time = tmp;
+ if (tmp > -1) Rc.delay_time = tmp;
}
break;
case 'E':
@@ -4379,17 +4390,21 @@ static void keys_global (int ch) {
if (Secure_mode) {
show_msg(N_txt(NOT_onsecure_txt));
} else {
- int pid, sig = SIGTERM, def = w->ppt[w->begtask]->tid;
- if (GET_INT_BAD < (pid = get_int(fmtmk(N_txt(GET_pid2kill_fmt), def)))) {
+ int sig = SIGTERM,
+ def = w->ppt[w->begtask]->tid,
+ pid = get_int(fmtmk(N_txt(GET_pid2kill_fmt), def));
+ if (pid > GET_NUM_ESC) {
char *str;
- if (0 > pid) pid = def;
+ if (pid == GET_NUM_NOT) pid = def;
str = ioline(fmtmk(N_fmt(GET_sigs_num_fmt), pid, SIGTERM));
- if (*str) sig = signal_name_to_number(str);
- if (Frames_signal) break;
- if (0 < sig && kill(pid, sig))
- show_msg(fmtmk(N_fmt(FAIL_signals_fmt)
- , pid, sig, strerror(errno)));
- else if (0 > sig) show_msg(N_txt(BAD_signalid_txt));
+ if (*str != kbd_ESC) {
+ if (*str) sig = signal_name_to_number(str);
+ if (Frames_signal) break;
+ if (0 < sig && kill(pid, sig))
+ show_msg(fmtmk(N_fmt(FAIL_signals_fmt)
+ , pid, sig, strerror(errno)));
+ else if (0 > sig) show_msg(N_txt(BAD_signalid_txt));
+ }
}
}
break;
@@ -4397,21 +4412,24 @@ static void keys_global (int ch) {
if (Secure_mode)
show_msg(N_txt(NOT_onsecure_txt));
else {
- int val, pid, def = w->ppt[w->begtask]->tid;
- if (GET_INT_BAD < (pid = get_int(fmtmk(N_txt(GET_pid2nice_fmt), def)))) {
- if (0 > pid) pid = def;
- if (GET_INTNONE < (val = get_int(fmtmk(N_fmt(GET_nice_num_fmt), pid))))
- if (setpriority(PRIO_PROCESS, (unsigned)pid, val))
- show_msg(fmtmk(N_fmt(FAIL_re_nice_fmt)
- , pid, val, strerror(errno)));
+ int val,
+ def = w->ppt[w->begtask]->tid,
+ pid = get_int(fmtmk(N_txt(GET_pid2nice_fmt), def));
+ if (pid > GET_NUM_ESC) {
+ if (pid == GET_NUM_NOT) pid = def;
+ val = get_int(fmtmk(N_fmt(GET_nice_num_fmt), pid));
+ if (val > GET_NUM_NOT
+ && setpriority(PRIO_PROCESS, (unsigned)pid, val))
+ show_msg(fmtmk(N_fmt(FAIL_re_nice_fmt)
+ , pid, val, strerror(errno)));
}
}
break;
case 'X':
{ int wide = get_int(fmtmk(N_fmt(XTRA_fixwide_fmt), Rc.fixed_widest));
- if (GET_INTNONE < wide) {
- if (-1 < wide) Rc.fixed_widest = wide;
- else if (INT_MIN < wide) Rc.fixed_widest = -1;
+ if (wide > GET_NUM_NOT) {
+ if (wide > -1) Rc.fixed_widest = wide;
+ else Rc.fixed_widest = -1;
}
}
break;
@@ -4419,9 +4437,10 @@ static void keys_global (int ch) {
if (!Inspect.total)
ioline(N_txt(YINSP_noents_txt));
else {
- int pid, def = w->ppt[w->begtask]->tid;
- if (GET_INT_BAD < (pid = get_int(fmtmk(N_fmt(YINSP_pidsee_fmt), def)))) {
- if (0 > pid) pid = def;
+ int def = w->ppt[w->begtask]->tid,
+ pid = get_int(fmtmk(N_fmt(YINSP_pidsee_fmt), def));
+ if (pid > GET_NUM_ESC) {
+ if (pid == GET_NUM_NOT) pid = def;
if (pid) inspection_utility(pid);
}
}
@@ -4467,7 +4486,7 @@ static void keys_summary (int ch) {
show_msg(N_txt(NUMA_nodenot_txt));
else {
int num = get_int(fmtmk(N_fmt(NUMA_nodeget_fmt), Numa_node_tot -1));
- if (GET_INTNONE < num) {
+ if (num > GET_NUM_NOT) {
if (num >= 0 && num < Numa_node_tot) {
Numa_node_sel = num;
SETw(w, View_CPUNOD | View_STATES);
@@ -4503,7 +4522,7 @@ static void keys_task (int ch) {
case 'n':
if (VIZCHKw(w)) {
int num = get_int(fmtmk(N_fmt(GET_max_task_fmt), w->rc.maxtasks));
- if (GET_INTNONE < num) {
+ if (num > GET_NUM_NOT) {
if (-1 < num ) w->rc.maxtasks = num;
else show_msg(N_txt(BAD_max_task_txt));
}
@@ -4601,9 +4620,11 @@ static void keys_task (int ch) {
case 'U':
case 'u':
if (VIZCHKw(w)) {
- const char *errmsg;
- if ((errmsg = user_certify(w, ioline(N_txt(GET_user_ids_txt)), ch)))
- show_msg(errmsg);
+ const char *errmsg, *str = ioline(N_txt(GET_user_ids_txt));
+ if (*str != kbd_ESC
+ && (errmsg = user_certify(w, str, ch)))
+ show_msg(errmsg);
+
}
break;
case 'V':
@@ -4686,7 +4707,7 @@ static void keys_window (int ch) {
if (ALTCHKw) {
char tmp[SMLBUFSIZ];
STRLCPY(tmp, ioline(fmtmk(N_fmt(NAME_windows_fmt), w->rc.winname)));
- if (tmp[0]) win_names(w, tmp);
+ if (tmp[0] && tmp[0] != kbd_ESC) win_names(w, tmp);
}
break;
case kbd_UP:
--
1.7.9.2

View File

@ -1,106 +0,0 @@
From 2ec9f5c22e3eeaf4da514e0e6ec9374cfdbb9a99 Mon Sep 17 00:00:00 2001
From: Yuri Chornoivan <yurchor@ukr.net>
Date: Mon, 3 Mar 2014 21:58:56 +1100
Subject: [PATCH] Minor i18n fixes
Minor fixes that the translator (Yuri) has found in some of the
strings. You only know how many typos and thinkos you have when
someone is trying to translate it.
Signed-off-by: Craig Small <csmall@enc.com.au>
---
ps/help.c | 4 ++--
skill.c | 2 +-
slabtop.c | 4 ++++
top/top.c | 2 +-
top/top_nls.c | 2 +-
5 files changed, 9 insertions(+), 5 deletions(-)
diff --git ps/help.c ps/help.c
index 1b98b73..8bde12b 100644
--- ps/help.c
+++ ps/help.c
@@ -120,7 +120,7 @@ void do_help (const char *opt, int rc) {
fputs(_("\n"
" The selection options take as their argument either:\n"
" a comma-separated list e.g. '-u root,nobody' or\n"
- " or a blank-separated list e.g. '-p 123 4567'\n"), out);
+ " a blank-separated list e.g. '-p 123 4567'\n"), out);
}
if (section == HELP_OUT || section == HELP_ALL) {
fputs(_("\nOutput formats:\n"), out);
@@ -141,7 +141,7 @@ void do_help (const char *opt, int rc) {
fputs(_(" u user-oriented format\n"), out);
fputs(_(" v virtual memory format\n"), out);
fputs(_(" X register format\n"), out);
- fputs(_(" -y do not show flags, show rrs vs. addr (used with -l)\n"), out);
+ fputs(_(" -y do not show flags, show rss vs. addr (used with -l)\n"), out);
fputs(_(" --context display security context (for SELinux)\n"), out);
fputs(_(" --headers repeat header lines, one per page\n"), out);
fputs(_(" --no-headers do not print header at all\n"), out);
diff --git skill.c skill.c
index 9f3b4fc..2b1ce2f 100644
--- skill.c
+++ skill.c
@@ -751,7 +751,7 @@ int main(int argc, char ** argv)
kill_main(argc, argv);
break;
default:
- fprintf(stderr, _("skill: \"%s\" is not support\n"),
+ fprintf(stderr, _("skill: \"%s\" is not supported\n"),
program_invocation_short_name);
fprintf(stderr, USAGE_MAN_TAIL("skill(1)"));
return EXIT_FAILURE;
diff --git slabtop.c slabtop.c
index c135ec5..4be35b9 100644
--- slabtop.c
+++ slabtop.c
@@ -376,15 +376,19 @@ int main(int argc, char *argv[])
" %-35s: %.2fK / %.2fK / %.2fK\n\n",
/* Translation Hint: Next five strings must not
* exceed 35 length in characters. */
+ /* xgettext:no-c-format */
_("Active / Total Objects (% used)"),
stats.nr_active_objs, stats.nr_objs,
100.0 * stats.nr_active_objs / stats.nr_objs,
+ /* xgettext:no-c-format */
_("Active / Total Slabs (% used)"),
stats.nr_active_slabs, stats.nr_slabs,
100.0 * stats.nr_active_slabs / stats.nr_slabs,
+ /* xgettext:no-c-format */
_("Active / Total Caches (% used)"),
stats.nr_active_caches, stats.nr_caches,
100.0 * stats.nr_active_caches / stats.nr_caches,
+ /* xgettext:no-c-format */
_("Active / Total Size (% used)"),
stats.active_size / 1024.0, stats.total_size / 1024.0,
100.0 * stats.active_size / stats.total_size,
diff --git top/top.c top/top.c
index ca3d24a..d767495 100644
--- top/top.c
+++ top/top.c
@@ -779,7 +779,7 @@ static int show_pmt (const char *str) {
* Our special formatting consists of:
* "some text <_delimiter_> some more text <_delimiter_>...\n"
* Where <_delimiter_> is a two byte combination consisting of a
- * tilde followed by an ascii digit in the the range of 1 - 8.
+ * tilde followed by an ascii digit in the range of 1 - 8.
* examples: ~1, ~5, ~8, etc.
* The tilde is effectively stripped and the next digit
* converted to an index which is then used to select an
diff --git top/top_nls.c top/top_nls.c
index 0f37d89..b47459a 100644
--- top/top_nls.c
+++ top/top_nls.c
@@ -404,7 +404,7 @@ static void build_norm_nlstab (void) {
Norm_nlstab[YINSP_demo01_txt] = _("Open Files");
Norm_nlstab[YINSP_demo02_txt] = _("NUMA Info");
Norm_nlstab[YINSP_demo03_txt] = _("Log");
- Norm_nlstab[YINSP_deqfmt_txt] = _("the '=' key will eventually show the actual file read or command(s) excuted ...");
+ Norm_nlstab[YINSP_deqfmt_txt] = _("the '=' key will eventually show the actual file read or command(s) executed ...");
Norm_nlstab[YINSP_deqtyp_txt] = _("demo");
Norm_nlstab[YINSP_dstory_txt] = _(""
"This is simulated output representing the contents of some file or the output\n"
--
1.7.9.2

View File

@ -1,142 +0,0 @@
From 0caa6d6e676c8d28b933066d19c112b02ed59245 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Wed, 7 May 2014 00:00:00 -0500
Subject: [PATCH] top: miscellaneous accumulated changes to program code
. prevent any input recall overrun if window downsized
. adjust translation notes for true column hdr maximum
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 5 ++---
top/top_nls.c | 28 ++++++++++++++--------------
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git top/top.c top/top.c
index 9f33a05..bc755f3 100644
--- top/top.c
+++ top/top.c
@@ -1183,13 +1183,13 @@ static char *ioline (const char *prompt) {
if (plin->bkw) {
plin = plin->bkw;
memset(buf, '\0', sizeof(buf));
- pos = snprintf(buf, sizeof(buf), "%s", plin->str);
+ pos = snprintf(buf, sizeof(buf), "%.*s", Screen_cols - beg - 1, plin->str);
}
break;
case kbd_DOWN:
memset(buf, '\0', sizeof(buf));
if (plin->fwd) plin = plin->fwd;
- pos = snprintf(buf, sizeof(buf), "%s", plin->str);
+ pos = snprintf(buf, sizeof(buf), "%.*s", Screen_cols - beg - 1, plin->str);
break;
default: // what we REALLY wanted (maybe)
if (isprint(key) && logCOL < bufMAX && phyCOL < Screen_cols) {
@@ -4624,7 +4624,6 @@ static void keys_task (int ch) {
if (*str != kbd_ESC
&& (errmsg = user_certify(w, str, ch)))
show_msg(errmsg);
-
}
break;
case 'V':
diff --git top/top_nls.c top/top_nls.c
index 01c8d1e..ea1c088 100644
--- top/top_nls.c
+++ top/top_nls.c
@@ -129,31 +129,31 @@ static void build_two_nlstabs (void) {
/* Translation Hint: maximum 'UID' = 5 */
Head_nlstab[EU_UED] = _("UID");
Desc_nlstab[EU_UED] = _("Effective User Id");
-/* Translation Hint: maximum 'USER' = 8 */
+/* Translation Hint: maximum 'USER' = 7 */
Head_nlstab[EU_UEN] = _("USER");
Desc_nlstab[EU_UEN] = _("Effective User Name");
/* Translation Hint: maximum 'RUID' = 5 */
Head_nlstab[EU_URD] = _("RUID");
Desc_nlstab[EU_URD] = _("Real User Id");
-/* Translation Hint: maximum 'RUSER' = 8 */
+/* Translation Hint: maximum 'RUSER' = 7 */
Head_nlstab[EU_URN] = _("RUSER");
Desc_nlstab[EU_URN] = _("Real User Name");
/* Translation Hint: maximum 'SUID' = 5 */
Head_nlstab[EU_USD] = _("SUID");
Desc_nlstab[EU_USD] = _("Saved User Id");
-/* Translation Hint: maximum 'SUSER' = 8 */
+/* Translation Hint: maximum 'SUSER' = 7 */
Head_nlstab[EU_USN] = _("SUSER");
Desc_nlstab[EU_USN] = _("Saved User Name");
/* Translation Hint: maximum 'GID' = 5 */
Head_nlstab[EU_GID] = _("GID");
Desc_nlstab[EU_GID] = _("Group Id");
-/* Translation Hint: maximum 'GROUP' = 8 */
+/* Translation Hint: maximum 'GROUP' = 7 */
Head_nlstab[EU_GRP] = _("GROUP");
Desc_nlstab[EU_GRP] = _("Group Name");
/* Translation Hint: maximum 'PGRP' = 5 */
Head_nlstab[EU_PGD] = _("PGRP");
Desc_nlstab[EU_PGD] = _("Process Group Id");
-/* Translation Hint: maximum 'TTY' = 8 */
+/* Translation Hint: maximum 'TTY' = 7 */
Head_nlstab[EU_TTY] = _("TTY");
Desc_nlstab[EU_TTY] = _("Controlling Tty");
/* Translation Hint: maximum 'TPGID' = 5 */
@@ -180,7 +180,7 @@ static void build_two_nlstabs (void) {
/* Translation Hint: maximum '' = 6 */
Head_nlstab[EU_TME] = _("TIME");
Desc_nlstab[EU_TME] = _("CPU Time");
-/* Translation Hint: maximum 'TIME+' = 9 */
+/* Translation Hint: maximum 'TIME+' = 7 */
Head_nlstab[EU_TM2] = _("TIME+");
Desc_nlstab[EU_TM2] = _("CPU Time, hundredths");
/* Translation Hint: maximum '%MEM' = 4 */
@@ -222,7 +222,7 @@ static void build_two_nlstabs (void) {
/* Translation Hint: maximum 'WCHAN' = 7 */
Head_nlstab[EU_WCH] = _("WCHAN");
Desc_nlstab[EU_WCH] = _("Sleeping in Function");
-/* Translation Hint: maximum 'Flags' = 8 */
+/* Translation Hint: maximum 'Flags' = 7 */
Head_nlstab[EU_FLG] = _("Flags");
Desc_nlstab[EU_FLG] = _("Task Flags <sched.h>");
/* Translation Hint: maximum 'CGROUPS' = 7 */
@@ -241,7 +241,7 @@ static void build_two_nlstabs (void) {
/* Translation Hint: maximum 'Adj' = 3 */
Head_nlstab[EU_OOA] = _("Adj");
Desc_nlstab[EU_OOA] = _("oom_adjustment (2^X)");
-/* Translation Hint: maximum 'Badness' = 8 */
+/* Translation Hint: maximum 'Badness' = 7 */
Head_nlstab[EU_OOM] = _("Badness");
Desc_nlstab[EU_OOM] = _("oom_score (badness)");
#endif
@@ -259,22 +259,22 @@ static void build_two_nlstabs (void) {
/* Translation Hint: maximum 'USED' = 4 */
Head_nlstab[EU_USE] = _("USED");
Desc_nlstab[EU_USE] = _("Res+Swap Size (KiB)");
-/* Translation Hint: maximum 'nsIPC' = 10 */
+/* Translation Hint: maximum 'nsIPC' = 7 */
Head_nlstab[EU_NS1] = _("nsIPC");
Desc_nlstab[EU_NS1] = _("IPC namespace Inode");
-/* Translation Hint: maximum 'nsMNT' = 10 */
+/* Translation Hint: maximum 'nsMNT' = 7 */
Head_nlstab[EU_NS2] = _("nsMNT");
Desc_nlstab[EU_NS2] = _("MNT namespace Inode");
-/* Translation Hint: maximum 'nsNET' = 10 */
+/* Translation Hint: maximum 'nsNET' = 7 */
Head_nlstab[EU_NS3] = _("nsNET");
Desc_nlstab[EU_NS3] = _("NET namespace Inode");
-/* Translation Hint: maximum 'nsPID' = 10 */
+/* Translation Hint: maximum 'nsPID' = 7 */
Head_nlstab[EU_NS4] = _("nsPID");
Desc_nlstab[EU_NS4] = _("PID namespace Inode");
-/* Translation Hint: maximum 'nsUSER' = 10 */
+/* Translation Hint: maximum 'nsUSER' = 7 */
Head_nlstab[EU_NS5] = _("nsUSER");
Desc_nlstab[EU_NS5] = _("USER namespace Inode");
-/* Translation Hint: maximum 'nsUTS' = 10 */
+/* Translation Hint: maximum 'nsUTS' = 7 */
Head_nlstab[EU_NS6] = _("nsUTS");
Desc_nlstab[EU_NS6] = _("UTS namespace Inode");
}
--
1.7.9.2

View File

@ -1,43 +0,0 @@
From 9c7e8b82f872e2d46ce866255ff132e0e6a0f937 Mon Sep 17 00:00:00 2001
From: Sami Farin <hvtaifwkbgefbaei@gmail.com>
Date: Fri, 14 Mar 2014 00:00:00 -0600
Subject: [PATCH] sysctl: increase max supported line length of the conf file
I ran into this limit with net.ipv4.ip_local_reserved_ports ,
sysctl complained about the line after the long line, further
slowing down my error hunting.
Due to fgets usage, increase buffer size to 4096 chars with
minimum amount of code changes.
Signed-off-by: Sami Farin <hvtaifwkbgefbaei@gmail.com>
---
sysctl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git sysctl.c sysctl.c
index 51af15d..fc224e5 100644
--- sysctl.c
+++ sysctl.c
@@ -483,14 +483,16 @@ static int pattern_match(const char *string, const char *pat)
return (1);
}
+#define LINELEN 4096
+
/*
* Preload the sysctl's from the conf file. We parse the file and then
* reform it (strip out whitespace).
*/
static int Preload(const char *restrict const filename)
{
- char oneline[256];
- char buffer[256];
+ char oneline[LINELEN];
+ char buffer[LINELEN];
FILE *fp;
char *t;
int n = 0;
--
1.7.9.2

View File

@ -1,27 +0,0 @@
From 0b3f63456a1265e13274fd7c6ba0903e4cb3db5a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tr=E1=BA=A7n=20Ng=E1=BB=8Dc=20Qu=C3=A2n?=
<vnwildman@gmail.com>
Date: Thu, 17 Apr 2014 14:12:01 +0700
Subject: [PATCH] fix url for rsync
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git Makefile.am Makefile.am
index 335fbc5..b32e9ce 100644
--- Makefile.am
+++ Makefile.am
@@ -124,4 +124,4 @@ dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
get-trans:
- rsync -Lrtvz translationproject.org::tp/latest/procps/ po
+ rsync -Lrtvz translationproject.org::tp/latest/procps-ng/ po
--
1.7.9.2

View File

@ -1,73 +0,0 @@
From e2868da34e6d2085fdafcd9b28cdbf01c69361c5 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Fri, 25 Apr 2014 00:00:00 -0600
Subject: [PATCH] top: update copyright dates plus 1 preprocessor change
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.c | 4 ++--
top/top.h | 2 +-
top/top_nls.c | 2 +-
top/top_nls.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git top/top.c top/top.c
index cbcb152..0428496 100644
--- top/top.c
+++ top/top.c
@@ -1,6 +1,6 @@
/* top.c - Source file: show Linux processes */
/*
- * Copyright (c) 2002-2013, by: James C. Warner
+ * Copyright (c) 2002-2014, by: James C. Warner
* All rights reserved. 8921 Hilloway Road
* Eden Prairie, Minnesota 55347 USA
*
@@ -3464,7 +3464,7 @@ static void configs_read (void) {
if (2 != fscanf(fp, "%3s\tfieldscur=%79s\n"
, w->rc.winname, w->rc.fieldscur))
goto default_or_error;
-#if PFLAGSSIZ > 80
+#if PFLAGSSIZ != 80
// too bad fscanf is not as flexible with his format string as snprintf
# error Hey, fix the above fscanf 'PFLAGSSIZ' dependency !
#endif
diff --git top/top.h top/top.h
index 5d1aead..836b9fb 100644
--- top/top.h
+++ top/top.h
@@ -1,6 +1,6 @@
/* top.h - Header file: show Linux processes */
/*
- * Copyright (c) 2002-2013, by: James C. Warner
+ * Copyright (c) 2002-2014, by: James C. Warner
* All rights reserved. 8921 Hilloway Road
* Eden Prairie, Minnesota 55347 USA
*
diff --git top/top_nls.c top/top_nls.c
index b47459a..01c8d1e 100644
--- top/top_nls.c
+++ top/top_nls.c
@@ -1,6 +1,6 @@
/* top_nls.c - provide the basis for future nls translations */
/*
- * Copyright (c) 2011-2013, by: James C. Warner
+ * Copyright (c) 2011-2014, by: James C. Warner
* All rights reserved. 8921 Hilloway Road
* Eden Prairie, Minnesota 55347 USA
*
diff --git top/top_nls.h top/top_nls.h
index 1b6d575..9010263 100644
--- top/top_nls.h
+++ top/top_nls.h
@@ -1,6 +1,6 @@
/* top_nls.h - provide the basis for future nls translations */
/*
- * Copyright (c) 2011-2013, by: James C. Warner
+ * Copyright (c) 2011-2014, by: James C. Warner
* All rights reserved. 8921 Hilloway Road
* Eden Prairie, Minnesota 55347 USA
*
--
1.7.9.2

View File

@ -1,464 +0,0 @@
From f3e55ee661d54bb667b3c0cf07411094ad7fc980 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Wed, 23 Apr 2014 00:00:01 -0500
Subject: [PATCH] top: refactor man document so as to allow translations
The majority of changes in this commit are intended to
enable translation of top's man page. There were three
kinds of errors as seen by that po4a-updatepo program.
. a valid but unrecognized request concerning no-break
. an internally defined macro with a groff .de request
. occasional apostrophe at the beginning of some lines
With respect to the apostrophe, some have been changed
to back-tic since line placement could not be assured.
And other parts were re-flowed to avoid temptations to
escape as \' (technically an acute accent). Of course,
the opening back-tic with closing apostrophe looks odd
when ASCII, but should be rendered correctly as UTF-8.
It may yet be necessary to change the remaining single
'opening' quotes to back-tics as translation proceeds.
Should that become necessary, I intend to reduce quote
usage to the bare minimum throughout the man document.
There were also some formatting changes to enhance the
man2html output and then to other formats via htmldoc.
And, I wish to acknowledge that my meager groff skills
do not serve those programs very well at all. In other
words groff yet remains mostly incomprehensible to me.
Lastly a few content plus copyright updates were made.
Message(s):
. Unknown macro '.c2 `'. Remove it from the document, or refer to the Locale::Po4a::Man manpage to see how po4a can handle new macros.
. This page defines a new macro with '.de'. Since po4a is not a real groff parser, this is not supported.
. Unknown macro ''real time' scheduling priority.'. Remove it from the document, or refer to the Locale::Po4a::Man manpage to see how po4a can handle new macros.
Reference(s):
. oriiginal post/patch
http://www.freelists.org/post/procps/Translations-for-man-pages
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.1 | 138 ++++++++++++++++++++++++++++++-------------------------------
1 file changed, 69 insertions(+), 69 deletions(-)
diff --git top/top.1 top/top.1
index f25acff..644ae46 100644
--- top/top.1
+++ top/top.1
@@ -1,7 +1,7 @@
.ig
. manual page for NEW and IMPROVED linux top
.
-. Copyright (c) 2002-2013, by: James C. Warner
+. Copyright (c) 2002-2014, by: James C. Warner
. All rights reserved. 8921 Hilloway Road
. Eden Prairie, Minnesota 55347 USA
.
@@ -13,14 +13,6 @@
.
.ll +(\n[half_xtra] + \n[half_xtra])
.
-\# ** we use single quote char (') a lot, so change the no-break ctrl char
-.c2 `
-.
-\# Our own Bullet style(s) --------------------------
-.de jBu
-.IP "o" 3
-..
-.
\# Commonly used strings (for consistency) ----------
\# - our em-dashes
.ds Em \fR\ \-\-\ \fR
@@ -32,11 +24,11 @@
.ds F \fIOff\fR
.ds O \fIOn\fR
.
-.ds AK asterisk (\'*\')
+.ds AK asterisk (`*')
.ds AM alternate\-display mode
.ds AS auxiliary storage
.ds CF configuration file
-.ds CG \'current\' window/field group
+.ds CG `current' window/field group
.ds CI interactive command
\# - Note: our 'Command Line' used in 2 places
\# ( and managed to fit in an 80x24 terminal )
@@ -44,7 +36,7 @@
\-\fBu\fR|\fBU\fR user \-\fBp\fR pid \-\fBo\fR fld \-\fBw\fR [cols] \fR
.ds CO command\-line option
.ds CT command toggle
-.ds CW \'current\' window
+.ds CW `current' window
.ds FG field group
.ds FM full\-screen mode
.ds KA arrow key
@@ -76,7 +68,7 @@
.
.\" Document /////////////////////////////////////////////////////////////
.\" ----------------------------------------------------------------------
-.TH TOP 1 "November 2013" "procps-ng" "User Commands"
+.TH TOP 1 "April 2014" "procps-ng" "User Commands"
.\" ----------------------------------------------------------------------
.\" ----------------------------------------------------------------------
@@ -646,8 +638,8 @@ The process ID (pid) of a task's parent.
.TP 4
16.\fB PR \*(Em Priority \fR
The scheduling priority of the task.
-If you see 'rt' in this field, it means the task is running under
-'real time' scheduling priority.
+If you see 'rt' in this field, it means the task is running
+under 'real time' scheduling priority.
Under linux, real time priority is somewhat misleading since traditionally
the operating itself was not preemptible.
@@ -880,27 +872,27 @@ Entries marked with an asterisk are the currently displayed fields,
screen width permitting.
.RS +4
-.jBu
+.IP \(bu 3
As the on screen instructions indicate, you navigate among the fields with
the\fB Up\fR and\fB Down\fR \*(KAs.
The PgUp, PgDn, Home and End keys can also be used to quickly reach the
first or last available field.
-.jBu
+.IP \(bu 3
The\fB Right\fR \*(KA selects a field for repositioning and
the\fB Left\fR \*(KA or the <\fBEnter\fR> key commits that field's
placement.
-.jBu
+.IP \(bu 3
The '\fBd\fR' key or the <\fBSpace\fR> bar toggles a field's display
status, and thus the presence or absence of the asterisk.
-.jBu
+.IP \(bu 3
The '\fBs\fR' key designates a field as the sort field.
\*(XT 4c. TASK AREA Commands, SORTING for additional information regarding
your selection of a sort field.
-.jBu
+.IP \(bu 3
The '\fBa\fR' and '\fBw\fR' keys can be used to cycle through all available
windows and the '\fBq\fR' or <\fBEsc\fR> keys exit Fields Management.
.RS -4
@@ -982,8 +974,8 @@ those \*(CIs applicable to \*(AM.
Removes restrictions on which tasks are shown.
This command will reverse any 'i' (idle tasks) and 'n' (max tasks)
commands that might be active.
-It also provides for an exit from pid monitoring, 'user' filtering and
-'other' filtering.
+It also provides for an exit from pid monitoring, 'user' filtering
+and 'other' filtering.
See the '\-p' \*(CO for a discussion of PID monitoring, the 'U' or 'u'
\*(CIs for user filtering and the 'O' or 'o' \*(CIs for 'other' filtering.
@@ -1138,7 +1130,7 @@ This \*(CI can be used to alter the widths of the following fields:
SUID 5 SUSER 8 nsMNT 10
UID 5 USER 8 nsNET 10
TTY 8 nsPID 10
- nsUSR 10
+ nsUSER 10
nsUTS 10
.fi
@@ -1268,10 +1260,10 @@ The \*(TA \*(CIs are\fB always\fR available in \*(FM.
The \*(TA \*(CIs are\fB never available\fR in \*(AM\fI if\fR the \*(CW's
\*(TD has been toggled \*F (\*(Xt 5. ALTERNATE\-DISPLAY Provisions).
-.TP 2
+.PP
.\" ..................................................
.B APPEARANCE\fR of \*(TW
-.PD 0
+
.TP 7
\ \ \ \fBJ\fR\ \ :\fIJustify-Numeric-Columns\fR toggle \fR
Alternates between right-justified (the default) and
@@ -1330,7 +1322,7 @@ the state of the 'x', 'y' or 'b' toggles.
.PP
.\" ..................................................
.B CONTENT\fR of \*(TW
-.PD 0
+
.TP 7
\ \ \ \fBc\fR\ \ :\fICommand-Line/Program-Name\fR toggle \fR
This command will be honored whether or not the 'COMMAND' column
@@ -1400,7 +1392,7 @@ mode in the \*(CW.
.PP
.\" ..................................................
.B SIZE\fR of \*(TW
-.PD 0
+
.TP 7
\ \ \ \fBi\fR\ \ :\fIIdle-Process\fR toggle \fR
Displays all tasks or just active tasks.
@@ -1425,10 +1417,12 @@ already been painted.
\*(NT If you wish to increase the size of the last visible \*(TD when in \*(AM,
simply decrease the size of the \*(TD(s) above it.
+.PP
-.TP 2
.\" ..................................................
.B SORTING\fR of \*(TW
+.PP
+.RS +3
For compatibility, this \*(We supports most of the former \*(We sort keys.
Since this is primarily a service to former \*(We users, these commands do
not appear on any help screen.
@@ -1462,10 +1456,8 @@ Moves the sort column to the right unless the current sort field is
the last field being displayed.
.PP
-.in +2
The following \*(CIs will\fB always\fR be honored whether or not
the current sort field is visible.
-.in
.TP 7
\ \ \ \fBf\fR | \fBF\fR\ \ :\fIFields-Management \fR
@@ -1479,10 +1471,9 @@ when running \*(We with column highlighting turned \*F.
Using this \*(CI you can alternate between high-to-low and low-to-high sorts.
.PP
-.in +2
\*(NT Field sorting uses internal values, not those in column display.
Thus, the TTY and WCHAN fields will violate strict ASCII collating sequence.
-.in
+.RE
.\" ......................................................................
.SS 4d. COLOR Mapping
@@ -1515,6 +1506,7 @@ The Color Mapping screen can also be used to change the \*(CG in
either \*(FM or \*(AM.
Whatever was targeted when 'q' or <Enter> was pressed will be made current
as you return to the \*(We display.
+.PP
.\" ----------------------------------------------------------------------
.SH 5. ALTERNATE\-DISPLAY Provisions
@@ -1537,6 +1529,7 @@ The \*(SA will always exist, even if it's only the message line.
At any given time only\fI one\fR \*(SA can be displayed.
However, depending on your commands, there could be from\fI zero \fR
to\fI four\fR separate \*(TDs currently showing on the screen.
+.PP
.TP 3
.B Current Window\fR:
@@ -1578,9 +1571,9 @@ and horizontal scrolling.
The '+' key does the same for all windows.
The four \*(TDs will reappear, evenly balanced.
-They will also have retained any customizations you had previously applied,
-except for the 'i' (idle tasks), 'n' (max tasks), 'u'/'U' (user filter),
-'o'/'O' (other filter) and scrolling \*(CIs.
+They will also have retained any customizations you had previously
+applied, except for the 'i' (idle tasks), 'n' (max tasks), 'u'/'U'
+(user filter), 'o'/'O' (other filter) and scrolling \*(CIs.
.TP 7
*\ \ \fBA\fR\ \ :\fIAlternate-Display-Mode\fR toggle \fR
@@ -1619,9 +1612,9 @@ It does not require that the window name be visible
.IP "*" 3
The \*(CIs shown with an \*(AK have use beyond \*(AM.
.nf
- \'=', 'A', 'g' are always available
- \'a', 'w' act the same with color mapping
- \ and fields management
+ '=', 'A', 'g' are always available
+ 'a', 'w' act the same with color mapping
+ and fields management
.fi
.\" ......................................................................
@@ -1790,28 +1783,31 @@ a mistake, command recall will be your friend.
Remember the Up/Down \*(KAs or their aliases when prompted for input.
.B Filter Basics
-.IP " . " 6
-field names are case sensitive and spelled as in the header
-.IP " . " 6
-selection values need not comprise the full displayed field
-.IP " . " 6
-a selection is either case insensitive or sensitive to case
-.IP " . " 6
-the default is inclusion, prepending '!' denotes exclusions
-.IP " . " 6
-multiple selection criteria can be applied to a \*(TW
-.IP " . " 6
-inclusion and exclusion criteria can be used simultaneously
-.IP " . " 6
-the 1 equality and 2 relational filters can be freely mixed
-.IP " . " 6
-separate unique filters are maintained for each \*(TW
-.RE
+.RS +3
+.TP 3
+1. field names are case sensitive and spelled as in the header
+.TP 3
+2. selection values need not comprise the full displayed field
+.TP 3
+3. a selection is either case insensitive or sensitive to case
+.TP 3
+4. the default is inclusion, prepending '!' denotes exclusions
+.TP 3
+5. multiple selection criteria can be applied to a \*(TW
+.TP 3
+6. inclusion and exclusion criteria can be used simultaneously
+.TP 3
+7. the 1 equality and 2 relational filters can be freely mixed
+.TP 3
+8. separate unique filters are maintained for each \*(TW
+.PP
If a field is not turned on or is not currently in view, then your selection
criteria will not affect the display.
Later, should a filtered field become visible, the selection criteria will
then be applied.
+.PP
+.RE
.B Keyboard Summary
.TP 6
@@ -1838,6 +1834,7 @@ It also has additional impact so please \*(Xt 4a. GLOBAL Commands.
This clears the selection criteria in all windows, assuming you are in \*(AM.
As with the '=' \*(CI, it too has additional consequences so you might wish to
\*(Xt 5b. COMMANDS for Windows.
+.PP
.RE
.B Input Requirements
@@ -1867,16 +1864,17 @@ with homogeneous data.
When some field's numeric amounts have been subjected to \fIscaling\fR
while others have not, that data is no longer homogeneous.
-If you establish a relational filter and you \fBhave\fR changed the default
-'Numeric' or 'Character' \fIjustification\fR, that filter is likely to fail.
+If you establish a relational filter and you \fBhave\fR changed the
+default 'Numeric' or 'Character' \fIjustification\fR, that filter is likely to fail.
When a relational filter is applied to a memory field and you \fBhave not\fR
changed the \fIscaling\fR, it may produce misleading results.
-This happens, for example, because '100.0m' (MiB) would appear greater than
-'1.000g' (GiB) when compared as strings.
+This happens, for example, because '100.0m' (MiB) would appear greater
+than '1.000g' (GiB) when compared as strings.
If your filtered results appear suspect, simply altering justification or
scaling may yet achieve the desired objective.
See the 'j', 'J' and 'e' \*(CIs for additional information.
+.PP
.RE
.B Potential Problems
@@ -1904,6 +1902,7 @@ So while amounts greater than 9999 exist, they will appear as 2.6m, 197k, etc.
.nf
nMin>9999 ( always a blank \*(TW )
.fi
+.PP
.RE
.B Potential Solutions
@@ -1940,13 +1939,14 @@ achieve the failed '9999' objective discussed above.
'PR>20' + '!PR=-' ( 2 for right result )
'!nMin=0 ' + '!nMin=1 ' + '!nMin=2 ' + '!nMin=3 ' ...
.fi
-.RE
+.RS -3
\*(NT When 'Other Filtering' is active, \*(We turns column highlighting
\*F to prevent false matches on internal non-display escape sequences.
Such highlighting will be restored when a window is no longer subject
to filtering.
\*(XC 'x' \*(CI for additional information on sort column highlighting.
+.RE
.\" ----------------------------------------------------------------------
.SH 6. FILES
@@ -1990,7 +1990,7 @@ Here is the general layout:
per ea # line a: winname,fieldscur
window # line b: winflags,sortindx,maxtasks
" # line c: summclr,msgsclr,headclr,taskclr
- global # line 15: fixed-width incr
+ global # line 15: width, memory scaling & zeroes overrides
" # any remaining lines are devoted to the
" # generalized 'inspect' provisions
" # discussed below
@@ -2132,7 +2132,7 @@ the authority.
For these stupid tricks, \*(We needs \*(FM.
.\" ( apparently AM static was a potential concern )
-.jBu
+.IP \(bu 3
The user interface, through prompts and help, intentionally implies
that the delay interval is limited to tenths of a second.
However, you're free to set any desired delay.
@@ -2155,7 +2155,7 @@ Then do the following:
What you'll see is a very busy Linux doing what he's always done for you,
but there was no program available to illustrate this.
-.jBu
+.IP \(bu 3
Under an xterm using 'white-on-black' colors, on \*(We's Color Mapping screen
set the task color to black and be sure that task highlighting is set to bold,
not reverse.
@@ -2164,7 +2164,7 @@ Then set the delay interval to around .3 seconds.
After bringing the most active processes into view, what you'll see are
the ghostly images of just the currently running tasks.
-.jBu
+.IP \(bu 3
Delete the existing rcfile, or create a new symlink.
Start this new version then type 'T' (a secret key,
\*(Xt 4c. Task Area Commands, SORTING) followed by 'W' and 'q'.
@@ -2180,19 +2180,19 @@ on whether or not \*(We will ever reach the \*(We.
.\" ----------------------------------------------------------------------
For these stupid tricks, \*(We needs \*(AM.
-.jBu
+.IP \(bu 3
With 3 or 4 \*(TDs visible, pick any window other than the last
and turn idle processes \*F using the 'i' \*(CT.
Depending on where you applied 'i', sometimes several \*(TDs are bouncing and
sometimes it's like an accordion, as \*(We tries his best to allocate space.
-.jBu
+.IP \(bu 3
Set each window's summary lines differently: one with no memory ('m'); another
with no states ('t'); maybe one with nothing at all, just the message line.
Then hold down 'a' or 'w' and watch a variation on bouncing windows \*(Em
hopping windows.
-.jBu
+.IP \(bu 3
Display all 4 windows and for each, in turn, set idle processes to \*F using
the 'i' \*(CT.
You've just entered the "extreme bounce" zone.
@@ -2202,7 +2202,7 @@ You've just entered the "extreme bounce" zone.
.\" ----------------------------------------------------------------------
This stupid trick also requires \*(AM.
-.jBu
+.IP \(bu 3
Display all 4 windows and make sure that 1:Def is the \*(CW.
Then, keep increasing window size with the 'n' \*(CI until all the other
\*(TDs are "pushed out of the nest".
@@ -2219,7 +2219,7 @@ Then ponder this:
This stupid trick works best without \*(AM, since justification is active
on a per window basis.
-.jBu
+.IP \(bu 3
Start \*(We and make COMMAND the last (rightmost) column displayed.
If necessary, use the 'c' \*(CT to display command lines and ensure
that forest view mode is active with the 'V' \*(CT.
--
1.7.9.2

View File

@ -1,614 +0,0 @@
From c9f7cc70251f9496c4dc908e26c273eb3a480e11 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Wed, 23 Apr 2014 00:00:02 -0500
Subject: [PATCH] top: minimize the usage of apostrophes in man document
In addition to eliminating numerous single quote usage
this commit also escaped '\' a few overlooked hyphens.
And some 'unformatted' spacings were adjusted as well.
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.1 | 216 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 109 insertions(+), 107 deletions(-)
diff --git top/top.1 top/top.1
index 644ae46..d5df21c 100644
--- top/top.1
+++ top/top.1
@@ -149,9 +149,9 @@ The remaining Table of Contents
.\" ......................................................................
.SS Operation
.\" ----------------------------------------------------------------------
-When operating \*(We, the two most important keys are the help ('h' or '?')
+When operating \*(We, the two most important keys are the help (h or ?)
key and quit ('q') key.
-Alternatively, you could simply use the traditional interrupt key ('^C')
+Alternatively, you could simply use the traditional interrupt key (^C)
when you're done.
When started for the first time, you'll be presented with these traditional
@@ -237,31 +237,31 @@ All are explained in detail in the sections that follow.
.nf
\fIGlobal-defaults\fR
- 'A' - Alt display Off (full-screen)
- * 'd' - Delay time 3.0 seconds
- * 'H' - Threads mode Off (summarize as tasks)
- 'I' - Irix mode On\ \ (no, 'solaris' smp)
- * 'p' - PID monitoring Off (show all processes)
- * 's' - Secure mode Off (unsecured)
- 'B' - Bold enable On\ \ (yes, bold globally)
+ A \- Alt display Off (full-screen)
+ * d \- Delay time 3.0 seconds
+ * H \- Threads mode Off (summarize as tasks)
+ I \- Irix mode On (no, 'solaris' smp)
+ * p \- PID monitoring Off (show all processes)
+ * s \- Secure mode Off (unsecured)
+ B \- Bold enable On (yes, bold globally)
\fISummary-Area-defaults\fR
- 'l' - Load Avg/Uptime On\ \ (thus program name)
- 't' - Task/Cpu states On\ \ (1+1 lines, see '1')
- 'm' - Mem/Swap usage On\ \ (2 lines worth)
- '1' - Single Cpu On\ \ (thus 1 line if smp)
+ l \- Load Avg/Uptime On (thus program name)
+ t \- Task/Cpu states On (1+1 lines, see '1')
+ m \- Mem/Swap usage On (2 lines worth)
+ 1 \- Single Cpu On (thus 1 line if smp)
\fITask-Area-defaults\fR
- 'b' - Bold hilite On\ \ (not 'reverse')
- * 'c' - Command line Off (name, not cmdline)
- * 'i' - Idle tasks On\ \ (show all tasks)
- 'J' - Num align right On\ \ (not left justify)
- 'j' - Str align right Off (not right justify)
- 'R' - Reverse sort On\ \ (pids high-to-low)
- * 'S' - Cumulative time Off (no, dead children)
- * 'u' - User filter Off (show euid only)
- * 'U' - User filter Off (show any uid)
- 'x' - Column hilite Off (no, sort field)
- 'y' - Row hilite On\ \ (yes, running tasks)
- 'z' - color/mono Off (no, colors)
+ b \- Bold hilite On (not 'reverse')
+ * c \- Command line Off (name, not cmdline)
+ * i \- Idle tasks On (show all tasks)
+ J \- Num align right On (not left justify)
+ j \- Str align right Off (not right justify)
+ R \- Reverse sort On (pids high-to-low)
+ * S \- Cumulative time Off (no, dead children)
+ * u \- User filter Off (show euid only)
+ * U \- User filter Off (show any uid)
+ x \- Column hilite Off (no, sort field)
+ y \- Row hilite On (yes, running tasks)
+ z \- color/mono Off (no, colors)
.fi
.\" ----------------------------------------------------------------------
@@ -271,7 +271,7 @@ The command-line syntax for \*(We consists of:
\*(CL
-The typically mandatory switches ('\-') and even whitespace are completely
+The typically mandatory switch ('\-') and even whitespace are completely
optional.
.TP 5
@@ -280,7 +280,7 @@ Show library version and the usage prompt, then quit.
.TP 5
\-\fBb\fR\ \ :\fIBatch-mode\fR operation \fR
-Starts \*(We in 'Batch' mode, which could be useful for sending output
+Starts \*(We in Batch mode, which could be useful for sending output
from \*(We to other programs or to a file.
In this mode, \*(We will not accept input and runs until the iterations
limit you've set with the '\-n' \*(CO or until killed.
@@ -300,8 +300,8 @@ Later this can be changed with the 'd' or 's' \*(CIs.
Fractional seconds are honored, but a negative number is not allowed.
In all cases, however, such changes are prohibited if \*(We is running
-in 'Secure mode', except for root (unless the 's' \*(CO was used).
-For additional information on 'Secure mode' \*(Xt 6a. SYSTEM Configuration File.
+in Secure mode, except for root (unless the 's' \*(CO was used).
+For additional information on Secure mode \*(Xt 6a. SYSTEM Configuration File.
.TP 5
\-\fBH\fR\ \ :\fIThreads-mode\fR operation \fR
@@ -365,7 +365,7 @@ This mode is far better controlled through the system \*(CF
.TP 5
\-\fBS\fR\ \ :\fICumulative-time\fR toggle \fR
Starts \*(We with the last remembered 'S' state reversed.
-When 'Cumulative time' mode is \*O, each process is listed with the \*(Pu
+When Cumulative time mode is \*O, each process is listed with the \*(Pu
time that it and its dead children have used.
\*(XC 'S' \*(CI for additional information regarding this mode.
@@ -382,7 +382,7 @@ The 'p', 'u' and 'U' \*(COs are mutually exclusive.
.TP 5
\-\fBw\fR\ \ :\fIOutput-width-override\fR as:\ \ \fB-w\fR [\fB number\fR ] \fR
-In 'Batch' mode, when used without an argument \*(We will format
+In Batch mode, when used without an argument \*(We will format
output using the COLUMNS= and LINES= environment variables, if set.
Otherwise, width will be fixed at the maximum \*(WX columns.
With an argument, output width can be decreased or increased (up to \*(WX)
@@ -392,10 +392,10 @@ In normal display mode, when used without an argument \*(We will\fI attempt\fR
to format output using the COLUMNS= and LINES= environment variables, if set.
With an argument, output width can only be decreased, not increased.
Whether using environment variables or an argument with \-w, when\fI not\fR
-in 'Batch' mode actual terminal dimensions can never be exceeded.
+in Batch mode actual terminal dimensions can never be exceeded.
\*(NT Without the use of this \*(CO, output width is always based on the
-terminal at which \*(We was invoked whether or not in 'Batch' mode.
+terminal at which \*(We was invoked whether or not in Batch mode.
.\" ----------------------------------------------------------------------
.SH 2. SUMMARY Display
@@ -500,10 +500,10 @@ In a true SMP environment, if a process is multi-threaded and \*(We is
reported.
You toggle Threads mode with the 'H' \*(CI.
-Also for multi-processor environments, if 'Irix mode' is \*F, \*(We
-will operate in 'Solaris mode' where a task's \*(Pu usage will be
+Also for multi-processor environments, if Irix mode is \*F, \*(We
+will operate in Solaris mode where a task's \*(Pu usage will be
divided by the total number of \*(PUs.
-You toggle 'Irix/Solaris' modes with the 'I' \*(CI.
+You toggle Irix/Solaris modes with the 'I' \*(CI.
.TP 4
2.\fB %MEM \*(Em Memory Usage (RES) \fR
@@ -523,7 +523,7 @@ Many different hierarchies of cgroups can exist simultaneously on a system
and each hierarchy is attached to one or more subsystems.
A subsystem represents a single resource.
-\*(NT The 'CGROUPS' field, unlike most columns, is not fixed-width.
+\*(NT The CGROUPS field, unlike most columns, is not fixed-width.
When displayed, it plus any other variable width columns will be allocated
all remaining screen width (up to the maximum \*(WX characters).
Even so, such variable width fields could still suffer truncation.
@@ -533,7 +533,7 @@ any truncated data.
.TP 4
4.\fB CODE \*(Em Code Size (KiB) \fR
The amount of \*(MP devoted to executable code, also known as
-the 'text resident set' size or TRS.
+the Text Resident Set size or TRS.
.TP 4
5.\fB COMMAND \*(Em Command\fB Name\fR or Command\fB Line \fR
@@ -547,10 +547,10 @@ line (like kernel threads) will be shown with only the program name in
brackets, as in this example:
\fR[kthreadd]
-This field may also be impacted by the 'forest view' display mode.
+This field may also be impacted by the forest view display mode.
\*(XC 'V' \*(CI for additional information regarding that mode.
-\*(NT The 'COMMAND' field, unlike most columns, is not fixed-width.
+\*(NT The COMMAND field, unlike most columns, is not fixed-width.
When displayed, it plus any other variable width columns will be allocated
all remaining screen width (up to the maximum \*(WX characters).
Even so, such variable width fields could still suffer truncation.
@@ -562,7 +562,7 @@ any truncated data.
.TP 4
6.\fB DATA \*(Em Data + Stack Size (KiB) \fR
The amount of \*(MP devoted to other than executable code, also known as
-the 'data resident set' size or DRS.
+the Data Resident Set size or DRS.
.TP 4
7.\fB ENVIRON \*(Em Environment variables \fR
@@ -571,7 +571,7 @@ respective processes.
These variables will be displayed in their raw native order, not the
sorted order you are accustomed to seeing with an unqualified 'set'.
-\*(NT The 'ENVIRON' field, unlike most columns, is not fixed-width.
+\*(NT The ENVIRON field, unlike most columns, is not fixed-width.
When displayed, it plus any other variable width columns will be allocated
all remaining screen width (up to the maximum \*(WX characters).
Even so, such variable width fields could still suffer truncation.
@@ -624,7 +624,7 @@ member of a process group, called the process group leader.
14.\fB PID \*(Em Process Id \fR
The task's unique process ID, which periodically wraps, though never
restarting at zero.
-In kernel terms, it is a dispatchable entity defined by a 'task_struct'.
+In kernel terms, it is a dispatchable entity defined by a task_struct.
This value may also be used as: a process group ID (\*(Xa PGRP);
a session ID for the session leader (\*(Xa SID);
@@ -639,7 +639,7 @@ The process ID (pid) of a task's parent.
16.\fB PR \*(Em Priority \fR
The scheduling priority of the task.
If you see 'rt' in this field, it means the task is running
-under 'real time' scheduling priority.
+under real time scheduling priority.
Under linux, real time priority is somewhat misleading since traditionally
the operating itself was not preemptible.
@@ -666,7 +666,7 @@ The status of the task which can be one of:
\fBT\fR = traced or stopped
\fBZ\fR = zombie
-Tasks shown as running should be more properly thought of as 'ready to run'
+Tasks shown as running should be more properly thought of as ready to run
\*(Em their task_struct is simply represented on the Linux run-queue.
Even without a true SMP machine, you may see numerous tasks in this state
depending on \*(We's delay interval and nice value.
@@ -697,7 +697,7 @@ The IDs of any supplementary group(s) established at login or
inherited from a task's parent.
They are displayed in a comma delimited list.
-\*(NT The 'SUPGIDS' field, unlike most columns, is not fixed-width.
+\*(NT The SUPGIDS field, unlike most columns, is not fixed-width.
When displayed, it plus any other variable width columns will be allocated
all remaining screen width (up to the maximum \*(WX characters).
Even so, such variable width fields could still suffer truncation.
@@ -710,7 +710,7 @@ The names of any supplementary group(s) established at login or
inherited from a task's parent.
They are displayed in a comma delimited list.
-\*(NT The 'SUPGRPS' field, unlike most columns, is not fixed-width.
+\*(NT The SUPGRPS field, unlike most columns, is not fixed-width.
When displayed, it plus any other variable width columns will be allocated
all remaining screen width (up to the maximum \*(WX characters).
Even so, such variable width fields could still suffer truncation.
@@ -729,19 +729,19 @@ The non-resident portion of a task's address space.
28.\fB TGID \*(Em Thread Group Id \fR
The ID of the thread group to which a task belongs.
It is the PID of the thread group leader.
-In kernel terms, it represents those tasks that share an 'mm_struct'.
+In kernel terms, it represents those tasks that share an mm_struct.
.TP 4
29.\fB TIME \*(Em \*(PU Time \fR
Total \*(PU time the task has used since it started.
-When 'Cumulative mode' is \*O, each process is listed with the \*(Pu
+When Cumulative mode is \*O, each process is listed with the \*(Pu
time that it and its dead children have used.
-You toggle 'Cumulative mode' with 'S', which is both a \*(CO and an \*(CI.
+You toggle Cumulative mode with 'S', which is both a \*(CO and an \*(CI.
\*(XC 'S' \*(CI for additional information regarding this mode.
.TP 4
30.\fB TIME+ \*(Em \*(PU Time, hundredths \fR
-The same as 'TIME', but reflecting more granularity through hundredths
+The same as TIME, but reflecting more granularity through hundredths
of a second.
.TP 4
@@ -780,7 +780,7 @@ swapped out and pages that have been mapped but not used.
.TP 4
37.\fB WCHAN \*(Em Sleeping in Function \fR
-Depending on the availability of the kernel link map ('System.map'), this
+Depending on the availability of the kernel link map (System.map), this
field will show the name or the address of the kernel function in which the
task is currently sleeping.
Running tasks will display a dash ('\-') in this column.
@@ -931,9 +931,9 @@ depending on the context in which they are issued.
Size: #, i, n
Sorting: <, >, f, F, R
4d.\fI Color-Mapping \fR
- <Ret>, a, B, b, H, M, q, S, T, w, z, 0 - 7
+ <Ret>, a, B, b, H, M, q, S, T, w, z, 0 \- 7
5b.\fI Commands-for-Windows \fR
- -, _, =, +, A, a, g, G, w
+ \-, _, =, +, A, a, g, G, w
5c.\fI Scrolling-a-Window \fR
C, Up, Dn, Left, Right, PgUp, PgDn, Home, End
5d.\fI Searching-in-a-Window \fR
@@ -945,7 +945,7 @@ depending on the context in which they are issued.
.\" ----------------------------------------------------------------------
The global \*(CIs are\fB always\fR available\fR in both \*(FM and \*(AM.
However, some of these \*(CIs are\fB not available\fR when running
-in 'Secure mode'.
+in Secure mode.
If you wish to know in advance whether or not your \*(We has been
secured, simply ask for help and view the system summary on the second
@@ -974,10 +974,10 @@ those \*(CIs applicable to \*(AM.
Removes restrictions on which tasks are shown.
This command will reverse any 'i' (idle tasks) and 'n' (max tasks)
commands that might be active.
-It also provides for an exit from pid monitoring, 'user' filtering
-and 'other' filtering.
+It also provides for an exit from PID monitoring, User filtering
+and Other filtering.
See the '\-p' \*(CO for a discussion of PID monitoring, the 'U' or 'u'
-\*(CIs for user filtering and the 'O' or 'o' \*(CIs for 'other' filtering.
+\*(CIs for User filtering and the 'O' or 'o' \*(CIs for Other filtering.
Additionally, any window that has been scrolled will be reset with
this command.
@@ -1000,7 +1000,7 @@ into \*(CWs and \*(FGs.
.TP 7
\ \ \ \fBB\fR\ \ :\fIBold-Disable/Enable\fR toggle \fR
-This command will influence use of the 'bold' terminfo capability and
+This command will influence use of the bold terminfo capability and
alters\fB both\fR the \*(SA and \*(TA for the \*(CW.
While it is intended primarily for use with dumb terminals, it can be
applied anytime.
@@ -1062,7 +1062,7 @@ Otherwise, \*(We displays a summation of all threads in each process.
.TP 7
\ \ \ \fBI\fR\ \ :\fIIrix/Solaris-Mode\fR toggle \fR
-When operating in 'Solaris mode' ('I' toggled \*F), a task's \*(Pu usage
+When operating in Solaris mode ('I' toggled \*F), a task's \*(Pu usage
will be divided by the total number of \*(PUs.
After issuing this command, you'll be told the new state of this toggle.
@@ -1167,13 +1167,13 @@ summarized here for future reference.
.nf
\fI key function \fR
- '=' alternate status\-line, file or pipeline
- '/' find, equivalent to 'L' locate
- 'n' find next, equivalent to '&' locate next
+ = alternate status\-line, file or pipeline
+ / find, equivalent to 'L' locate
+ n find next, equivalent to '&' locate next
<Space> scroll down, equivalent to <PgDn>
- 'b' scroll up, equivalent to <PgUp>
- 'g' first line, equivalent to <Home>
- 'G' last line, equivalent to <End>
+ b scroll up, equivalent to <PgUp>
+ g first line, equivalent to <Home>
+ G last line, equivalent to <End>
.fi
.TP 7
@@ -1183,7 +1183,7 @@ colors for the \*(CW, or for all windows.
For details regarding this \*(CI \*(Xt 4d. COLOR Mapping.
.IP "*" 3
-The commands shown with an \*(AK are not available in 'Secure mode',
+The commands shown with an \*(AK are not available in Secure mode,
nor will they be shown on the level-1 help screen.
.\" ......................................................................
@@ -1215,7 +1215,7 @@ of the '1', '2' or '3' \*(CTs and whether or not \*(We is running under
true SMP.
This portion of the \*(SA is also influenced by the 'H' \*(CI toggle,
-as reflected in the total label which shows either 'Tasks' or 'Threads'.
+as reflected in the total label which shows either Tasks or Threads.
.TP 7
\ \ \ \fBm\fR\ \ :\fIMemory/Swap-Usage\fR toggle \fR
@@ -1298,7 +1298,7 @@ The sort field might\fI not\fR be visible because:
1) there is insufficient\fI Screen Width \fR
2) the 'f' \*(CI turned it \*F
-\*(NT Whenever 'Searching' and/or 'Other Filtering' is active in a window,
+\*(NT Whenever Searching and/or Other Filtering is active in a window,
column highlighting is temporarily disabled.
\*(XC notes at the end of topics 5d. SEARCHING and 5e. FILTERING for an
explanation why.
@@ -1325,7 +1325,7 @@ the state of the 'x', 'y' or 'b' toggles.
.TP 7
\ \ \ \fBc\fR\ \ :\fICommand-Line/Program-Name\fR toggle \fR
-This command will be honored whether or not the 'COMMAND' column
+This command will be honored whether or not the COMMAND column
is currently visible.
Later, should that field come into view, the change you applied will be seen.
@@ -1348,7 +1348,7 @@ related \*(CIs.
.TP 7
\ \ \ \fBS\fR\ \ :\fICumulative-Time-Mode\fR toggle \fR
-When 'Cumulative mode' is \*O, each process is listed with the \*(Pu
+When Cumulative mode is \*O, each process is listed with the \*(Pu
time that it and its dead children have used.
When \*F, programs that fork into many separate tasks will appear
@@ -1359,13 +1359,13 @@ Experiment with two \*(TWs sharing the same sort field but with different 'S'
states and see which representation you prefer.
After issuing this command, you'll be informed of the new state of this toggle.
-If you wish to know in advance whether or not 'Cumulative mode' is in
+If you wish to know in advance whether or not Cumulative mode is in
effect, simply ask for help and view the window summary on the second line.
.TP 7
\ \ \ \fBu\fR | \fBU\fR\ \ :\fIShow-Specific-User-Only \fR
You will be prompted for the\fB uid\fR or\fB name\fR of the user to display.
-The '\-u' option matches on \fB effective\fR user whereas the '\-U' option
+The \-u option matches on \fB effective\fR user whereas the \-U option
matches on\fB any\fR user (real, effective, saved, or filesystem).
Thereafter, in that \*(TW only matching users will be shown, or possibly
@@ -1427,12 +1427,12 @@ For compatibility, this \*(We supports most of the former \*(We sort keys.
Since this is primarily a service to former \*(We users, these commands do
not appear on any help screen.
.nf
- \fI command sorted-field supported \fR
- A start time (non-display) \fB No \fR
- M %MEM Yes
- N PID Yes
- P %CPU Yes
- T TIME+ Yes
+ \fI command sorted-field supported \fR
+ A start time (non-display) \fB No \fR
+ M %MEM Yes
+ N PID Yes
+ P %CPU Yes
+ T TIME+ Yes
.fi
Before using any of the following sort provisions, \*(We suggests that you
@@ -1442,8 +1442,8 @@ That will help ensure that the actual sort environment matches your intent.
The following \*(CIs will\fB only\fR be honored when the current sort field
is\fB visible\fR.
The sort field might\fI not\fR be visible because:
- 1) there is insufficient\fI Screen Width \fR
- 2) the 'f' \*(CI turned it \*F
+ 1) there is insufficient\fI Screen Width \fR
+ 2) the 'f' \*(CI turned it \*F
.TP 7
\ \ \ \fB<\fR\ \ :\fIMove-Sort-Field-Left \fR
@@ -1488,13 +1488,13 @@ The following \*(CIs are available.
\fB4\fR upper case letters to select a\fB target \fR
\fB8\fR numbers to select a\fB color \fR
normal toggles available \fR
- 'B' :bold disable/enable
- 'b' :running tasks "bold"/reverse
- 'z' :color/mono
+ B :bold disable/enable
+ b :running tasks "bold"/reverse
+ z :color/mono
other commands available \fR
- 'a'/'w' :apply, then go to next/prior
+ a/w :apply, then go to next/prior
<Enter> :apply and exit
- 'q' :abandon current changes and exit
+ q :abandon current changes and exit
.fi
If you use 'a' or 'w' to cycle the targeted window, you will
@@ -1563,8 +1563,8 @@ as the only display element.
.TP 7
*\ \ \fB=\fR | \fB+\fR\ \ :\fIEqualize-(reinitialize)-Window(s) \fR
The '=' key forces the \*(CW's \*(TD to be visible.
-It also reverses any 'i' (idle tasks), 'n' (max tasks), 'u'/'U' (user filter)
-and 'o'/'O' (other filter) commands that might be active.
+It also reverses any 'i' (idle tasks), 'n' (max tasks), 'u/U' (user filter)
+and 'o/O' (other filter) commands that might be active.
Also, if the window had been scrolled, it will be reset with this command.
\*(XT 5c. SCROLLING a Window for additional information regarding vertical
and horizontal scrolling.
@@ -1572,8 +1572,8 @@ and horizontal scrolling.
The '+' key does the same for all windows.
The four \*(TDs will reappear, evenly balanced.
They will also have retained any customizations you had previously
-applied, except for the 'i' (idle tasks), 'n' (max tasks), 'u'/'U'
-(user filter), 'o'/'O' (other filter) and scrolling \*(CIs.
+applied, except for the 'i' (idle tasks), 'n' (max tasks), 'u/U'
+(user filter), 'o/O' (other filter) and scrolling \*(CIs.
.TP 7
*\ \ \fBA\fR\ \ :\fIAlternate-Display-Mode\fR toggle \fR
@@ -1587,7 +1587,7 @@ chosen to make visible.
*\ \ \fBa\fR | \fBw\fR\ \ :\fINext-Window-Forward/Backward \fR
This will change the \*(CW, which in turn changes the window to which
commands are directed.
-These keys act in a circular fashion so you can reach any desired \*(CW
+These keys act in a circular fashion so you can reach any desired window
using either key.
Assuming the window name is visible (you have not toggled 'l' \*F),
@@ -1612,9 +1612,9 @@ It does not require that the window name be visible
.IP "*" 3
The \*(CIs shown with an \*(AK have use beyond \*(AM.
.nf
- '=', 'A', 'g' are always available
- 'a', 'w' act the same with color mapping
- and fields management
+ =, A, g are always available
+ a, w act the same with color mapping
+ and fields management
.fi
.\" ......................................................................
@@ -1765,15 +1765,16 @@ could yet produce a successful '&' search.
The above \*(CIs are\fB always\fR available in \*(FM but\fB never\fR
available in \*(AM if the \*(CW's \*(TD has been toggled \*F.
-\*(NT Whenever a search key is typed, \*(We will turn column highlighting
-\*F to prevent false matches on internal non-display escape sequences.
+\*(NT Whenever a Search is active in a window, \*(We will turn
+column highlighting \*F to prevent false matches on internal non-display
+escape sequences.
Such highlighting will be restored when a window's search string is empty.
\*(XC 'x' \*(CI for additional information on sort column highlighting.
.\" ......................................................................
.SS 5e. FILTERING in a Window
.\" ----------------------------------------------------------------------
-You can use the 'Other Filter' feature to establish selection criteria which
+You can use this Other Filter feature to establish selection criteria which
will then determine which tasks are shown in the \*(CW.
Establishing a filter requires: 1) a field name; 2) an operator; and
@@ -1865,7 +1866,7 @@ When some field's numeric amounts have been subjected to \fIscaling\fR
while others have not, that data is no longer homogeneous.
If you establish a relational filter and you \fBhave\fR changed the
-default 'Numeric' or 'Character' \fIjustification\fR, that filter is likely to fail.
+default Numeric or Character \fIjustification\fR, that filter is likely to fail.
When a relational filter is applied to a memory field and you \fBhave not\fR
changed the \fIscaling\fR, it may produce misleading results.
This happens, for example, because '100.0m' (MiB) would appear greater
@@ -1908,7 +1909,7 @@ So while amounts greater than 9999 exist, they will appear as 2.6m, 197k, etc.
.B Potential Solutions
.RS +3
.P
-These examples illustrate how 'Other Filtering' can be creatively
+These examples illustrate how Other Filtering can be creatively
applied to achieve almost any desired result.
Single quotes are sometimes shown to delimit the spaces which are part of
a filter or to represent a request for status (^O) accurately.
@@ -1941,8 +1942,9 @@ achieve the failed '9999' objective discussed above.
.fi
.RS -3
-\*(NT When 'Other Filtering' is active, \*(We turns column highlighting
-\*F to prevent false matches on internal non-display escape sequences.
+\*(NT Whenever Other Filtering is active in a window, \*(We will turn
+column highlighting \*F to prevent false matches on internal non-display
+escape sequences.
Such highlighting will be restored when a window is no longer subject
to filtering.
\*(XC 'x' \*(CI for additional information on sort column highlighting.
@@ -1954,7 +1956,7 @@ to filtering.
.\" ......................................................................
.SS 6a. SYSTEM Configuration File
.\" ----------------------------------------------------------------------
-The presence of this file will influence which version of the 'help' screen
+The presence of this file will influence which version of the help screen
is shown to an ordinary user.
More importantly, it will limit what ordinary users are allowed
to do when \*(We is running.
@@ -1973,8 +1975,8 @@ It must have only two lines.
Here is an example of the contents of\fI /etc/toprc\fR:
.nf
- s # line 1: 'secure' mode switch
- 5.0 # line 2: 'delay'\ \ interval in seconds
+ s # line 1: secure mode switch
+ 5.0 # line 2: delay interval in seconds
.fi
.\" ......................................................................
@@ -1992,7 +1994,7 @@ Here is the general layout:
" # line c: summclr,msgsclr,headclr,taskclr
global # line 15: width, memory scaling & zeroes overrides
" # any remaining lines are devoted to the
- " # generalized 'inspect' provisions
+ " # generalized inspect provisions
" # discussed below
.fi
@@ -2087,7 +2089,7 @@ If you want a truer representation, any embedded tabs should be expanded.
# next would have contained '\\t' ...
# file ^I <your_name> ^I /proc/%d/status
# but this will eliminate embedded '\\t' ...
- pipe ^I <your_name> ^I cat /proc/%d/status | expand -
+ pipe ^I <your_name> ^I cat /proc/%d/status | expand \-
.fi
The above example takes what could have been a 'file' entry but employs
@@ -2121,7 +2123,7 @@ In that way, many more choices can be made visible.
.\" ----------------------------------------------------------------------
.SH 7. STUPID TRICKS Sampler
.\" ----------------------------------------------------------------------
-Many of these 'tricks' work best when you give \*(We a scheduling boost.
+Many of these tricks work best when you give \*(We a scheduling boost.
So plan on starting him with a nice value of \-10, assuming you've got
the authority.
--
1.7.9.2

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +0,0 @@
From ada443268e7f8c4526e6b048c98457679665b727 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Wed, 23 Apr 2014 00:00:04 -0500
Subject: [PATCH] misc: fix man doc spelling and grammar for translation
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
ps/ps.1 | 2 +-
sysctl.8 | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git ps/ps.1 ps/ps.1
index cdb7536..90f12ac 100644
--- ps/ps.1
+++ ps/ps.1
@@ -1683,7 +1683,7 @@ number of kernel threads owned by the process.
T}
tid TID T{
-the unique number representing a dispatacable entity (alias
+the unique number representing a dispatchable entity (alias
.BR lwp , \ spid ).
This value may also appear as: a process ID (pid); a process group ID (pgrp);
a session ID for the session leader (sid); a thread group ID for the thread
diff --git sysctl.8 sysctl.8
index faf2255..a74b2d7 100644
--- sysctl.8
+++ sysctl.8
@@ -63,8 +63,8 @@ Load in sysctl settings from the file specified or /etc/sysctl.conf if none
given. Specifying \- as filename means reading data from standard input.
Using this option will mean arguments to
.B sysctl
-are files, which are read in order they are specified. The file argument can
-may be specified as reqular expression.
+are files, which are read in the order they are specified.
+The file argument may be specified as reqular expression.
.TP
\fB\-a\fR, \fB\-\-all\fR
Display all values currently available.
@@ -112,10 +112,10 @@ Alias of \fB\-p\fR
Alias of \fB\-a\fR
.TP
\fB\-o\fR
-Does nothing in favour of BSD compatibility.
+Does nothing, exists for BSD compatibility.
.TP
\fB\-x\fR
-Does nothing in favour of BSD compatibility.
+Does nothing, exists for BSD compatibility.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
--
1.7.9.2

View File

@ -1,62 +0,0 @@
Based on 2f96eef7f86a12b81badef1c91ec2d503ae4029d Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Wed, 30 Apr 2014 13:59:34 +0200
Subject: [PATCH] library: reverting tmpfs subtraction from cached
(18-FEB-2014)
The subtraction was marked as reinforcing the misconception,
that memory in the page cache can be considered free.
The Cached value is not a sum of page cache and tmpfs,
as the tmpfs memory lives in the page cache and therefore
it's an inseparable part of it.
---
free.1 | 4 +---
proc/sysinfo.c | 2 --
vmstat.8 | 3 +--
3 files changed, 2 insertions(+), 7 deletions(-)
diff --git free.1 free.1
index 21cce28..85efef8 100644
--- free.1
+++ free.1
@@ -32,9 +32,7 @@ kernels 2.6.32, displayed as zero if not available)
Memory used by kernel buffers (Buffers in /proc/meminfo)
.TP
\fBcached\fR
-Memory used by the page cache (calculated as Cached - Shmem in
-/proc/meminfo - the Cached value is actually the sum of page cache and
-tmpfs memory)
+Memory used by the page cache (Cached in /proc/meminfo)
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-bytes\fR
diff --git proc/sysinfo.c proc/sysinfo.c
index e07ca86..85fb0a4 100644
--- proc/sysinfo.c
+++ proc/sysinfo.c
@@ -695,8 +695,6 @@ nextline:
}
if ((ev=getenv("PS_FULL_CACHE")))
kb_main_cached += kb_swap_reclaimable + kb_swap_cached + kb_nfs_unstable;
- /* "Cached" includes "Shmem" - we want only the page cache here */
- kb_main_cached -= kb_main_shared;
}
/*****************************************************************/
diff --git vmstat.8 vmstat.8
index 2782a42..420d9f3 100644
--- vmstat.8
+++ vmstat.8
@@ -102,8 +102,7 @@ b: The number of processes in uninterruptible sleep.
swpd: the amount of virtual memory used.
free: the amount of idle memory.
buff: the amount of memory used as buffers.
-cache: the amount of memory used as cache (excluding tmpfs memory for
-kernels 2.6.32+)
+cache: the amount of memory used as cache.
inact: the amount of inactive memory. (\-a option)
active: the amount of active memory. (\-a option)
.fi
--
1.7.9.2

View File

@ -1,53 +0,0 @@
From 444fa7102b7f130734e35b45ce86fcc15d307a71 Mon Sep 17 00:00:00 2001
From: Jim Warner <james.warner@comcast.net>
Date: Wed, 7 May 2014 00:00:00 -0500
Subject: [PATCH] top: miscellaneous accumulated changes to man document
Signed-off-by: Jim Warner <james.warner@comcast.net>
---
top/top.1 | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git top/top.1 top/top.1
index 67b8b35..5ce405e 100644
--- top/top.1
+++ top/top.1
@@ -1062,7 +1062,7 @@ Otherwise, \*(We displays a summation of all threads in each process.
.TP 7
\ \ \ \fBI\fR\ \ :\fIIrix/Solaris-Mode\fR toggle \fR
-When operating in Solaris mode ('I' toggled \*F), a task's \*(Pu usage
+When operating in Solaris mode (`I' toggled \*F), a task's \*(Pu usage
will be divided by the total number of \*(PUs.
After issuing this command, you'll be told the new state of this toggle.
@@ -1216,7 +1216,7 @@ This command affects from 2 to many \*(SA lines, depending on the state
of the `1', `2' or `3' \*(CTs and whether or not \*(We is running under
true SMP.
-This portion of the \*(SA is also influenced by the 'H' \*(CI toggle,
+This portion of the \*(SA is also influenced by the `H' \*(CI toggle,
as reflected in the total label which shows either Tasks or Threads.
.TP 7
@@ -1856,7 +1856,7 @@ These examples use spaces for clarity but your input generally would not.
Items #1, #3 and #4 should be self\-explanatory.
Item \fB#2\fR represents both a required \fIdelimiter\fR and the \fIoperator\fR
-which must be one of either equality ('=') or relation ('<' or `>').
+which must be one of either equality (`=') or relation (`<' or `>').
The `=' equality operator requires only a partial match and that
can reduce your `if\-value' input requirements.
@@ -2229,7 +2229,7 @@ If necessary, use the `c' \*(CT to display command lines and ensure
that forest view mode is active with the `V' \*(CT.
Then use the up/down arrow keys to position the display so that some
-truncated command lines are shown ('+' in last position).
+truncated command lines are shown (`+' in last position).
You may have to resize your xterm to produce truncation.
Lastly, use the `j' \*(CT to make the COMMAND column right justified.
--
1.7.9.2

View File

@ -1,157 +0,0 @@
pgrep.c | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git pgrep.c pgrep.c
index d8d3dcb..3ba3634 100644
--- pgrep.c
+++ pgrep.c
@@ -106,6 +106,7 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
if (i_am_pkill == 0) {
fputs(_(" -d, --delimiter <string> specify output delimiter\n"),fp);
fputs(_(" -l, --list-name list PID and process name\n"),fp);
+ fputs(_(" -a, --list-full list PID and full command line\n"),fp);
fputs(_(" -v, --inverse negates the matching\n"),fp);
fputs(_(" -w, --lightweight list all TID\n"), fp);
}
@@ -137,7 +138,7 @@ static int __attribute__ ((__noreturn__)) usage(int opt)
fputs(USAGE_VERSION, fp);
fprintf(fp, USAGE_MAN_TAIL("pgrep(1)"));
- exit(fp == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
+ exit(fp == stderr ? EXIT_USAGE : EXIT_SUCCESS);
}
static struct el *split_list (const char *restrict str, int (*convert)(const char *, struct el *))
@@ -628,7 +629,7 @@ static struct el * select_procs (int *num)
if (list == NULL)
exit (EXIT_FATAL);
}
- if (opt_long) {
+ if (opt_long || opt_longlong) {
list[matches].str = xstrdup (cmdoutput);
list[matches++].num = subtask.XXXID;
} else {
@@ -747,7 +748,7 @@ static void parse_opts (int argc, char **argv)
case 'G': /* Solaris: match rgid/rgroup */
opt_rgid = split_list (optarg, conv_gid);
if (opt_rgid == NULL)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
/* case 'I': / * FreeBSD: require confirmation before killing * /
@@ -764,7 +765,7 @@ static void parse_opts (int argc, char **argv)
case 'P': /* Solaris: match by PPID */
opt_ppid = split_list (optarg, conv_num);
if (opt_ppid == NULL)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
/* case 'S': / * FreeBSD: don't ignore the built-in kernel tasks * /
@@ -774,7 +775,7 @@ static void parse_opts (int argc, char **argv)
case 'U': /* Solaris: match by ruid/rgroup */
opt_ruid = split_list (optarg, conv_uid);
if (opt_ruid == NULL)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
case 'V':
@@ -794,7 +795,7 @@ static void parse_opts (int argc, char **argv)
case 'g': /* Solaris: match pgrp */
opt_pgrp = split_list (optarg, conv_pgrp);
if (opt_pgrp == NULL)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
/* case 'i': / * FreeBSD: ignore case. OpenBSD: withdrawn. See -I. This sucks. * /
@@ -812,37 +813,37 @@ static void parse_opts (int argc, char **argv)
break;
case 'n': /* Solaris: match only the newest */
if (opt_oldest|opt_negate|opt_newest)
- usage (opt);
+ usage ('?');
opt_newest = 1;
++criteria_count;
break;
case 'o': /* Solaris: match only the oldest */
if (opt_oldest|opt_negate|opt_newest)
- usage (opt);
+ usage ('?');
opt_oldest = 1;
++criteria_count;
break;
case 's': /* Solaris: match by session ID -- zero means self */
opt_sid = split_list (optarg, conv_sid);
if (opt_sid == NULL)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
case 't': /* Solaris: match by tty */
opt_term = split_list (optarg, conv_str);
if (opt_term == NULL)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
case 'u': /* Solaris: match by euid/egroup */
opt_euid = split_list (optarg, conv_uid);
if (opt_euid == NULL)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
case 'v': /* Solaris: as in grep, invert the matching (uh... applied after selection I think) */
if (opt_oldest|opt_negate|opt_newest)
- usage (opt);
+ usage ('?');
opt_negate = 1;
break;
case 'w': // Linux: show threads (lightweight process) too
@@ -857,25 +858,23 @@ static void parse_opts (int argc, char **argv)
case NS_OPTION:
opt_ns_pid = atoi(optarg);
if (opt_ns_pid == 0)
- usage (opt);
+ usage ('?');
++criteria_count;
break;
case NSLIST_OPTION:
opt_nslist = split_list (optarg, conv_ns);
if (opt_nslist == NULL)
- usage (opt);
+ usage ('?');
break;
case 'h':
- usage (opt);
- break;
case '?':
- usage (optopt ? optopt : opt);
+ usage (opt);
break;
}
}
if(opt_lock && !opt_pidfile)
- xerrx(EXIT_FAILURE, _("-L without -F makes no sense\n"
+ xerrx(EXIT_USAGE, _("-L without -F makes no sense\n"
"Try `%s --help' for more information."),
program_invocation_short_name);
@@ -890,11 +889,11 @@ static void parse_opts (int argc, char **argv)
if (argc - optind == 1)
opt_pattern = argv[optind];
else if (argc - optind > 1)
- xerrx(EXIT_FAILURE, _("only one pattern can be provided\n"
+ xerrx(EXIT_USAGE, _("only one pattern can be provided\n"
"Try `%s --help' for more information."),
program_invocation_short_name);
else if (criteria_count == 0)
- xerrx(EXIT_FAILURE, _("no matching criteria specified\n"
+ xerrx(EXIT_USAGE, _("no matching criteria specified\n"
"Try `%s --help' for more information."),
program_invocation_short_name);
}

View File

@ -1,6 +1,6 @@
--- proc/libprocps.sym
+++ proc/libprocps.sym 2014-05-16 10:01:38.446310070 +0000
@@ -57,6 +57,7 @@ global:
+++ proc/libprocps.sym 2014-05-16 10:01:38.000000000 +0000
@@ -59,6 +59,7 @@ global:
signal_name_to_number;
signal_number_to_name;
smp_num_cpus;
@ -9,18 +9,18 @@
strtosig;
tty_to_dev;
--- proc/sysinfo.c
+++ proc/sysinfo.c 2013-05-29 11:26:47.797640941 +0000
+++ proc/sysinfo.c 2015-01-27 15:17:46.241518734 +0000
@@ -37,7 +37,8 @@
#include <netinet/in.h> /* htons */
#endif
-long smp_num_cpus; /* number of CPUs */
+#undef smp_num_cpus
+long smp_num_cpus = -1; /* number of CPUs */
+long smp_num_cpus=-1; /* number of CPUs */
long page_bytes; /* this architecture's page size */
#define BAD_OPEN_MESSAGE \
"Error: /proc must be mounted\n" \
@@ -1012,7 +1012,11 @@ out:
@@ -1069,7 +1070,11 @@ out:
///////////////////////////////////////////////////////////////////////////
@ -33,30 +33,23 @@
// ought to count CPUs in /proc/stat instead of relying
// on glibc, which foolishly tries to parse /proc/cpuinfo
// note: that may have been the case but now /proc/stat
@@ -1024,7 +1029,11 @@ void cpuinfo (void) {
// _SC_NPROCESSORS_CONF returns 2, resulting in HZ=512
// _SC_NPROCESSORS_ONLN returns 1, which should work OK
- smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
- if (smp_num_cpus<1) /* SPARC glibc is buggy */
- smp_num_cpus=1;
+ smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
+ if (smp_num_cpus<1) /* SPARC glibc is buggy */
+ smp_num_cpus=1;
@@ -1084,4 +1089,8 @@ void cpuinfo (void) {
smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
if (smp_num_cpus<1) /* SPARC glibc is buggy */
smp_num_cpus=1;
+
+ return smp_num_cpus;
}
+
+void cpuinfo (void) { (void)__smp_num_cpus(); }
--- proc/sysinfo.h
+++ proc/sysinfo.h 2012-06-04 10:04:15.812509959 +0000
@@ -7,7 +7,8 @@
EXTERN_C_BEGIN
+++ proc/sysinfo.h 2015-01-27 15:18:35.169518781 +0000
@@ -8,6 +8,8 @@ EXTERN_C_BEGIN
extern unsigned long long Hertz; /* clock tick frequency */
-extern long smp_num_cpus; /* number of CPUs */
+extern long __smp_num_cpus(void); /* number of CPUs */
extern long smp_num_cpus; /* number of CPUs */
+extern long __smp_num_cpus(void);
+#define smp_num_cpus __smp_num_cpus()
extern int have_privs; /* boolean, true if setuid or similar */
extern long page_bytes; /* this architecture's bytes per page */
#if 0

View File

@ -10,8 +10,8 @@ and this causes a problem later on (bsc#908516)
1 file changed, 6 insertions(+)
--- free.c
+++ free.c 2015-01-23 15:30:56.433518424 +0000
@@ -189,6 +189,7 @@ int main(int argc, char **argv)
+++ free.c 2015-01-27 15:28:08.494018768 +0000
@@ -190,6 +190,7 @@ int main(int argc, char **argv)
int c, flags = 0;
char *endptr;
struct commandline_arguments args;
@ -19,7 +19,7 @@ and this causes a problem later on (bsc#908516)
/*
* For long options that have no equivalent short option, use a
@@ -227,10 +228,12 @@ int main(int argc, char **argv)
@@ -228,10 +229,12 @@ int main(int argc, char **argv)
#ifdef HAVE_PROGRAM_INVOCATION_NAME
program_invocation_name = program_invocation_short_name;
#endif
@ -30,9 +30,9 @@ and this causes a problem later on (bsc#908516)
atexit(close_stdout);
+ errno = errsv;
while ((c = getopt_long(argc, argv, "bkmghlotCc:s:V", longopts, NULL)) != -1)
while ((c = getopt_long(argc, argv, "bkmghltCc:ws:V", longopts, NULL)) != -1)
switch (c) {
@@ -266,12 +269,15 @@ int main(int argc, char **argv)
@@ -264,12 +267,15 @@ int main(int argc, char **argv)
break;
case 's':
flags |= FREE_REPEAT;

View File

@ -1,17 +1,14 @@
--- vmstat.c
+++ vmstat.c 2012-06-01 15:57:49.952010091 +0000
@@ -41,9 +41,9 @@
#include <sys/dir.h>
+++ vmstat.c 2015-01-27 14:59:34.049571755 +0000
@@ -40,6 +40,7 @@
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <termios.h>
#include <unistd.h>
-
#include "c.h"
#include "fileutils.h"
#include "nls.h"
@@ -545,13 +545,12 @@ static void slabheader(void)
#include <time.h>
@@ -690,13 +691,12 @@ static void slabheader(void)
static void slabformat(void)
{
@ -27,7 +24,7 @@
xwarnx(_("your kernel does not support slabinfo or your permissions are insufficient"));
return;
}
@@ -583,7 +582,6 @@ static void slabformat(void)
@@ -728,7 +728,6 @@ static void slabformat(void)
}
free(slabs);
}

View File

@ -0,0 +1,52 @@
--- proc/sysinfo.c
+++ proc/sysinfo.c 2015-01-27 15:04:57.337518882 +0000
@@ -708,8 +708,14 @@ nextline:
kb_main_cached = kb_page_cache + kb_slab;
if ((ev=getenv("PS_FULL_CACHE")))
kb_main_cached += kb_slab_reclaimable + kb_swap_cached + kb_nfs_unstable;
- kb_swap_used = kb_swap_total - kb_swap_free;
- kb_main_used = kb_main_total - kb_main_free - kb_main_cached - kb_main_buffers;
+ if (kb_swap_total > kb_swap_free)
+ kb_swap_used = kb_swap_total - kb_swap_free;
+ else
+ kb_swap_used = 0;
+ if (kb_main_total > kb_main_free + kb_main_cached + kb_main_buffers)
+ kb_main_used = kb_main_total - kb_main_free - kb_main_cached - kb_main_buffers;
+ else
+ kb_main_used = 0;
/* zero? might need fallback for 2.6.27 <= kernel <? 3.14 */
if (!kb_main_available) {
--- free.c
+++ free.c 2015-01-27 15:07:36.725518136 +0000
@@ -327,15 +327,28 @@ int main(int argc, char **argv)
* to print the high info, even if it is zero.
*/
if (flags & FREE_LOHI) {
+ unsigned long kb_low_used;
+ unsigned long kb_high_used;
+
+ if (kb_low_total > kb_low_free)
+ kb_low_used = kb_low_total - kb_low_free;
+ else
+ kb_low_used = 0;
+
+ if (kb_high_total > kb_high_free)
+ kb_high_used = kb_high_total - kb_high_free;
+ else
+ kb_high_used = 0;
+
printf("%-7s", _("Low:"));
printf(" %11s", scale_size(kb_low_total, flags, args));
- printf(" %11s", scale_size(kb_low_total - kb_low_free, flags, args));
+ printf(" %11s", scale_size(kb_low_used, flags, args));
printf(" %11s", scale_size(kb_low_free, flags, args));
printf("\n");
printf("%-7s", _("High:"));
printf(" %11s", scale_size(kb_high_total, flags, args));
- printf(" %11s", scale_size(kb_high_total - kb_high_free, flags, args));
+ printf(" %11s", scale_size(kb_high_used, flags, args));
printf(" %11s", scale_size(kb_high_free, flags, args));
printf("\n");
}

View File

@ -1,40 +1,39 @@
--- top/top.c
+++ top/top.c 2012-10-30 11:34:42.634844811 +0000
@@ -1910,8 +1910,15 @@ static void zap_fieldstab (void) {
Fieldstab[P_CPU].width = 5;
+++ top/top.c 2015-01-27 15:25:34.329519296 +0000
@@ -2302,8 +2302,15 @@ static void zap_fieldstab (void) {
Fieldstab[EU_CPU].width = 5;
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
Cpu_pmax = 100.0 * smp_num_cpus;
- if (smp_num_cpus > 10) {
+ if (smp_num_cpus > 1000) {
+ if (Cpu_pmax > 9999999.0) Cpu_pmax = 9999999.0;
+ Fieldstab[P_CPU].width = 8;
+ Fieldstab[EU_CPU].width = 8;
+ } else if (smp_num_cpus > 100) {
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
+ Fieldstab[P_CPU].width = 7;
+ Fieldstab[EU_CPU].width = 7;
+ } else if (smp_num_cpus > 10) {
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
+ Fieldstab[P_CPU].width = 6;
+ Fieldstab[EU_CPU].width = 6;
} else {
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
}
@@ -1921,12 +1928,18 @@ static void zap_fieldstab (void) {
Fieldstab[P_CPU].width = 4;
@@ -2313,12 +2320,18 @@ static void zap_fieldstab (void) {
Fieldstab[EU_CPU].width = 4;
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
Cpu_pmax = 100.0 * smp_num_cpus;
- if (smp_num_cpus > 10) {
+ if (smp_num_cpus > 1000) {
+ if (Cpu_pmax > 9999999.0) Cpu_pmax = 9999999.0;
+ Fieldstab[P_CPU].width = 7;
+ Fieldstab[EU_CPU].width = 7;
+ } else if (smp_num_cpus > 100) {
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
+ Fieldstab[P_CPU].width = 6;
+ } else if (smp_num_cpus > 10) {
+ Fieldstab[EU_CPU].width = 6;
if (smp_num_cpus > 10) {
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
+ Fieldstab[P_CPU].width = 5;
+ Fieldstab[EU_CPU].width = 5;
} else {
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;
}
- Fieldstab[P_CPU].width = 5;
- Fieldstab[EU_CPU].width = 5;
}
#endif

117
procps-ng-3.3.10-slab.patch Normal file
View File

@ -0,0 +1,117 @@
---
free.1 | 7 +++++++
free.c | 7 ++++++-
proc/sysinfo.c | 4 ++++
proc/sysinfo.h | 5 +++++
vmstat.c | 6 +++++-
5 files changed, 27 insertions(+), 2 deletions(-)
--- free.1
+++ free.1 2015-01-27 14:38:35.233518879 +0000
@@ -82,6 +82,13 @@ 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,
+the \fBSReclaimable\fR as part of \fISlab\fR, that might be reclaimed, such as caches,
+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 2015-01-27 14:43:17.341678624 +0000
@@ -84,6 +84,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -t, --total show total for RAM + swap\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);
@@ -212,6 +213,7 @@ int main(int argc, char **argv)
{ "total", no_argument, NULL, 't' },
{ "seconds", required_argument, NULL, 's' },
{ "count", required_argument, NULL, 'c' },
+ { "full-cache",required_argument, NULL, HELP_OPTION },
{ "wide", no_argument, NULL, 'w' },
{ "help", no_argument, NULL, HELP_OPTION },
{ "version", no_argument, NULL, 'V' },
@@ -231,7 +233,7 @@ int main(int argc, char **argv)
textdomain(PACKAGE);
atexit(close_stdout);
- while ((c = getopt_long(argc, argv, "bkmghltc:ws:V", longopts, NULL)) != -1)
+ while ((c = getopt_long(argc, argv, "bkmghltCc:ws:V", longopts, NULL)) != -1)
switch (c) {
case 'b':
args.exponent = 1;
@@ -281,6 +283,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/sysinfo.c
+++ proc/sysinfo.c 2015-01-27 14:45:59.665518819 +0000
@@ -3,6 +3,7 @@
* Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
* Copyright 1998-2003 Albert Cahalan
* June 2003, Fabian Frederick, disk and slab info
+ * 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
@@ -625,6 +626,7 @@ void meminfo(void){
char namebuf[32]; /* big enough to hold any row name */
mem_table_struct findme = { namebuf, NULL};
mem_table_struct *found;
+ const char *ev;
char *head;
char *tail;
static const mem_table_struct mem_table[] = {
@@ -704,6 +706,8 @@ nextline:
kb_inactive = kb_inact_dirty + kb_inact_clean + kb_inact_laundry;
}
kb_main_cached = kb_page_cache + kb_slab;
+ if ((ev=getenv("PS_FULL_CACHE")))
+ kb_main_cached += kb_slab_reclaimable + kb_swap_cached + kb_nfs_unstable;
kb_swap_used = kb_swap_total - kb_swap_free;
kb_main_used = kb_main_total - kb_main_free - kb_main_cached - kb_main_buffers;
--- vmstat.c
+++ vmstat.c 2015-01-27 14:51:23.801518151 +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);
@@ -881,7 +882,7 @@ int main(int argc, char *argv[])
atexit(close_stdout);
while ((c =
- getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts,
+ getopt_long(argc, argv, "aCfmnsdDp:S:wthV", longopts,
NULL)) != EOF)
switch (c) {
case 'V':
@@ -950,6 +951,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);

View File

@ -1,15 +1,15 @@
--- vmstat.c
+++ vmstat.c 2012-06-01 15:54:39.388411889 +0000
@@ -244,7 +244,7 @@ static void new_format(void)
+++ vmstat.c 2015-01-27 14:57:19.467491788 +0000
@@ -292,7 +292,7 @@ static void new_format(void)
unsigned int intr[2], ctxt[2];
unsigned int sleep_half;
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
- int debt = 0; /* handle idle ticks running backwards */
+ long long debt = 0; /* handle idle ticks running backwards */
sleep_half = (sleep_time / 2);
new_header();
@@ -305,12 +306,12 @@ static void new_format(void)
struct tm *tm_ptr;
time_t the_time;
char timebuf[32];
@@ -375,12 +375,12 @@ static void new_format(void)
/* idle can run backwards for a moment -- kernel "feature" */
if (debt) {

3
procps-ng-3.3.10.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a02e6f98974dfceab79884df902ca3df30b0e9bad6d76aee0fb5dce17f267f04
size 819880

View File

@ -1,49 +0,0 @@
--- ps/Makefile.am
+++ ps/Makefile.am 2013-05-29 11:00:12.549939319 +0000
@@ -3,7 +3,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-DLOCALEDIR=\"$(localedir)\"
-AM_LDFLAGS = ../proc/libprocps.la
+AM_LDFLAGS = ../proc/libprocps.la -ldl
if WITH_SYSTEMD
AM_LDFLAGS += @SYSTEMD_LIBS@
--- ps/parser.c
+++ ps/parser.c 2013-05-29 10:57:34.177440830 +0000
@@ -238,7 +238,7 @@ static const char *parse_sysv_option(voi
// In the meantime, please do not add to it. The list is
// intended to ONLY contain flags defined by the POSIX and UNIX
// standards published by The Open Group, IEEE, and ISO.
- if(!strchr("aAdefgGlnoptuU", *flagptr)) not_pure_unix = 1; // dude, -Z ain't in POSIX
+ if(!strchr("aAdefgGlnoptuUZ", *flagptr)) not_pure_unix = 1; // dude, -Z ain't in POSIX
switch(*flagptr){
case 'A':
--- ps/ps.1
+++ ps/ps.1 2012-06-01 15:22:45.268010363 +0000
@@ -423,6 +423,9 @@ option, which
.B \-F
implies.
.TP
+.BI \-Z
+display security context format (SELinux, etc.)
+.TP
.BI \-\-format \ format
user\-defined format. Identical to
.B \-o
--- w.c
+++ w.c 2013-05-29 10:57:34.349888215 +0000
@@ -356,6 +356,12 @@ static const proc_t *getproc(const utmp_
continue;
best = tmp;
}
+ /*
+ * It is there but SELinux wouldn't allow us to know the detail. Really
+ * w should just be given rights
+ */
+ if(!kill(u->ut_pid, 0) || errno != ESRCH)
+ *found_utpid = 1;
return best ? best : secondbest;
}

View File

@ -1,11 +0,0 @@
--- proc/sysinfo.c
+++ proc/sysinfo.c 2012-06-01 14:33:02.936510627 +0000
@@ -56,7 +56,7 @@ static int vminfo_fd = -1;
// As of 2.6.24 /proc/meminfo seems to need 888 on 64-bit,
// and would need 1258 if the obsolete fields were there.
-static char buf[2048];
+static char buf[4096];
/* This macro opens filename only if necessary and seeks to 0 so
* that successive calls to the functions are more efficient.

View File

@ -1,71 +0,0 @@
--- proc/sysinfo.c
+++ proc/sysinfo.c 2015-01-23 15:28:10.965520879 +0000
@@ -684,8 +684,16 @@ nextline:
if(kb_inactive==~0UL){
kb_inactive = kb_inact_dirty + kb_inact_clean + kb_inact_laundry;
}
- kb_swap_used = kb_swap_total - kb_swap_free;
- kb_main_used = kb_main_total - kb_main_free;
+ if (kb_swap_total > kb_swap_free) {
+ kb_swap_used = kb_swap_total - kb_swap_free;
+ } else {
+ kb_swap_used = 0;
+ }
+ if (kb_main_total > kb_main_free) {
+ kb_main_used = kb_main_total - kb_main_free;
+ } else {
+ kb_main_used = 0;
+ }
if ((ev=getenv("PS_FULL_CACHE")))
kb_main_cached += kb_swap_reclaimable + kb_swap_cached + kb_nfs_unstable;
}
--- free.c
+++ free.c 2012-06-04 09:50:26.588010539 +0000
@@ -310,24 +310,44 @@ int main(int argc, char **argv)
* to print the high info, even if it is zero.
*/
if (flags & FREE_LOHI) {
+ unsigned long kb_low_used;
+ unsigned long kb_high_used;
+
+ if (kb_low_total > kb_low_free)
+ kb_low_used = kb_low_total - kb_low_free;
+ else
+ kb_low_used = 0;
+
+ if (kb_high_total > kb_high_free)
+ kb_high_used = kb_high_total - kb_high_free;
+ else
+ kb_high_used = 0;
+
printf("%-7s", _("Low:"));
printf(" %10s", scale_size(kb_low_total, flags, args));
- printf(" %10s", scale_size(kb_low_total - kb_low_free, flags, args));
+ printf(" %10s", scale_size(kb_low_used, flags, args));
printf(" %10s", scale_size(kb_low_free, flags, args));
printf("\n");
printf("%-7s", _("High:"));
printf(" %10s", scale_size(kb_high_total, flags, args));
- printf(" %10s", scale_size(kb_high_total - kb_high_free, flags, args));
+ printf(" %10s", scale_size(kb_high_used, flags, args));
printf(" %10s", scale_size(kb_high_free, flags, args));
printf("\n");
}
if (!(flags & FREE_OLDFMT)) {
unsigned KLONG buffers_plus_cached = kb_main_buffers + kb_main_cached;
+ unsigned long kb_used_minus_bufcache;
+
+ if (kb_main_used > buffers_plus_cached)
+ kb_used_minus_bufcache = kb_main_used - buffers_plus_cached;
+ else
+ kb_used_minus_bufcache = 0;
+
printf(_("-/+ buffers/cache:"));
printf(" %10s",
- scale_size(kb_main_used - buffers_plus_cached, flags, args));
+ scale_size(kb_used_minus_bufcache, flags, args));
printf(" %10s",
scale_size(kb_main_free + buffers_plus_cached, flags, args));
printf("\n");

View File

@ -1,110 +0,0 @@
---
free.1 | 6 ++++++
free.c | 6 +++++-
proc/sysinfo.c | 16 ++++++++++------
proc/sysinfo.h | 5 +++++
4 files changed, 26 insertions(+), 7 deletions(-)
--- free.1
+++ free.1 2015-01-23 15:25:22.093559404 +0000
@@ -48,6 +48,13 @@ display the units of print out. Followi
If unit is missing, and you have petabyte of RAM or swap, the number is in
terabytes and columns might not be aligned with header.
.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,
+the \fBSReclaimable\fR as part of \fISlab\fR, that might be reclaimed, such as caches,
+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 2015-01-23 15:14:07.186228830 +0000
@@ -213,6 +213,7 @@ int main(int argc, char **argv)
{ "total", no_argument, NULL, 't' },
{ "seconds", required_argument, NULL, 's' },
{ "count", required_argument, NULL, 'c' },
+ { "full-cache",required_argument, NULL, 'C' },
{ "help", no_argument, NULL, HELP_OPTION },
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
@@ -231,7 +232,7 @@ int main(int argc, char **argv)
textdomain(PACKAGE);
atexit(close_stdout);
- while ((c = getopt_long(argc, argv, "bkmghlotc:s:V", longopts, NULL)) != -1)
+ while ((c = getopt_long(argc, argv, "bkmghlotCc:s:V", longopts, NULL)) != -1)
switch (c) {
case 'b':
args.exponent = 1;
@@ -281,6 +282,9 @@ int main(int argc, char **argv)
error(EXIT_FAILURE, ERANGE,
_("failed to parse count argument: '%s'"), optarg);
break;
+ case 'C':
+ setenv("PS_FULL_CACHE", "yes", 1);
+ break;
case HELP_OPTION:
usage(stdout);
case 'V':
--- proc/sysinfo.c
+++ proc/sysinfo.c 2015-01-23 15:08:35.381519221 +0000
@@ -3,6 +3,7 @@
* Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
* Copyright 1998-2003 Albert Cahalan
* June 2003, Fabian Frederick, disk and slab info
+ * 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
@@ -598,17 +599,18 @@ static unsigned long kb_vmalloc_chunk;
static unsigned long kb_vmalloc_total;
static unsigned long kb_vmalloc_used;
// seen on 2.6.24-rc6-git12
-static unsigned long kb_anon_pages;
-static unsigned long kb_bounce;
-static unsigned long kb_commit_limit;
-static unsigned long kb_nfs_unstable;
-static unsigned long kb_swap_reclaimable;
-static unsigned long kb_swap_unreclaimable;
+unsigned long kb_anon_pages;
+unsigned long kb_bounce;
+unsigned long kb_commit_limit;
+unsigned long kb_nfs_unstable;
+unsigned long kb_swap_reclaimable;
+unsigned long kb_swap_unreclaimable;
void meminfo(void){
char namebuf[16]; /* big enough to hold any row name */
mem_table_struct findme = { namebuf, NULL};
mem_table_struct *found;
+ const char *ev;
char *head;
char *tail;
static const mem_table_struct mem_table[] = {
@@ -684,6 +686,8 @@ nextline:
}
kb_swap_used = kb_swap_total - kb_swap_free;
kb_main_used = kb_main_total - kb_main_free;
+ if ((ev=getenv("PS_FULL_CACHE")))
+ kb_main_cached += kb_swap_reclaimable + kb_swap_cached + kb_nfs_unstable;
}
/*****************************************************************/
--- proc/sysinfo.h
+++ proc/sysinfo.h 2012-06-01 15:10:57.000000000 +0000
@@ -31,6 +31,11 @@ extern unsigned long kb_main_total;
extern unsigned long kb_swap_free;
extern unsigned long kb_swap_total;
/* recently introduced */
+extern unsigned long kb_anon_pages;
+extern unsigned long kb_bounce;
+extern unsigned long kb_nfs_unstable;
+extern unsigned long kb_slab_reclaimable;
+extern unsigned long kb_slab_unreclaimable;
extern unsigned long kb_high_free;
extern unsigned long kb_high_total;
extern unsigned long kb_low_free;

View File

@ -1,3 +1,77 @@
-------------------------------------------------------------------
Tue Feb 3 15:24:19 UTC 2015 - werner@suse.de
- Update tp procps-ng-3.3.10
* sysctl --system loads default config file - Debian #732920
* ps doesn't exit on SIGCONT
* top better accommodates discontinuous NUMA nodes
* ps cmdline trailing spaces suppressed under zsh, redhat #1057600
* kill restores the '-HUP -1' functionality
* vmstat -d / -p segfault eliminated when /sys is not mounted
* pgrep properly shows full command line when -au are combined
* vmstat supports timestamps with -t/--timestamp option
* top is now immune to distortions when system time is reset
* top standardized the <Esc> key support with prompted input
* top missing summary area info added to man document, ubuntu #574624
* top properly responds to the current locale LC_NUMERIC setting
* top provides alternate graph modes for cpu states and memory usage
* top offers new startup defaults, plus ./configure --disable-modern-top
* top exploits MemAvailable field and offers improved memory statistics
* ps new --quick-pid option, a more efficient alternative to --pid option
* usernames up to 32 characters now accommodated (up from 19), redhat #1112734
* free exploits MemAvailable field and offers improved memory statistics
* free considers slabs in displayed totals, debian #565518, ubuntu #126329
* watch supports new ANSI styles and background colors
- Remove the patches now upstream
0023-top-do-not-forget-the-fscanf-s-terminating-null-byte.patch
0024-sysctl-system-loads-default-config-file.patch
0025-Split-help-lines-to-help-translators.patch
0026-library-fixing-uninitialized-variable-pos-in-whattim.patch
0027-pgrep-Fixing-memory-leak-in-do_regcomp.patch
0028-sysctl-Fixing-memory-leaks-in-PreloadSystem.patch
0029-ps-ignore-SIGCONT.patch
0031-vmstat-wide-output-still-not-wide-enough.patch
0032-library-skip-replacement-of-trailing-0-in-read_unvec.patch
0033-kill-for-PID-1-restored.patch
0034-Check-for-presence-of-disks-in-vmstat.patch
0035-PID-2-to-9-for-kill-too.patch
0035-top-provide-for-discontinuous-not-active-NUMA-nodes.patch
0036-pgrep-fails-to-show-full-command-line-with-au.patch
0036-top-restore-the-former-behavior-after-stderr-redirec.patch
0037-fail-on-null-string-for-arguments.patch
0037-top-avoid-name-conflict-in-the-next-version-of-stdli.patch
0038-Update-help-files.patch
0038-top-protect-against-distortion-when-system-time-rese.patch
0039-vmstat-Support-for-timestamps-with-t-fix-for-wd.patch
0040-watch-Don-t-leak-extra-fds-to-the-child.patch
0041-vmstat-Fixing-format-security-flaws.patch
0043-Added-get-trans-target-to-Makefile.patch
0044-top-avoid-a-nan-when-the-delay-interval-is-very-low.patch
0045-library-properly-handle-memory-used-by-tmpfs.patch
0045-top-standardize-Esc-key-support-with-prompted-input.patch
0046-Minor-i18n-fixes.patch
0046-top-miscellaneous-accumulated-changes-to-program-cod.patch
0047-sysctl-increase-max-supported-line-length-of-the-con.patch
0049-fix-url-for-rsync.patch
0051-top-update-copyright-dates-plus-1-preprocessor-chang.patch
0052-top-refactor-man-document-so-as-to-allow-translation.patch
0053-top-minimize-the-usage-of-apostrophes-in-man-documen.patch
0054-top-swap-opening-quotes-for-back-tics-in-man-documen.patch
0055-misc-fix-man-doc-spelling-and-grammar-for-translatio.patch
0058-library-reverting-tmpfs-subtraction-from-cached-18-F.patch
0060-top-miscellaneous-accumulated-changes-to-man-documen.patch
bsc901202-add-better-help-output.patch
procps-ng-3.3.8-selinux.patch
procps-v3.3.3-buffersize.diff
- Modify and rename patches
procps-ng-3.3.8-bnc634071_procstat2.diff becomes procps-ng-3.3.10-bnc634071_procstat2.diff
procps-ng-3.3.9-errno.patch becomes procps-ng-3.3.10-errno.patch
procps-v3.3.3-fdleak.dif becomes procps-ng-3.3.10-fdleak.dif
procps-v3.3.3-integer-overflow.patch becomes procps-ng-3.3.10-integer-overflow.patch
procps-v3.3.4-large_pcpu.patch becomes procps-ng-3.3.10-large_pcpu.patch
procps-v3.3.3-slab.patch becomes procps-ng-3.3.10-slab.patch
procps-v3.3.4-xen.dif becomes procps-ng-3.3.10-xen.dif
-------------------------------------------------------------------
Fri Jan 23 15:53:29 UTC 2015 - werner@suse.de

View File

@ -18,7 +18,7 @@
%bcond_with bin2usr
%bcond_with pidof
%define somajor 3
%define somajor 4
%define libname libprocps%{somajor}
Name: procps
@ -40,7 +40,7 @@ BuildRequires: pkgconfig(libsystemd)
%endif
%endif
BuildRequires: xz
Version: 3.3.9
Version: 3.3.10
Release: 0
Provides: ps = %version-%release
Obsoletes: ps < %version-%release
@ -50,7 +50,7 @@ Requires(postun): %insserv_prereq
Summary: The ps utilities for /proc
License: GPL-2.0+ and LGPL-2.1+
Group: System/Monitoring
Source: http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-3.3.9.tar.xz
Source: http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-3.3.10.tar.xz
Source1: procps-pmap-legacy.tar.bz2
Source2: boot.sysctl
Source3: systat.xinetd
@ -59,20 +59,18 @@ Patch1: procps-v3.3.3-ia64.diff
Patch3: procps-ng-3.3.9-w-notruncate.diff
Patch4: procps-v3.3.4-w-simply-work.diff
Patch5: procps-ng-3.3.8-top.1.diff
Patch6: procps-v3.3.3-buffersize.diff
Patch7: procps-ng-3.3.8-readeof.patch
Patch8: procps-v3.3.3-slab.patch
Patch9: procps-ng-3.3.8-selinux.patch
Patch8: procps-ng-3.3.10-slab.patch
Patch10: procps-ng-3.3.8-accuracy.dif
Patch11: procps-v3.3.4-xen.dif
Patch12: procps-v3.3.3-fdleak.dif
Patch11: procps-ng-3.3.10-xen.dif
Patch12: procps-ng-3.3.10-fdleak.dif
Patch13: procps-v3.3.3-columns.dif
Patch14: procps-v3.3.3-integer-overflow.patch
Patch15: procps-ng-3.3.8-bnc634071_procstat2.diff
Patch14: procps-ng-3.3.10-integer-overflow.patch
Patch15: procps-ng-3.3.10-bnc634071_procstat2.diff
Patch16: procps-ng-3.3.8-bnc634840.patch
Patch17: procps-v3.3.3-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff
Patch18: procps-ng-3.3.8-petabytes.patch
Patch19: procps-v3.3.4-large_pcpu.patch
Patch19: procps-ng-3.3.10-large_pcpu.patch
Patch20: procps-ng-3.3.8-tinfo.dif
Patch21: procps-v3.3.3-pwdx.patch
# PATCH-FIX-OPENSUSE -- trifle rest of the old terabyte patch
@ -80,62 +78,7 @@ Patch28: procps-ng-3.3.8-vmstat-terabyte.dif
# PATCH-FIX-SUSE -- Ignore scan_unevictable_pages in sysctl
Patch31: procps-ng-3.3.8-ignore-scan_unevictable_pages.patch
# PATCH-FIX-SUSE -- Avoid errno set by setlocale()
Patch32: procps-ng-3.3.9-errno.patch
Patch60: 0024-sysctl-system-loads-default-config-file.patch
Patch61: 0025-Split-help-lines-to-help-translators.patch
Patch62: 0026-library-fixing-uninitialized-variable-pos-in-whattim.patch
Patch63: 0027-pgrep-Fixing-memory-leak-in-do_regcomp.patch
Patch64: 0028-sysctl-Fixing-memory-leaks-in-PreloadSystem.patch
Patch65: 0029-ps-ignore-SIGCONT.patch
Patch66: 0031-vmstat-wide-output-still-not-wide-enough.patch
Patch67: 0032-library-skip-replacement-of-trailing-0-in-read_unvec.patch
Patch68: 0033-kill-for-PID-1-restored.patch
Patch69: 0034-Check-for-presence-of-disks-in-vmstat.patch
Patch70: 0035-PID-2-to-9-for-kill-too.patch
Patch71: 0036-pgrep-fails-to-show-full-command-line-with-au.patch
Patch72: 0037-fail-on-null-string-for-arguments.patch
Patch73: 0038-Update-help-files.patch
Patch74: 0039-vmstat-Support-for-timestamps-with-t-fix-for-wd.patch
Patch75: 0040-watch-Don-t-leak-extra-fds-to-the-child.patch
Patch76: 0041-vmstat-Fixing-format-security-flaws.patch
Patch77: 0043-Added-get-trans-target-to-Makefile.patch
Patch78: 0045-library-properly-handle-memory-used-by-tmpfs.patch
Patch79: 0046-Minor-i18n-fixes.patch
Patch80: 0047-sysctl-increase-max-supported-line-length-of-the-con.patch
Patch81: 0049-fix-url-for-rsync.patch
Patch82: 0055-misc-fix-man-doc-spelling-and-grammar-for-translatio.patch
Patch83: 0058-library-reverting-tmpfs-subtraction-from-cached-18-F.patch
# Top patches
# PATCH-FIX-UPSTREAM added at 2014/05/16
Patch121: 0023-top-do-not-forget-the-fscanf-s-terminating-null-byte.patch
# PATCH-FIX-UPSTREAM added at 2014/05/15
Patch122: 0035-top-provide-for-discontinuous-not-active-NUMA-nodes.patch
# PATCH-FIX-UPSTREAM added at 2014/05/15
Patch123: 0036-top-restore-the-former-behavior-after-stderr-redirec.patch
# PATCH-FIX-UPSTREAM added at 2014/05/15
Patch124: 0037-top-avoid-name-conflict-in-the-next-version-of-stdli.patch
# PATCH-FIX-UPSTREAM added at 2014/05/15
Patch125: 0038-top-protect-against-distortion-when-system-time-rese.patch
# PATCH-FIX-UPSTREAM added at 2014/05/15
Patch126: 0044-top-avoid-a-nan-when-the-delay-interval-is-very-low.patch
# PATCH-FIX-UPSTREAM added at 2014/05/15
Patch127: 0045-top-standardize-Esc-key-support-with-prompted-input.patch
# PATCH-FIX-UPSTREAM added at 2014/05/15
Patch128: 0046-top-miscellaneous-accumulated-changes-to-program-cod.patch
# PATCH-FIX-UPSTREAM added at 2014/05/16
Patch129: 0051-top-update-copyright-dates-plus-1-preprocessor-chang.patch
# PATCH-FIX-UPSTREAM added at 2014/05/16
Patch130: 0052-top-refactor-man-document-so-as-to-allow-translation.patch
# PATCH-FIX-UPSTREAM added at 2014/05/16
Patch131: 0053-top-minimize-the-usage-of-apostrophes-in-man-documen.patch
# PATCH-FIX-UPSTREAM added at 2014/05/16
Patch132: 0054-top-swap-opening-quotes-for-back-tics-in-man-documen.patch
# PATCH-FIX-UPSTREAM added at 2014/05/16
Patch133: 0060-top-miscellaneous-accumulated-changes-to-man-documen.patch
# PATCH-FIX-UPSTREAM added at 2014/12/16
Patch134: bsc901202-add-better-help-output.patch
Patch32: procps-ng-3.3.10-errno.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -185,10 +128,8 @@ the process information pseudo-file system,
%patch3
%patch4
%patch5
%patch6
%patch7
%patch8
%patch9
%patch8 -b .cache
%patch10
%patch11
%patch12
@ -204,45 +145,6 @@ the process information pseudo-file system,
%patch28
%patch31 -p1
%patch32
%patch60
%patch61
%patch62
%patch63
%patch64
%patch65
%patch66
%patch67
%patch68
%patch69
%patch70
%patch71
%patch72
%patch73
%patch74
%patch75
%patch76
%patch77
%patch78
%patch79
%patch80
%patch81
%patch82
%patch83 -b .xyz
# Patches for top
%patch121
%patch122
%patch123
%patch124
%patch125
%patch126
%patch127
%patch128
%patch129
%patch130
%patch131
%patch132
%patch133
%patch134
%build
tar --strip-components=1 -xf %{S:1}
@ -416,6 +318,9 @@ make check
%{_includedir}/proc/whattime.h
%{_libdir}/libprocps.so
%{_libdir}/pkgconfig/libprocps.pc
%_mandir/man3/openproc.3.gz
%_mandir/man3/readproc.3.gz
%_mandir/man3/readproctab.3.gz
%files -n %{libname}
%defattr (-,root,root,755)