Skip to content

Commit eeb4dd9

Browse files
seehearfeelpaulmckrcu
authored andcommitted
selftests: rcutorture: Use "grep -E" instead of "egrep"
The latest version of grep is deprecating the egrep command, so that its output contains warnings as follows: egrep: warning: egrep is obsolescent; using grep -E Fix this using "grep -E" instead. sed -i "s/egrep/grep -E/g" `grep egrep -rwl tools/testing/selftests/rcutorture` Here are the steps to install the latest grep: wget http://ftp.gnu.org/gnu/grep/grep-3.8.tar.gz tar xf grep-3.8.tar.gz cd grep-3.8 && ./configure && make sudo make install export PATH=/usr/local/bin:$PATH Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 3e4c07b commit eeb4dd9

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

tools/testing/selftests/rcutorture/bin/console-badness.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# Authors: Paul E. McKenney <paulmck@kernel.org>
1212

13-
egrep 'Badness|WARNING:|Warn|BUG|===========|BUG: KCSAN:|Call Trace:|Oops:|detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state|rcu_.*kthread starved for|!!!' |
13+
grep -E 'Badness|WARNING:|Warn|BUG|===========|BUG: KCSAN:|Call Trace:|Oops:|detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state|rcu_.*kthread starved for|!!!' |
1414
grep -v 'ODEBUG: ' |
1515
grep -v 'This means that this is a DEBUG kernel and it is' |
1616
grep -v 'Warning: unable to open an initial console' |

tools/testing/selftests/rcutorture/bin/kvm-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ fi
4444
ncpus="`getconf _NPROCESSORS_ONLN`"
4545
make -j$((2 * ncpus)) $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
4646
retval=$?
47-
if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $resdir/Make.out
47+
if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | grep -E -q "Stop|Error|error:|warning:" || grep -E -q "Stop|Error|error:" < $resdir/Make.out
4848
then
4949
echo Kernel build error
50-
egrep "Stop|Error|error:|warning:" < $resdir/Make.out
50+
grep -E "Stop|Error|error:|warning:" < $resdir/Make.out
5151
echo Run aborted.
5252
exit 3
5353
fi

tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ for i in ${rundir}/*/Make.out
3232
do
3333
scenariodir="`dirname $i`"
3434
scenariobasedir="`echo ${scenariodir} | sed -e 's/\.[0-9]*$//'`"
35-
if egrep -q "error:|warning:|^ld: .*undefined reference to" < $i
35+
if grep -E -q "error:|warning:|^ld: .*undefined reference to" < $i
3636
then
37-
egrep "error:|warning:|^ld: .*undefined reference to" < $i > $i.diags
37+
grep -E "error:|warning:|^ld: .*undefined reference to" < $i > $i.diags
3838
files="$files $i.diags $i"
3939
elif ! test -f ${scenariobasedir}/vmlinux && ! test -f ${scenariobasedir}/vmlinux.xz && ! test -f "${rundir}/re-run"
4040
then

tools/testing/selftests/rcutorture/bin/kvm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ awk < $T/cfgcpu.pack \
585585
echo kvm-end-run-stats.sh "$resdir/$ds" "$starttime" >> $T/script
586586

587587
# Extract the tests and their batches from the script.
588-
egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" |
588+
grep -E 'Start batch|Starting build\.' $T/script | grep -v ">>" |
589589
sed -e 's/:.*$//' -e 's/^echo //' -e 's/-ovf//' |
590590
awk '
591591
/^----Start/ {
@@ -622,7 +622,7 @@ then
622622
elif test "$dryrun" = sched
623623
then
624624
# Extract the test run schedule from the script.
625-
egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" |
625+
grep -E 'Start batch|Starting build\.' $T/script | grep -v ">>" |
626626
sed -e 's/:.*$//' -e 's/^echo //'
627627
nbuilds="`grep 'Starting build\.' $T/script |
628628
grep -v ">>" | sed -e 's/:.*$//' -e 's/^echo //' |

tools/testing/selftests/rcutorture/bin/parse-console.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ then
6565
fi
6666

6767
grep --binary-files=text 'torture:.*ver:' $file |
68-
egrep --binary-files=text -v '\(null\)|rtc: 000000000* ' |
68+
grep -E --binary-files=text -v '\(null\)|rtc: 000000000* ' |
6969
sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
7070
sed -e 's/^.*ver: //' |
7171
awk '
@@ -128,17 +128,17 @@ then
128128
then
129129
summary="$summary Badness: $n_badness"
130130
fi
131-
n_warn=`grep -v 'Warning: unable to open an initial console' $file | grep -v 'Warning: Failed to add ttynull console. No stdin, stdout, and stderr for the init process' | egrep -c 'WARNING:|Warn'`
131+
n_warn=`grep -v 'Warning: unable to open an initial console' $file | grep -v 'Warning: Failed to add ttynull console. No stdin, stdout, and stderr for the init process' | grep -E -c 'WARNING:|Warn'`
132132
if test "$n_warn" -ne 0
133133
then
134134
summary="$summary Warnings: $n_warn"
135135
fi
136-
n_bugs=`egrep -c '\bBUG|Oops:' $file`
136+
n_bugs=`grep -E -c '\bBUG|Oops:' $file`
137137
if test "$n_bugs" -ne 0
138138
then
139139
summary="$summary Bugs: $n_bugs"
140140
fi
141-
n_kcsan=`egrep -c 'BUG: KCSAN: ' $file`
141+
n_kcsan=`grep -E -c 'BUG: KCSAN: ' $file`
142142
if test "$n_kcsan" -ne 0
143143
then
144144
if test "$n_bugs" = "$n_kcsan"
@@ -158,7 +158,7 @@ then
158158
then
159159
summary="$summary lockdep: $n_badness"
160160
fi
161-
n_stalls=`egrep -c 'detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state' $file`
161+
n_stalls=`grep -E -c 'detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state' $file`
162162
if test "$n_stalls" -ne 0
163163
then
164164
summary="$summary Stalls: $n_stalls"

0 commit comments

Comments
 (0)