* Rename pwait to pidwait
* library: renamed to libproc-2 and reset to 0:0:0
* ps: Add OOM and OOMADJ fields issue #198
+ * slabtop: Don't combine d and o options issue #160
procps-ng-3.3.17
---------------
.\"
.\" Copyright (C) 2003 Chris Rivera
.\" Licensed under the terms of the GNU Library General Public License, v2
-.TH SLABTOP "1" "June 2011" "procps-ng" "User Commands"
+.TH SLABTOP "1" "2021-03-11" "procps-ng" "User Commands"
.SH NAME
slabtop \- display kernel slab cache information in real time
.SH SYNOPSIS
in seconds. By default,
.B slabtop
refreshes the display every three seconds. To exit the program, hit
-.BR q.
+.BR q .
+This cannot be combined with the \fB-o\fR option.
.TP
\fB\-s\fR, \fB\-\-sort\fR=\fIS\fR
Sort by \fIS\fR, where \fIS\fR is one of the sort criteria.
#define DEFAULT_SORT SLAB_NUM_OBJS
#define CHAINS_ALLOC 150
#define MAXTBL(t) (int)( sizeof(t) / sizeof(t[0]) )
+#define DEFAULT_DELAY 3
static unsigned short Cols, Rows;
static struct termios Saved_tty;
-static long Delay = 3;
+static long Delay = 0;
static int Run_once = 0;
static struct slabinfo_info *Slab_info;
while ((o = getopt_long(argc, argv, "d:s:ohV", longopts, NULL)) != -1) {
switch (o) {
case 'd':
+ if (Run_once)
+ xerrx(EXIT_FAILURE, _("Cannot combine -d and -o options"));
errno = 0;
Delay = strtol_or_err(optarg, _("illegal delay"));
if (Delay < 1)
set_sort_stuff(optarg[0]);
break;
case 'o':
+ if (Delay != 0)
+ xerrx(EXIT_FAILURE, _("Cannot combine -d and -o options"));
Run_once=1;
- Delay = 0;
break;
case 'V':
printf(PROCPS_NG_VERSION);
}
if (optind != argc)
usage(stderr);
+ if (!Run_once && Delay == 0)
+ Delay = DEFAULT_DELAY;
}
static void print_summary (void)
pkill \
ps \
pwdx \
+ slabtop \
uptime \
vmstat \
w
ps.test/ps_personality.exp \
ps.test/ps_sched_batch.exp \
pwdx.test/pwdx.exp \
+ slabtop.test/slabtop.exp \
uptime.test/uptime.exp \
vmstat.test/vmstat.exp \
w.test/w.exp
set used "\\\(% used\\\)\\s+:"
set pct "\\\(\\d+\\.\\d+%\\\)"
-if { [ file readable "/proc/slabinfo" ] == 0 } {
- unsupported "slabtop tests disabled as /proc/slabinfo is unreadable"
-} else {
set slabtop_header "^ $avst Objects $used \\d+ / \\d+ ${pct}\\s+$avst Slabs $used \\d+ / \\d+ ${pct}\\s+$avst Caches $used \\d+ / \\d+ ${pct}\\s+$avst Size $used \\d+\\.\\d+K / \\d+\\.\\d+K ${pct}\\s+Minimum / Average / Maximum Object : \\d+\\.\\d+K / \\d+\\.\\d+K / \\d+\\.\\d+K\\s+OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME\\s+"
set test "slabtop help"
spawn $slabtop --help
expect_pass $test "^\\s+Usage:\\s+\(lt-\)\?slabtop \\\[options\\\]"
+set test "slabtop o then d options"
+spawn $slabtop -o -d 10
+expect_pass $test "Cannot combine -d and -o options"
+
+set test "slabtop d then o options"
+spawn $slabtop -d 10 -o
+expect_pass $test "Cannot combine -d and -o options"
+
set sort_tests {
"a" "active objects" "^\\s*\\d+\\s+(\\d+)\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
"b" "objects per slab" "^\\s*\\d+\\s+\\d+\\s+\\d+%\\s+\\d+\\.\\d+K\\s+\\d+\\s+(\\d+)\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
"s" "object size" "^\\s*\\d+\\s+\\d+\\s+\\d+%\\s+(\\d+\\.\\d+)K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
"u" "utilisation" "^\\s*\\d+\\s+\\d+\\s+(\\d+)%\\s+\\d+\\.\\d+K\\s+\\d+\\s+\\d+\\s+\\d+K\\s+\\S\[^\r\]+\\s*"
}
+
+# BEGIN - Tests requiring /proc/slabinfo
+if { [ file readable "/proc/slabinfo" ] == 0 } {
+ unsupported "slabtop tests disabled as /proc/slabinfo is unreadable"
+} else {
+
foreach { flag desc match } $sort_tests {
set test "slabtop sorted by $desc"
spawn $slabtop -o -s $flag
expect_table_dsc $test $slabtop_header $match
}
}
+# END - Tests requiring /proc/slabinfo