Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108325698
D40801.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
16 KB
Referenced Files
None
Subscribers
None
D40801.diff
View Options
diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh
--- a/tests/sys/netinet6/ndp.sh
+++ b/tests/sys/netinet6/ndp.sh
@@ -57,7 +57,7 @@
atf_check jexec ${jname} ndp -s 2001:db8::2 90:10:00:01:02:03
- t=`jexec ${jname} ndp -an | grep 2001:db8::2 | awk '{print $1, $2, $3, $4}'`
+ t=`jexec ${jname} ndp -an | awk '/2001:db8::2/ {print $1, $2, $3, $4}'`
if [ "${t}" != "2001:db8::2 90:10:00:01:02:03 ${epair0}a permanent" ]; then
atf_fail "Wrong output: ${t}"
fi
diff --git a/tools/test/stress2/misc/all.debug.inc b/tools/test/stress2/misc/all.debug.inc
--- a/tools/test/stress2/misc/all.debug.inc
+++ b/tools/test/stress2/misc/all.debug.inc
@@ -30,62 +30,62 @@
# Example debug include file for misc/all.sh
pre_debug() {
- debug_statfs=`vmstat -m | grep -w statfs | awk '{print $2}'`
- debug_freework=`vmstat -m | grep -w freework | awk '{print $2}'`
- debug_newblk=`vmstat -m | grep -w newblk | awk '{print $2}'`
- debug_pts=`vmstat -m | grep -w pts | awk '{print $2}'`
- debug_routetbl=`vmstat -m | grep -w routetbl | awk '{print $2}'`
- debug_mount=`vmstat -m | awk '/ mount/{print $2}'`
- debug_geom=`vmstat -m | grep -w GEOM | awk '{print $2}'`
-# debug_indirdep=`vmstat -m | grep -w indirdep | awk '{print $2}'`
+ debug_statfs=`vmstat -m | awk '/statfs/ {print $2}'`
+ debug_freework=`vmstat -m | awk '/freework/ {print $2}'`
+ debug_newblk=`vmstat -m | awk '/newblk/ {print $2}'`
+ debug_pts=`vmstat -m | awk '/pts/ {print $2}'`
+ debug_routetbl=`vmstat -m | awk '/routetbl/ {print $2}'`
+ debug_mount=`vmstat -m | awk '/ mount/ {print $2}'`
+ debug_geom=`vmstat -m | awk '/GEOM/ {print $2}'`
+# debug_indirdep=`vmstat -m | awk '/indirdep/ {print $2}'`
}
post_debug() {
local debug_new
- debug_new=`vmstat -m | grep -w statfs | awk '{print $2}'`
+ debug_new=`vmstat -m | awk '/statfs/ {print $2}'`
[ $((debug_new - debug_statfs)) -gt 0 ] &&
{ printf "stress2: statfs leak: %d/%d.\r\n" \
$((debug_new - debug_statfs)) $debug_new > $console
debug_statfs=$debug_new; }
- debug_new=`vmstat -m | grep -w freework | awk '{print $2}'`
+ debug_new=`vmstat -m | awk '/freework/ {print $2}'`
[ $((debug_new - debug_freework)) -gt 0 -a $debug_new -gt 100 ] &&
{ printf "stress2: freework leak: %d/%d.\r\n" \
$((debug_new - debug_freework)) $debug_new > $console
debug_freework=$debug_new; }
- debug_new=`vmstat -m | grep -w newblk | awk '{print $2}'`
+ debug_new=`vmstat -m | awk '/newblk/ {print $2}'`
[ $((debug_new - debug_newblk)) -gt 0 -a $debug_new -gt 100 ] &&
{ printf "stress2: newblk leak: %d/%d.\r\n" \
$((debug_new - debug_newblk)) $debug_new > $console
debug_newblk=$debug_new; }
- debug_new=`vmstat -m | grep -w pts | awk '{print $2}'`
+ debug_new=`vmstat -m | awk '/pts/ {print $2}'`
[ $((debug_new - debug_pts)) -gt 0 ] &&
{ printf "stress2: pts leak: %d/%d\r\n" \
$((debug_new - debug_pts)) $debug_new > $console
debug_pts=$debug_new; }
- debug_new=`vmstat -m | grep -w routetbl | awk '{print $2}'`
+ debug_new=`vmstat -m | awk '/routetbl/ {print $2}'`
[ $((debug_new - debug_routetbl)) -gt 0 ] &&
{ printf "stress2: routetbl leak: %d/%d\r\n" \
$((debug_new - debug_routetbl)) $debug_new > $console
debug_routetbl=$debug_new; }
- debug_new=`vmstat -m | awk '/ mount/{print $2}'`
+ debug_new=`vmstat -m | awk '/ mount/ {print $2}'`
[ $((debug_new - debug_mount)) -gt 0 ] &&
{ printf "stress2: mount leak: %d/%d\r\n" \
$((debug_new - debug_mount)) $debug_new > $console
debug_mount=$debug_new; }
- debug_new=`vmstat -m | awk '/GEOM/{print $2}'`
+ debug_new=`vmstat -m | awk '/GEOM/ {print $2}'`
[ $((debug_new - debug_geom)) -gt 0 ] &&
{ printf "stress2: GEOM leak: %d/%d\r\n" \
$((debug_new - debug_geom)) $debug_new > $console
debug_geom=$debug_new; }
-# debug_new=`vmstat -m | awk '/indirdep/{print $2}'`
+# debug_new=`vmstat -m | awk '/indirdep/ {print $2}'`
# [ $((debug_new - debug_indirdep)) -gt 100 -a $debug_new -gt 100 ] &&
# { printf "stress2: indirdep leak: %d/%d\r\n" \
# $((debug_new - debug_indirdep)) $debug_new > $console
diff --git a/tools/test/stress2/misc/credleak.sh b/tools/test/stress2/misc/credleak.sh
--- a/tools/test/stress2/misc/credleak.sh
+++ b/tools/test/stress2/misc/credleak.sh
@@ -44,7 +44,7 @@
mount -t tmpfs tmpfs $mntpoint
chmod 777 $mntpoint
-old=`vmstat -m | grep -w cred | awk '{print $2}'`
+old=`vmstat -m | awk '/cred/ {print $2}'`
su $testuser -c "/tmp/credleak $mntpoint" &
while kill -0 $! 2>/dev/null; do
@@ -66,7 +66,7 @@
rm -f /tmp/credleak
s=0
-leak=$((`vmstat -m | grep -w cred | awk '{print $2}'` - old))
+leak=$((`vmstat -m | awk '/cred/ {print $2}'` - old))
[ $leak -gt 10 ] && { echo "M_CRED leaked $leak"; s=1; }
exit $s
EOF
diff --git a/tools/test/stress2/misc/dev3.sh b/tools/test/stress2/misc/dev3.sh
--- a/tools/test/stress2/misc/dev3.sh
+++ b/tools/test/stress2/misc/dev3.sh
@@ -46,14 +46,14 @@
#(cd $here/../testcases/swap; ./swap -t 10h -i 20 -l 100) > \
# /dev/null &
-pts=`vmstat -m | grep pts | awk '{print $2}'`
+pts=`vmstat -m | awk '/pts/ {print $2}'`
[ -z "$pts" ] && pts=0
e=0
n=0
while true; do
su $testuser -c "/tmp/dev3 $n"
- new=`vmstat -m | grep pts | awk '{print $2}'`
+ new=`vmstat -m | awk '/pts/ {print $2}'`
if [ $new -gt $pts ]; then
leak=$((new - pts))
printf "flag %d (0x%x) leaks %d pts, %d allocated.\n" $n $n \
diff --git a/tools/test/stress2/misc/graid1_7.sh b/tools/test/stress2/misc/graid1_7.sh
--- a/tools/test/stress2/misc/graid1_7.sh
+++ b/tools/test/stress2/misc/graid1_7.sh
@@ -83,7 +83,7 @@
gmirror forget test
gmirror remove test $u
gmirror insert test $u
- id=`gmirror status test | grep gptid | awk '{print $1}'`
+ id=`gmirror status test | awk '/gptid/ {print $1}'`
if [ $i -eq 1 -a -n "$id" ]; then
echo "FAIL Remove component $id"
gmirror remove test $id
diff --git a/tools/test/stress2/misc/largepage.sh b/tools/test/stress2/misc/largepage.sh
--- a/tools/test/stress2/misc/largepage.sh
+++ b/tools/test/stress2/misc/largepage.sh
@@ -45,7 +45,7 @@
/tmp/largepage
s=$?
-for path in `posixshmcontrol ls | grep largepage | awk '{print $NF}'`; do
+for path in `posixshmcontrol ls | awk '/largepage/ {print $NF}'`; do
echo "posixshmcontrol rm $path"
posixshmcontrol rm $path
done
diff --git a/tools/test/stress2/misc/marcus3.sh b/tools/test/stress2/misc/marcus3.sh
--- a/tools/test/stress2/misc/marcus3.sh
+++ b/tools/test/stress2/misc/marcus3.sh
@@ -43,7 +43,7 @@
{ echo "deadlkres must be disabled for this test."; exit 0; }
n=`find ../testcases -perm -1 -type f | wc -l`
-m=`su $testuser -c "limits | grep maxprocesses | awk '{print \\$NF}'"`
+m=`su $testuser -c "limits | awk '/maxprocesses/ {print \\$NF}'"`
export runRUNTIME=15m
export INCARNATIONS=$((m / n))
export swapINCARNATIONS=$INCARNATIONS
diff --git a/tools/test/stress2/misc/marcus4.sh b/tools/test/stress2/misc/marcus4.sh
--- a/tools/test/stress2/misc/marcus4.sh
+++ b/tools/test/stress2/misc/marcus4.sh
@@ -47,7 +47,7 @@
{ echo "deadlkres must be disabled for this test."; exit 0; }
n=`find ../testcases -perm -1 -type f | wc -l`
-m=`su $testuser -c "limits | grep maxprocesses | awk '{print \\$NF}'"`
+m=`su $testuser -c "limits | awk 'maxprocesses/ {print \\$NF}'"`
m=$((m / 2))
export INCARNATIONS=$((m / n))
diff --git a/tools/test/stress2/misc/mountu.sh b/tools/test/stress2/misc/mountu.sh
--- a/tools/test/stress2/misc/mountu.sh
+++ b/tools/test/stress2/misc/mountu.sh
@@ -47,7 +47,7 @@
pstat() {
local pid
- pid=`ps ax | grep -v grep | grep /tmp/mountu | awk '{print $1}'`
+ pid=`ps ax | awk '/\/tmp\/mountu/ {print $1}'`
[ -n "$pid" ] && procstat -v $pid
}
diff --git a/tools/test/stress2/misc/nullfs7.sh b/tools/test/stress2/misc/nullfs7.sh
--- a/tools/test/stress2/misc/nullfs7.sh
+++ b/tools/test/stress2/misc/nullfs7.sh
@@ -53,7 +53,7 @@
mount -oro -t nullfs $RUNDIR $DST
mount -orw -t nullfs /bin $DST
done
-mount | grep nullfs | awk '{print $3}' | xargs umount
+mount | awk '/nullfs/ {print $3}' | xargs umount
while mount | grep $mntpoint | grep -q /dev/md; do
umount $mntpoint || sleep 1
diff --git a/tools/test/stress2/misc/posix_fadvise.sh b/tools/test/stress2/misc/posix_fadvise.sh
--- a/tools/test/stress2/misc/posix_fadvise.sh
+++ b/tools/test/stress2/misc/posix_fadvise.sh
@@ -35,9 +35,9 @@
sed '1,/^EOF/d' < $odir/$0 > posix_fadvise.c
mycc -o posix_fadvise -Wall -Wextra -O2 -g posix_fadvise.c
-n1=`vmstat -m | grep fadvise | awk '{print $2 + 0}'`
+n1=`vmstat -m | awk '/fadvise/ {print $2 + 0}'`
/tmp/posix_fadvise
-n2=`vmstat -m | grep fadvise | awk '{print $2 + 0}'`
+n2=`vmstat -m | awk '/fadvise/ {print $2 + 0}'`
if [ $((n2 - n1)) -gt 10 ]; then
echo FAIL
vmstat -m | sed -n '1p;/fadvise/p'
diff --git a/tools/test/stress2/misc/pts2.sh b/tools/test/stress2/misc/pts2.sh
--- a/tools/test/stress2/misc/pts2.sh
+++ b/tools/test/stress2/misc/pts2.sh
@@ -40,11 +40,11 @@
mycc -o pts2 -Wall -Wextra -O2 pts2.c || exit 1
rm -f pts2.c
-pts=`vmstat -m | grep pts | awk '{print $2}'`
+pts=`vmstat -m | awk '/pts/ {print $2}'`
for i in `jot 10`; do
/tmp/pts2
done
-new=`vmstat -m | grep pts | awk '{print $2}'`
+new=`vmstat -m | awk '/pts/ {print $2}'`
s=0
[ $((new - pts)) -gt 1 ] && { s=1; echo "Leaked $((new - pts)) pts."; }
diff --git a/tools/test/stress2/misc/radix.sh b/tools/test/stress2/misc/radix.sh
--- a/tools/test/stress2/misc/radix.sh
+++ b/tools/test/stress2/misc/radix.sh
@@ -184,7 +184,7 @@
FILE *f;
int r;
- if ((f = popen("vmstat -z | grep RADIX | awk -F',' '{print $3}'", "r")) == NULL)
+ if ((f = popen("vmstat -z | awk -F',' '/RADIX/ {print $3}'", "r")) == NULL)
err(1, "popen");
fscanf(f, "%d", &r);
pclose(f);
diff --git a/tools/test/stress2/misc/routetbl.sh b/tools/test/stress2/misc/routetbl.sh
--- a/tools/test/stress2/misc/routetbl.sh
+++ b/tools/test/stress2/misc/routetbl.sh
@@ -39,14 +39,14 @@
mdconfig -a -t swap -s 128m -u $mdstart || exit 1
newfs $newfs_flags md$mdstart > /dev/null
-routetbl=`vmstat -m | grep routetbl | awk '{print $2}'`
+routetbl=`vmstat -m | awk '/routetbl/ {print $2}'`
s=0
start=`date +%s`
while [ $((`date +%s` - start)) -lt 60 ]; do
mount /dev/md$mdstart $mntpoint &&
umount $mntpoint
done
-routetbl=$((`vmstat -m | grep routetbl | awk '{print $2}'` - routetbl))
+routetbl=$((`vmstat -m | awk '/routetbl/ {print $2}'` - routetbl))
[ $routetbl -gt 0 ] &&
{ echo "routetbl grew $routetbl"; s=1; }
diff --git a/tools/test/stress2/misc/sched.sh b/tools/test/stress2/misc/sched.sh
--- a/tools/test/stress2/misc/sched.sh
+++ b/tools/test/stress2/misc/sched.sh
@@ -52,7 +52,7 @@
(cd $mntpoint; /tmp/sched $((cpus + 1))) > /dev/null 2>&1 &
sleep 30
export LANG=C
-top -U nobody -d 1 | grep nobody | awk '{print $11}' | sed 's/%//' |
+top -U nobody -d 1 | awk '/nobody/ {print $11}' | sed 's/%//' |
ministat -A -w 73 | tail -1 | awk '{if ($NF > 1.0) exit 1}' ||
{ echo Broken; top -U nobody -d 1 | grep nobody; }
killall sched
diff --git a/tools/test/stress2/misc/select3.sh b/tools/test/stress2/misc/select3.sh
--- a/tools/test/stress2/misc/select3.sh
+++ b/tools/test/stress2/misc/select3.sh
@@ -28,9 +28,9 @@
# Check if M_SELECT leaks: nselect > threads
-m=`vmstat -m | grep -w select | awk '{print $2}'`
-threads=`vmstat -z | sed 's/,/ /g' | grep THREAD | awk '{print $4}'`
-free=`vmstat -z | sed 's/,/ /g' | grep THREAD | awk '{print $5}'`
+m=`vmstat -m | awk '/select/ {print $2}'`
+threads=`vmstat -z | sed 's/,/ /g' | awk 'THREAD/ {print $4}'`
+free=`vmstat -z | sed 's/,/ /g' | awk '/THREAD/ {print $5}'`
[ $m -le $((threads + free)) ] && exit 0
echo FAIL
diff --git a/tools/test/stress2/misc/signal.sh b/tools/test/stress2/misc/signal.sh
--- a/tools/test/stress2/misc/signal.sh
+++ b/tools/test/stress2/misc/signal.sh
@@ -223,8 +223,8 @@
if [ -n "$pid" ]; then
procstat -t $pid > pstat
- t1=`grep fifo pstat | awk '{print $2}'`
- t2=`grep umtxn pstat | awk '{print $2}' | tail -1`
+ t1=`awk '/fifo/ {print $2}' pstat`
+ t2=`awk '/umtxn/ {print $2}' pstat | tail -1`
set -e
./tkill $pid $t1 5 # SIGTRAP
diff --git a/tools/test/stress2/misc/syscall5.sh b/tools/test/stress2/misc/syscall5.sh
--- a/tools/test/stress2/misc/syscall5.sh
+++ b/tools/test/stress2/misc/syscall5.sh
@@ -33,7 +33,7 @@
. ../default.cfg
-syscall=`grep SYS_MAXSYSCALL /usr/include/sys/syscall.h | awk '{print $NF}'`
+syscall=`awk '/SYS_MAXSYSCALL/ {print $NF}' /usr/include/sys/syscall.h`
syscall=$((syscall - 1))
esyscall=0
@@ -73,7 +73,7 @@
n=$syscall
start=`date '+%s'`
while [ $n -gt 0 ]; do
- ps -lUnobody | grep syscall4 | awk '{print $2}' | xargs kill
+ ps -lUnobody | awk '/syscall4/ {print $2}' | xargs kill
ln -fs $n $last
name=`grep -w "$n$" /usr/include/sys/syscall.h | awk '{print $2}' |
sed 's/SYS_//'`
diff --git a/tools/test/stress2/misc/tcp.sh b/tools/test/stress2/misc/tcp.sh
--- a/tools/test/stress2/misc/tcp.sh
+++ b/tools/test/stress2/misc/tcp.sh
@@ -44,7 +44,7 @@
chmod 777 $RUNDIR
export runRUNTIME=15m
export tcpLOAD=100
-n=`su $testuser -c "limits | grep maxprocesses | awk '{print \\$NF}'"`
+n=`su $testuser -c "limits | awk '/maxprocesses/ {print \\$NF}'"`
n=$((n - `ps aux | wc -l`))
export tcpINCARNATIONS=$((n / 2 - 400))
[ $tcpINCARNATIONS -le 0 ] && exit 0
diff --git a/tools/test/stress2/misc/tcp2.sh b/tools/test/stress2/misc/tcp2.sh
--- a/tools/test/stress2/misc/tcp2.sh
+++ b/tools/test/stress2/misc/tcp2.sh
@@ -43,7 +43,7 @@
export runRUNTIME=15m
export tcpLOAD=100
export swapLOAD=100
-n=`su $testuser -c "limits | grep maxprocesses | awk '{print \\$NF}'"`
+n=`su $testuser -c "limits | awk '/maxprocesses/ {print \\$NF}'"`
[ $n -gt 50000 ] && n=50000
n=$((n - `ps aux | wc -l`))
export tcpINCARNATIONS=$((n / 2 - 400))
diff --git a/tools/test/stress2/misc/trim6.sh b/tools/test/stress2/misc/trim6.sh
--- a/tools/test/stress2/misc/trim6.sh
+++ b/tools/test/stress2/misc/trim6.sh
@@ -39,7 +39,7 @@
[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1
-r=`mount | grep -w soft-updates | awk '{print $1}' | while read dev; do
+r=`mount | awk '/soft-updates/ {print $1}' | while read dev; do
dumpfs $dev | head -20 | grep -qw trim || continue
df -k $dev
done | sort -rn +3 | head -1 | awk '{print $4, $6}'`
diff --git a/tools/test/stress2/misc/trim7.sh b/tools/test/stress2/misc/trim7.sh
--- a/tools/test/stress2/misc/trim7.sh
+++ b/tools/test/stress2/misc/trim7.sh
@@ -38,7 +38,7 @@
mount | grep -q /media ||
echo "Prerequisite: /media is a TRIM enabled file system."
-r=`mount | grep -w soft-updates | awk '{print $1}' | while read dev; do
+r=`mount | awk '/soft-updates/ {print $1}' | while read dev; do
dumpfs $dev | grep -m1 flags | grep -qw trim || continue
df -k $dev
done | sort -rn +3 | head -1 | awk '{print $4, $6}'`
diff --git a/tools/test/stress2/misc/vfork.sh b/tools/test/stress2/misc/vfork.sh
--- a/tools/test/stress2/misc/vfork.sh
+++ b/tools/test/stress2/misc/vfork.sh
@@ -121,7 +121,7 @@
./vfork1 &
sleep .2
childpid=`ps -lx | grep -v grep | grep vfork1 |
- tail -1 | grep nanslp | awk '{print $2}'`
+ tail -1 | awk '/nanslp/ {print $2}'`
# Seen before fix:
# failed to set signal flags properly for ast()
./vfork2 $childpid
diff --git a/tools/test/stress2/tools/splitall.sh b/tools/test/stress2/tools/splitall.sh
--- a/tools/test/stress2/tools/splitall.sh
+++ b/tools/test/stress2/tools/splitall.sh
@@ -41,7 +41,7 @@
cd ../misc
exclude=`cat all.exclude $alllocal 2>/dev/null | sed '/^#/d' |
- grep "\.sh" | awk '{print $1}'`
+ awk '/\.sh/ {print $1}'`
list=$(echo `ls *.sh` | sed "s/all\.sh//; s/cleanup\.sh//")
diff --git a/tools/tools/zfsboottest/zfsboottest.sh b/tools/tools/zfsboottest/zfsboottest.sh
--- a/tools/tools/zfsboottest/zfsboottest.sh
+++ b/tools/tools/zfsboottest/zfsboottest.sh
@@ -50,7 +50,7 @@
echo "No such pool \"${pool}\"." >&2
exit 1
fi
-bootfs=`zpool get bootfs "${pool}" | tail -1 | awk '{print $3}'`
+bootfs=`zpool get -Ho value bootfs "${pool}"`
if [ "${bootfs}" = "-" ]; then
bootfs="${pool}"
fi
@@ -64,7 +64,7 @@
exit 1
fi
vdevs=""
-for vdev in `zpool status "${pool}" | grep ONLINE | awk '{print $1}'`; do
+for vdev in `zpool status "${pool}" | awk '/ONLINE/ {print $1}'`; do
vdev="/dev/${vdev#/dev/}"
if [ -c "${vdev}" ]; then
if [ -z "${vdevs}" ]; then
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 9:25 PM (20 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16104629
Default Alt Text
D40801.diff (16 KB)
Attached To
Mode
D40801: Reduce "grep foo | awk" chain of pipes to "awk /foo/"
Attached
Detach File
Event Timeline
Log In to Comment