miscellaneous: clean up trailing whitespace throughout
The entire tree's polluted with inappropriate trailing whitespace. This commit rids our environment of all of those useless keystrokes. Unfortunately, it sure ain't a permanent solution and requires every contributor to instruct their editor(s) to prevent or eliminate them. Plus it's strongly recommended we all insert something like what's shown below to our '.gitconfig' file so as to provide at least some warnings when we try to apply any patches (git am) that do contain the #@!%& things! References(s): ~/.gitconfig excerpt --------------------------------- [core] whitespace = trailing-space, space-before-tab, blank-at-eof [apply] whitespace = warn --------------------------------- ~/.gitconfig excerpt Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
7b708ca334
commit
fe75e26ab6
@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based
|
|||||||
on the Library (independent of the use of the Library in a tool for
|
on the Library (independent of the use of the Library in a tool for
|
||||||
writing it). Whether that is true depends on what the Library does
|
writing it). Whether that is true depends on what the Library does
|
||||||
and what the program that uses the Library does.
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
complete source code as you receive it, in any medium, provided that
|
complete source code as you receive it, in any medium, provided that
|
||||||
you conspicuously and appropriately publish on each copy an
|
you conspicuously and appropriately publish on each copy an
|
||||||
|
@ -9,7 +9,7 @@ buildroot git clone.
|
|||||||
|
|
||||||
Once the apply merge is done you need to run 'make menuconfig',
|
Once the apply merge is done you need to run 'make menuconfig',
|
||||||
choose Package Selection for the target --->, [*] Show packages that
|
choose Package Selection for the target --->, [*] Show packages that
|
||||||
are also provided by busybox && System tools ---> [*] procps-ng.
|
are also provided by busybox && System tools ---> [*] procps-ng.
|
||||||
If you do not want to configure anything else save, exit and make.
|
If you do not want to configure anything else save, exit and make.
|
||||||
|
|
||||||
Notice that you almost certainly want to PROCPS_NG_VERSION
|
Notice that you almost certainly want to PROCPS_NG_VERSION
|
||||||
@ -80,6 +80,6 @@ index 0000000..0249b07
|
|||||||
+
|
+
|
||||||
+$(eval $(call AUTOTARGETS))
|
+$(eval $(call AUTOTARGETS))
|
||||||
+$(eval $(call AUTOTARGETS,host))
|
+$(eval $(call AUTOTARGETS,host))
|
||||||
--
|
--
|
||||||
1.7.10
|
1.7.10
|
||||||
|
|
||||||
|
@ -441,7 +441,7 @@ char *argv[];
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Check out the next process
|
* Check out the next process
|
||||||
* If we can't open it, use info from this process,
|
* If we can't open it, use info from this process,
|
||||||
* so we have to check out cmdline first.
|
* so we have to check out cmdline first.
|
||||||
@ -665,7 +665,7 @@ char *tty;
|
|||||||
if (idle >= (60 * 60 * 48)) /* more than two days */
|
if (idle >= (60 * 60 * 48)) /* more than two days */
|
||||||
sprintf (give, "%2ludays", idle / (60 * 60 * 24));
|
sprintf (give, "%2ludays", idle / (60 * 60 * 24));
|
||||||
else
|
else
|
||||||
sprintf (give, " %2lu:%02u", idle / (60 * 60),
|
sprintf (give, " %2lu:%02u", idle / (60 * 60),
|
||||||
(unsigned) ((idle / 60) % 60));
|
(unsigned) ((idle / 60) % 60));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
* utmp.c - utmp printing command
|
* utmp.c - utmp printing command
|
||||||
* Copyright (C) Albert Cahalan
|
* Copyright (C) Albert Cahalan
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
@ -65,7 +65,7 @@ int main (int argc, char **argv) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (list) {
|
if (list) {
|
||||||
ut = fopen(UTMP_FILE, "r");
|
ut = fopen(UTMP_FILE, "r");
|
||||||
while (fread(&uts, sizeof(uts), 1, ut))
|
while (fread(&uts, sizeof(uts), 1, ut))
|
||||||
@ -90,7 +90,7 @@ int main (int argc, char **argv) {
|
|||||||
|
|
||||||
if (fix) {
|
if (fix) {
|
||||||
ut = fopen(UTMP_FILE, "r");
|
ut = fopen(UTMP_FILE, "r");
|
||||||
while (fread(&uts, sizeof(uts), 1, ut))
|
while (fread(&uts, sizeof(uts), 1, ut))
|
||||||
if (((uts.ut_type == USER_PROCESS) && (uts.ut_name[0] != '\000'))
|
if (((uts.ut_type == USER_PROCESS) && (uts.ut_name[0] != '\000'))
|
||||||
|| print_all) {
|
|| print_all) {
|
||||||
/* Display entry in utmp */
|
/* Display entry in utmp */
|
||||||
@ -106,7 +106,7 @@ int main (int argc, char **argv) {
|
|||||||
printf("ut_user: %s\n", user);
|
printf("ut_user: %s\n", user);
|
||||||
printf("ut_host: %s\n", host);
|
printf("ut_host: %s\n", host);
|
||||||
printf("ut_addr: %d\n\n", uts.ut_addr);
|
printf("ut_addr: %d\n\n", uts.ut_addr);
|
||||||
|
|
||||||
printf("Modify this record? (y/N): "); fflush(stdout);
|
printf("Modify this record? (y/N): "); fflush(stdout);
|
||||||
/* Ask if to delete or no */
|
/* Ask if to delete or no */
|
||||||
if ((ch = getchar()) == 'y' || ch == 'Y') {
|
if ((ch = getchar()) == 'y' || ch == 'Y') {
|
||||||
|
2
free.1
2
free.1
@ -90,7 +90,7 @@ memory information
|
|||||||
.BR top "(1),
|
.BR top "(1),
|
||||||
.BR vmstat (8).
|
.BR vmstat (8).
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Written by Brian Edmonds.
|
Written by Brian Edmonds.
|
||||||
.SH "REPORTING BUGS"
|
.SH "REPORTING BUGS"
|
||||||
Please send bug reports to
|
Please send bug reports to
|
||||||
.UR procps@freelists.org
|
.UR procps@freelists.org
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* This header was copied from util-linux at fall 2011.
|
* This header was copied from util-linux at fall 2011.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* This header was copied from util-linux at fall 2011.
|
* This header was copied from util-linux at fall 2011.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* This header was copied from util-linux at fall 2011.
|
* This header was copied from util-linux at fall 2011.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* strutils.c - various string routines shared by commands
|
* strutils.c - various string routines shared by commands
|
||||||
* This file was copied from util-linux at fall 2011.
|
* This file was copied from util-linux at fall 2011.
|
||||||
*
|
*
|
||||||
|
6
pgrep.1
6
pgrep.1
@ -49,7 +49,7 @@ only.)
|
|||||||
\fB\-c\fR, \fB\-\-count\fR
|
\fB\-c\fR, \fB\-\-count\fR
|
||||||
Suppress normal output; instead print a count of matching processes. When
|
Suppress normal output; instead print a count of matching processes. When
|
||||||
count does not match anything, e.g. returns zero, the command will return
|
count does not match anything, e.g. returns zero, the command will return
|
||||||
non-zero value.
|
non-zero value.
|
||||||
.TP
|
.TP
|
||||||
\fB\-d\fR, \fB\-\-delimiter\fR \fIdelimiter\fP
|
\fB\-d\fR, \fB\-\-delimiter\fR \fIdelimiter\fP
|
||||||
Sets the string used to delimit each process ID in the output (by default a
|
Sets the string used to delimit each process ID in the output (by default a
|
||||||
@ -116,8 +116,8 @@ Only match processes whose real user ID is listed. Either the numerical or
|
|||||||
symbolical value may be used.
|
symbolical value may be used.
|
||||||
.TP
|
.TP
|
||||||
\fB\-v\fR, \fB\-\-inverse\fR\fR
|
\fB\-v\fR, \fB\-\-inverse\fR\fR
|
||||||
Negates the matching. This option is usually used in
|
Negates the matching. This option is usually used in
|
||||||
.BR pgrep 's
|
.BR pgrep 's
|
||||||
context. In
|
context. In
|
||||||
.BR pkill 's
|
.BR pkill 's
|
||||||
context the short option is disabled to avoid accidental usage of the option.
|
context the short option is disabled to avoid accidental usage of the option.
|
||||||
|
6
pgrep.c
6
pgrep.c
@ -547,7 +547,7 @@ static struct el * select_procs (int *num)
|
|||||||
xerrx(EXIT_FAILURE, _("internal error"));
|
xerrx(EXIT_FAILURE, _("internal error"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (&task, 0, sizeof (task));
|
memset (&task, 0, sizeof (task));
|
||||||
}
|
}
|
||||||
closeproc (ptp);
|
closeproc (ptp);
|
||||||
@ -622,7 +622,7 @@ static void parse_opts (int argc, char **argv)
|
|||||||
/* These options are for pgrep only */
|
/* These options are for pgrep only */
|
||||||
strcat (opts, "lad:v");
|
strcat (opts, "lad:v");
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat (opts, "LF:cfnoxP:g:s:u:U:G:t:?Vh");
|
strcat (opts, "LF:cfnoxP:g:s:u:U:G:t:?Vh");
|
||||||
|
|
||||||
while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != -1) {
|
while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != -1) {
|
||||||
@ -810,7 +810,7 @@ int main (int argc, char **argv)
|
|||||||
continue;
|
continue;
|
||||||
xwarn(_("killing pid %ld failed"), procs[i].num);
|
xwarn(_("killing pid %ld failed"), procs[i].num);
|
||||||
}
|
}
|
||||||
if (opt_count)
|
if (opt_count)
|
||||||
fprintf(stdout, "%d\n", num);
|
fprintf(stdout, "%d\n", num);
|
||||||
} else {
|
} else {
|
||||||
if (opt_count) {
|
if (opt_count) {
|
||||||
|
@ -133,7 +133,7 @@ such a program is covered only if its contents constitute a work based
|
|||||||
on the Library (independent of the use of the Library in a tool for
|
on the Library (independent of the use of the Library in a tool for
|
||||||
writing it). Whether that is true depends on what the Library does
|
writing it). Whether that is true depends on what the Library does
|
||||||
and what the program that uses the Library does.
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
complete source code as you receive it, in any medium, provided that
|
complete source code as you receive it, in any medium, provided that
|
||||||
you conspicuously and appropriately publish on each copy an
|
you conspicuously and appropriately publish on each copy an
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -37,26 +37,26 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
|
|||||||
int my_cells = 0;
|
int my_cells = 0;
|
||||||
int my_bytes = 0;
|
int my_bytes = 0;
|
||||||
mbstate_t s;
|
mbstate_t s;
|
||||||
|
|
||||||
memset(&s, 0, sizeof (s));
|
memset(&s, 0, sizeof (s));
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
|
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(len = mbrtowc (&wc, src, MB_CUR_MAX, &s)))
|
if (!(len = mbrtowc (&wc, src, MB_CUR_MAX, &s)))
|
||||||
/* 'str' contains \0 */
|
/* 'str' contains \0 */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
/* invalid multibyte sequence -- zeroize state */
|
/* invalid multibyte sequence -- zeroize state */
|
||||||
memset (&s, 0, sizeof (s));
|
memset (&s, 0, sizeof (s));
|
||||||
*(dst++) = '?';
|
*(dst++) = '?';
|
||||||
src++;
|
src++;
|
||||||
my_cells++;
|
my_cells++;
|
||||||
my_bytes++;
|
my_bytes++;
|
||||||
|
|
||||||
} else if (!iswprint(wc)) {
|
} else if (!iswprint(wc)) {
|
||||||
@ -64,14 +64,14 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
|
|||||||
*(dst++) = '?';
|
*(dst++) = '?';
|
||||||
src+=len;
|
src+=len;
|
||||||
my_cells++;
|
my_cells++;
|
||||||
my_bytes++;
|
my_bytes++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/* multibyte - printable */
|
/* multibyte - printable */
|
||||||
int wlen = wcwidth(wc);
|
int wlen = wcwidth(wc);
|
||||||
|
|
||||||
if (wlen==0) {
|
if (wlen==0) {
|
||||||
// invisible multibyte -- we don't ignore it, because some terminal
|
// invisible multibyte -- we don't ignore it, because some terminal
|
||||||
// interpret it wrong and more safe is replace it with '?'
|
// interpret it wrong and more safe is replace it with '?'
|
||||||
*(dst++) = '?';
|
*(dst++) = '?';
|
||||||
src+=len;
|
src+=len;
|
||||||
@ -103,7 +103,7 @@ static int escape_str_utf8(char *restrict dst, const char *restrict src, int buf
|
|||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
|
|
||||||
// fprintf(stderr, "maxcells: %d, my_cells; %d\n", *maxcells, my_cells);
|
// fprintf(stderr, "maxcells: %d, my_cells; %d\n", *maxcells, my_cells);
|
||||||
|
|
||||||
*maxcells -= my_cells;
|
*maxcells -= my_cells;
|
||||||
return my_bytes; // bytes of text, excluding the NUL
|
return my_bytes; // bytes of text, excluding the NUL
|
||||||
}
|
}
|
||||||
@ -124,10 +124,10 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
|
|||||||
"????????????????????????????????"
|
"????????????????????????????????"
|
||||||
"????????????????????????????????"
|
"????????????????????????????????"
|
||||||
"????????????????????????????????";
|
"????????????????????????????????";
|
||||||
|
|
||||||
#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
|
#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
|
||||||
static int utf_init=0;
|
static int utf_init=0;
|
||||||
|
|
||||||
if(utf_init==0){
|
if(utf_init==0){
|
||||||
/* first call -- check if UTF stuff is usable */
|
/* first call -- check if UTF stuff is usable */
|
||||||
char *enc = nl_langinfo(CODESET);
|
char *enc = nl_langinfo(CODESET);
|
||||||
@ -138,11 +138,11 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
|
|||||||
return escape_str_utf8(dst, src, bufsize, maxcells);
|
return escape_str_utf8(dst, src, bufsize, maxcells);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(bufsize > *maxcells+1) bufsize=*maxcells+1; // FIXME: assumes 8-bit locale
|
if(bufsize > *maxcells+1) bufsize=*maxcells+1; // FIXME: assumes 8-bit locale
|
||||||
|
|
||||||
for(;;){
|
for(;;){
|
||||||
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
|
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
|
||||||
break;
|
break;
|
||||||
c = (unsigned char) *(src++);
|
c = (unsigned char) *(src++);
|
||||||
if(!c) break;
|
if(!c) break;
|
||||||
@ -152,7 +152,7 @@ int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *m
|
|||||||
*(dst++) = c;
|
*(dst++) = c;
|
||||||
}
|
}
|
||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
|
|
||||||
*maxcells -= my_cells;
|
*maxcells -= my_cells;
|
||||||
return my_bytes; // bytes of text, excluding the NUL
|
return my_bytes; // bytes of text, excluding the NUL
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ open_again:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(done>0 && done<(ssize_t)room-total-1){
|
if(done>0 && done<(ssize_t)room-total-1){
|
||||||
total += done;
|
total += done;
|
||||||
continue; /* OK, we read some. Go do more. */
|
continue; /* OK, we read some. Go do more. */
|
||||||
}
|
}
|
||||||
fprintf(stderr,"%ld can't happen\n", (long)done);
|
fprintf(stderr,"%ld can't happen\n", (long)done);
|
||||||
|
20
proc/slab.c
20
proc/slab.c
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* slab.c - slab related functions for libproc
|
* slab.c - slab related functions for libproc
|
||||||
*
|
*
|
||||||
* Chris Rivera <cmrivera@ufl.edu>
|
* Chris Rivera <cmrivera@ufl.edu>
|
||||||
@ -62,7 +62,7 @@ static struct slab_info *get_slabnode(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* slab_badname_detect - return true if current slab was declared with
|
* slab_badname_detect - return true if current slab was declared with
|
||||||
* whitespaces for instance
|
* whitespaces for instance
|
||||||
* FIXME :Other cases ?
|
* FIXME :Other cases ?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -72,9 +72,9 @@ static int slab_badname_detect(const char *restrict buffer)
|
|||||||
while (*buffer){
|
while (*buffer){
|
||||||
if((*buffer)==' ')
|
if((*buffer)==' ')
|
||||||
numberarea=1;
|
numberarea=1;
|
||||||
if(isalpha(*buffer)&&numberarea)
|
if(isalpha(*buffer)&&numberarea)
|
||||||
return 1;
|
return 1;
|
||||||
buffer++;
|
buffer++;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ void free_slabinfo(struct slab_info *list)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parse_slabinfo20 - actual parse routine for slabinfo 2.x (2.6 kernels)
|
// parse_slabinfo20 - actual parse routine for slabinfo 2.x (2.6 kernels)
|
||||||
// Note: difference between 2.0 and 2.1 is in the ": globalstat" part where version 2.1
|
// Note: difference between 2.0 and 2.1 is in the ": globalstat" part where version 2.1
|
||||||
// has extra column <nodeallocs>. We don't use ": globalstat" part in both versions.
|
// has extra column <nodeallocs>. We don't use ": globalstat" part in both versions.
|
||||||
//
|
//
|
||||||
// Formats (we don't use "statistics" extensions)
|
// Formats (we don't use "statistics" extensions)
|
||||||
@ -117,7 +117,7 @@ void free_slabinfo(struct slab_info *list)
|
|||||||
// : slabdata <active_slabs> <num_slabs> <sharedavail> \
|
// : slabdata <active_slabs> <num_slabs> <sharedavail> \
|
||||||
// : globalstat <listallocs> <maxobjs> <grown> <reaped> <error> <maxfreeable> <freelimit> <nodeallocs> \
|
// : globalstat <listallocs> <maxobjs> <grown> <reaped> <error> <maxfreeable> <freelimit> <nodeallocs> \
|
||||||
// : cpustat <allochit> <allocmiss> <freehit> <freemiss>
|
// : cpustat <allochit> <allocmiss> <freehit> <freemiss>
|
||||||
//
|
//
|
||||||
// slabinfo - version: 2.0
|
// slabinfo - version: 2.0
|
||||||
// # name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
|
// # name <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> \
|
||||||
// : tunables <batchcount> <limit> <sharedfactor> \
|
// : tunables <batchcount> <limit> <sharedfactor> \
|
||||||
@ -158,8 +158,8 @@ static int parse_slabinfo20(struct slab_info **list, struct slab_stat *stats,
|
|||||||
|
|
||||||
assigned = sscanf(buffer, "%" STRINGIFY(SLAB_INFO_NAME_LEN)
|
assigned = sscanf(buffer, "%" STRINGIFY(SLAB_INFO_NAME_LEN)
|
||||||
"s %d %d %d %d %d : tunables %*d %*d %*d : \
|
"s %d %d %d %d %d : tunables %*d %*d %*d : \
|
||||||
slabdata %d %d %*d", curr->name,
|
slabdata %d %d %*d", curr->name,
|
||||||
&curr->nr_active_objs, &curr->nr_objs,
|
&curr->nr_active_objs, &curr->nr_objs,
|
||||||
&curr->obj_size, &curr->objs_per_slab,
|
&curr->obj_size, &curr->objs_per_slab,
|
||||||
&curr->pages_per_slab, &curr->nr_active_slabs,
|
&curr->pages_per_slab, &curr->nr_active_slabs,
|
||||||
&curr->nr_slabs);
|
&curr->nr_slabs);
|
||||||
@ -244,7 +244,7 @@ static int parse_slabinfo11(struct slab_info **list, struct slab_stat *stats,
|
|||||||
if (assigned < 6) {
|
if (assigned < 6) {
|
||||||
fprintf(stderr, "unrecognizable data in your slabinfo version 1.1\n\r");
|
fprintf(stderr, "unrecognizable data in your slabinfo version 1.1\n\r");
|
||||||
if(slab_badname_detect(buffer))
|
if(slab_badname_detect(buffer))
|
||||||
fprintf(stderr, "Found an error in cache name at line %s\n", buffer);
|
fprintf(stderr, "Found an error in cache name at line %s\n", buffer);
|
||||||
curr = NULL;
|
curr = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ static int parse_slabinfo11(struct slab_info **list, struct slab_stat *stats,
|
|||||||
|
|
||||||
if (curr->obj_size)
|
if (curr->obj_size)
|
||||||
curr->objs_per_slab = curr->pages_per_slab *
|
curr->objs_per_slab = curr->pages_per_slab *
|
||||||
page_size / curr->obj_size;
|
page_size / curr->obj_size;
|
||||||
|
|
||||||
stats->nr_objs += curr->nr_objs;
|
stats->nr_objs += curr->nr_objs;
|
||||||
stats->nr_active_objs += curr->nr_active_objs;
|
stats->nr_active_objs += curr->nr_active_objs;
|
||||||
|
@ -269,7 +269,7 @@ static void init_libproc(void){
|
|||||||
cpuinfo();
|
cpuinfo();
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
if(linux_version_code > LINUX_VERSION(2, 4, 0)){
|
if(linux_version_code > LINUX_VERSION(2, 4, 0)){
|
||||||
Hertz = find_elf_note(AT_CLKTCK);
|
Hertz = find_elf_note(AT_CLKTCK);
|
||||||
if(Hertz!=NOTE_NOT_FOUND) return;
|
if(Hertz!=NOTE_NOT_FOUND) return;
|
||||||
fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr);
|
fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr);
|
||||||
@ -360,7 +360,7 @@ void eight_cpu_numbers(double *restrict uret, double *restrict nret, double *res
|
|||||||
void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) {
|
void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) {
|
||||||
double avg_1=0, avg_5=0, avg_15=0;
|
double avg_1=0, avg_5=0, avg_15=0;
|
||||||
char *savelocale;
|
char *savelocale;
|
||||||
|
|
||||||
FILE_TO_BUF(LOADAVG_FILE,loadavg_fd);
|
FILE_TO_BUF(LOADAVG_FILE,loadavg_fd);
|
||||||
savelocale = strdup(setlocale(LC_NUMERIC, NULL));
|
savelocale = strdup(setlocale(LC_NUMERIC, NULL));
|
||||||
setlocale(LC_NUMERIC, "C");
|
setlocale(LC_NUMERIC, "C");
|
||||||
@ -447,7 +447,7 @@ void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff
|
|||||||
if(fd == -1) crash("/proc/stat");
|
if(fd == -1) crash("/proc/stat");
|
||||||
}
|
}
|
||||||
read(fd,buff,BUFFSIZE-1);
|
read(fd,buff,BUFFSIZE-1);
|
||||||
*intr = 0;
|
*intr = 0;
|
||||||
*ciow = 0; /* not separated out until the 2.5.41 kernel */
|
*ciow = 0; /* not separated out until the 2.5.41 kernel */
|
||||||
*cxxx = 0; /* not separated out until the 2.6.0-test4 kernel */
|
*cxxx = 0; /* not separated out until the 2.6.0-test4 kernel */
|
||||||
*cyyy = 0; /* not separated out until the 2.6.0-test4 kernel */
|
*cyyy = 0; /* not separated out until the 2.6.0-test4 kernel */
|
||||||
@ -719,21 +719,21 @@ unsigned long vm_pageoutrun; // times kswapd ran page reclaim
|
|||||||
unsigned long vm_allocstall; // times a page allocator ran direct reclaim
|
unsigned long vm_allocstall; // times a page allocator ran direct reclaim
|
||||||
unsigned long vm_pgrotated; // pages rotated to the tail of the LRU for immediate reclaim
|
unsigned long vm_pgrotated; // pages rotated to the tail of the LRU for immediate reclaim
|
||||||
// seen on a 2.6.8-rc1 kernel, apparently replacing old fields
|
// seen on a 2.6.8-rc1 kernel, apparently replacing old fields
|
||||||
static unsigned long vm_pgalloc_dma; //
|
static unsigned long vm_pgalloc_dma; //
|
||||||
static unsigned long vm_pgalloc_high; //
|
static unsigned long vm_pgalloc_high; //
|
||||||
static unsigned long vm_pgalloc_normal; //
|
static unsigned long vm_pgalloc_normal; //
|
||||||
static unsigned long vm_pgrefill_dma; //
|
static unsigned long vm_pgrefill_dma; //
|
||||||
static unsigned long vm_pgrefill_high; //
|
static unsigned long vm_pgrefill_high; //
|
||||||
static unsigned long vm_pgrefill_normal; //
|
static unsigned long vm_pgrefill_normal; //
|
||||||
static unsigned long vm_pgscan_direct_dma; //
|
static unsigned long vm_pgscan_direct_dma; //
|
||||||
static unsigned long vm_pgscan_direct_high; //
|
static unsigned long vm_pgscan_direct_high; //
|
||||||
static unsigned long vm_pgscan_direct_normal; //
|
static unsigned long vm_pgscan_direct_normal; //
|
||||||
static unsigned long vm_pgscan_kswapd_dma; //
|
static unsigned long vm_pgscan_kswapd_dma; //
|
||||||
static unsigned long vm_pgscan_kswapd_high; //
|
static unsigned long vm_pgscan_kswapd_high; //
|
||||||
static unsigned long vm_pgscan_kswapd_normal; //
|
static unsigned long vm_pgscan_kswapd_normal; //
|
||||||
static unsigned long vm_pgsteal_dma; //
|
static unsigned long vm_pgsteal_dma; //
|
||||||
static unsigned long vm_pgsteal_high; //
|
static unsigned long vm_pgsteal_high; //
|
||||||
static unsigned long vm_pgsteal_normal; //
|
static unsigned long vm_pgsteal_normal; //
|
||||||
// seen on a 2.6.8-rc1 kernel
|
// seen on a 2.6.8-rc1 kernel
|
||||||
static unsigned long vm_kswapd_inodesteal; //
|
static unsigned long vm_kswapd_inodesteal; //
|
||||||
static unsigned long vm_nr_unstable; //
|
static unsigned long vm_nr_unstable; //
|
||||||
@ -887,7 +887,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
|
|||||||
|
|
||||||
*disks = NULL;
|
*disks = NULL;
|
||||||
*partitions = NULL;
|
*partitions = NULL;
|
||||||
buff[BUFFSIZE-1] = 0;
|
buff[BUFFSIZE-1] = 0;
|
||||||
fd = fopen("/proc/diskstats", "rb");
|
fd = fopen("/proc/diskstats", "rb");
|
||||||
if(!fd) crash("/proc/diskstats");
|
if(!fd) crash("/proc/diskstats");
|
||||||
|
|
||||||
@ -932,7 +932,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
|
|||||||
&(*partitions)[cPartition].requested_writes
|
&(*partitions)[cPartition].requested_writes
|
||||||
);
|
);
|
||||||
(*partitions)[cPartition++].parent_disk = cDisk-1;
|
(*partitions)[cPartition++].parent_disk = cDisk-1;
|
||||||
(*disks)[cDisk-1].partitions++;
|
(*disks)[cDisk-1].partitions++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -945,7 +945,7 @@ unsigned int getdiskstat(struct disk_stat **disks, struct partition_stat **parti
|
|||||||
unsigned int getslabinfo (struct slab_cache **slab){
|
unsigned int getslabinfo (struct slab_cache **slab){
|
||||||
FILE* fd;
|
FILE* fd;
|
||||||
int cSlab = 0;
|
int cSlab = 0;
|
||||||
buff[BUFFSIZE-1] = 0;
|
buff[BUFFSIZE-1] = 0;
|
||||||
*slab = NULL;
|
*slab = NULL;
|
||||||
fd = fopen("/proc/slabinfo", "rb");
|
fd = fopen("/proc/slabinfo", "rb");
|
||||||
if(!fd) crash("/proc/slabinfo");
|
if(!fd) crash("/proc/slabinfo");
|
||||||
|
@ -45,7 +45,7 @@ void init_Linux_version(void) {
|
|||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
static struct utsname uts;
|
static struct utsname uts;
|
||||||
|
|
||||||
if (uname(&uts) == -1) /* failure implies impending death */
|
if (uname(&uts) == -1) /* failure implies impending death */
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
|
4
ps/ps.1
4
ps/ps.1
@ -804,13 +804,13 @@ if the parent process exits.
|
|||||||
If the length of the username is greater than the length of the display
|
If the length of the username is greater than the length of the display
|
||||||
column, the numeric user ID is displayed instead.
|
column, the numeric user ID is displayed instead.
|
||||||
.PP
|
.PP
|
||||||
Commands options such as
|
Commands options such as
|
||||||
.B ps \-aux
|
.B ps \-aux
|
||||||
are not recommended as it is a confusion of two different standards.
|
are not recommended as it is a confusion of two different standards.
|
||||||
According to the POSIX and UNIX standards, the above command asks to
|
According to the POSIX and UNIX standards, the above command asks to
|
||||||
display all processes with a TTY (generally the commands users are
|
display all processes with a TTY (generally the commands users are
|
||||||
running) plus all processes owned by a user named "x". If that user
|
running) plus all processes owned by a user named "x". If that user
|
||||||
doesn't exist, then
|
doesn't exist, then
|
||||||
.B ps
|
.B ps
|
||||||
will assume you really meant "\fBps\fR \fIaux\fR".
|
will assume you really meant "\fBps\fR \fIaux\fR".
|
||||||
.SH "PROCESS FLAGS"
|
.SH "PROCESS FLAGS"
|
||||||
|
@ -14,7 +14,7 @@ displays detailed kernel slab cache information in real time. It displays a
|
|||||||
listing of the top caches sorted by one of the listed sort criteria. It also
|
listing of the top caches sorted by one of the listed sort criteria. It also
|
||||||
displays a statistics header filled with slab layer information.
|
displays a statistics header filled with slab layer information.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
Normal invocation of
|
Normal invocation of
|
||||||
.B slabtop
|
.B slabtop
|
||||||
does not require any options. The behavior, however, can be fine-tuned by
|
does not require any options. The behavior, however, can be fine-tuned by
|
||||||
specifying one or more of the following flags:
|
specifying one or more of the following flags:
|
||||||
|
2
sysctl.8
2
sysctl.8
@ -18,7 +18,7 @@ sysctl \- configure kernel parameters at runtime
|
|||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.B sysctl
|
.B sysctl
|
||||||
is used to modify kernel parameters at runtime. The parameters available
|
is used to modify kernel parameters at runtime. The parameters available
|
||||||
are those listed under /proc/sys/. Procfs is required for
|
are those listed under /proc/sys/. Procfs is required for
|
||||||
.B sysctl
|
.B sysctl
|
||||||
support in Linux. You can use
|
support in Linux. You can use
|
||||||
.B sysctl
|
.B sysctl
|
||||||
|
@ -50,4 +50,4 @@ EXTRA_DIST = \
|
|||||||
sysctl.test/sysctl_read.exp \
|
sysctl.test/sysctl_read.exp \
|
||||||
uptime.test/uptime.exp \
|
uptime.test/uptime.exp \
|
||||||
vmstat.test/vmstat.exp \
|
vmstat.test/vmstat.exp \
|
||||||
w.test/w.exp
|
w.test/w.exp
|
||||||
|
4
w.c
4
w.c
@ -142,12 +142,12 @@ static void print_display_or_interface(const char *restrict host, int len, int r
|
|||||||
fputc('-', stdout);
|
fputc('-', stdout);
|
||||||
}
|
}
|
||||||
} else { /* multiple colons found - it's an IPv6 address */
|
} else { /* multiple colons found - it's an IPv6 address */
|
||||||
|
|
||||||
/* search for % (interface separator in case of IPv6 link address) */
|
/* search for % (interface separator in case of IPv6 link address) */
|
||||||
while ( (tmp < (host + len)) && (*tmp != '%') && isprint(*tmp) ) tmp++;
|
while ( (tmp < (host + len)) && (*tmp != '%') && isprint(*tmp) ) tmp++;
|
||||||
|
|
||||||
if (*tmp == '%') { /* interface separator found */
|
if (*tmp == '%') { /* interface separator found */
|
||||||
|
|
||||||
/* number of chars till the end of the input field */
|
/* number of chars till the end of the input field */
|
||||||
len -= (tmp - host);
|
len -= (tmp - host);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user