]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
selftests: rcutorture: Use "grep -E" instead of "egrep"
authorTiezhu Yang <yangtiezhu@loongson.cn>
Wed, 23 Nov 2022 01:03:28 +0000 (09:03 +0800)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Jan 2023 01:53:31 +0000 (17:53 -0800)
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>
tools/testing/selftests/rcutorture/bin/console-badness.sh
tools/testing/selftests/rcutorture/bin/kvm-build.sh
tools/testing/selftests/rcutorture/bin/kvm-find-errors.sh
tools/testing/selftests/rcutorture/bin/kvm.sh
tools/testing/selftests/rcutorture/bin/parse-console.sh

index 69f8a5958cefc7b813457a799e81c1f549cbcb65..aad51e7c0183df85a18b9be766d001305e917b3f 100755 (executable)
@@ -10,7 +10,7 @@
 #
 # Authors: Paul E. McKenney <paulmck@kernel.org>
 
-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|!!!' |
+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|!!!' |
 grep -v 'ODEBUG: ' |
 grep -v 'This means that this is a DEBUG kernel and it is' |
 grep -v 'Warning: unable to open an initial console' |
index e28a82851f7c4a82709d0cf1483680399a3ca5c4..11f8d232b0ee74b61953bb156feece6e882f1b80 100755 (executable)
@@ -44,10 +44,10 @@ fi
 ncpus="`getconf _NPROCESSORS_ONLN`"
 make -j$((2 * ncpus)) $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
 retval=$?
-if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $resdir/Make.out
+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
 then
        echo Kernel build error
-       egrep "Stop|Error|error:|warning:" < $resdir/Make.out
+       grep -E "Stop|Error|error:|warning:" < $resdir/Make.out
        echo Run aborted.
        exit 3
 fi
index d4dc059843a432893515d84ea6243eb8d80cd319..28981007465bda76bfce1b1ee73ddf7ab1f24c40 100755 (executable)
@@ -32,9 +32,9 @@ for i in ${rundir}/*/Make.out
 do
        scenariodir="`dirname $i`"
        scenariobasedir="`echo ${scenariodir} | sed -e 's/\.[0-9]*$//'`"
-       if egrep -q "error:|warning:|^ld: .*undefined reference to" < $i
+       if grep -E -q "error:|warning:|^ld: .*undefined reference to" < $i
        then
-               egrep "error:|warning:|^ld: .*undefined reference to" < $i > $i.diags
+               grep -E "error:|warning:|^ld: .*undefined reference to" < $i > $i.diags
                files="$files $i.diags $i"
        elif ! test -f ${scenariobasedir}/vmlinux && ! test -f ${scenariobasedir}/vmlinux.xz && ! test -f "${rundir}/re-run"
        then
index 7710b1e1cddabefe0769da40e7db760557d044ad..3025a949bc99ec3fc9d0172d536c0d0a6c2c6c98 100755 (executable)
@@ -585,7 +585,7 @@ awk < $T/cfgcpu.pack \
 echo kvm-end-run-stats.sh "$resdir/$ds" "$starttime" >> $T/script
 
 # Extract the tests and their batches from the script.
-egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" |
+grep -E 'Start batch|Starting build\.' $T/script | grep -v ">>" |
        sed -e 's/:.*$//' -e 's/^echo //' -e 's/-ovf//' |
        awk '
        /^----Start/ {
@@ -622,7 +622,7 @@ then
 elif test "$dryrun" = sched
 then
        # Extract the test run schedule from the script.
-       egrep 'Start batch|Starting build\.' $T/script | grep -v ">>" |
+       grep -E 'Start batch|Starting build\.' $T/script | grep -v ">>" |
                sed -e 's/:.*$//' -e 's/^echo //'
        nbuilds="`grep 'Starting build\.' $T/script |
                  grep -v ">>" | sed -e 's/:.*$//' -e 's/^echo //' |
index 822eb037a057345e244ff4bafea10db8bc358de6..9ab0f6bc172cd2c49468bf036356f6c554d55ab8 100755 (executable)
@@ -65,7 +65,7 @@ then
        fi
 
        grep --binary-files=text 'torture:.*ver:' $file |
-       egrep --binary-files=text -v '\(null\)|rtc: 000000000* ' |
+       grep -E --binary-files=text -v '\(null\)|rtc: 000000000* ' |
        sed -e 's/^(initramfs)[^]]*] //' -e 's/^\[[^]]*] //' |
        sed -e 's/^.*ver: //' |
        awk '
@@ -128,17 +128,17 @@ then
        then
                summary="$summary  Badness: $n_badness"
        fi
-       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'`
+       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'`
        if test "$n_warn" -ne 0
        then
                summary="$summary  Warnings: $n_warn"
        fi
-       n_bugs=`egrep -c '\bBUG|Oops:' $file`
+       n_bugs=`grep -E -c '\bBUG|Oops:' $file`
        if test "$n_bugs" -ne 0
        then
                summary="$summary  Bugs: $n_bugs"
        fi
-       n_kcsan=`egrep -c 'BUG: KCSAN: ' $file`
+       n_kcsan=`grep -E -c 'BUG: KCSAN: ' $file`
        if test "$n_kcsan" -ne 0
        then
                if test "$n_bugs" = "$n_kcsan"
@@ -158,7 +158,7 @@ then
        then
                summary="$summary  lockdep: $n_badness"
        fi
-       n_stalls=`egrep -c 'detected stalls on CPUs/tasks:|self-detected stall on CPU|Stall ended before state dump start|\?\?\? Writer stall state' $file`
+       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`
        if test "$n_stalls" -ne 0
        then
                summary="$summary  Stalls: $n_stalls"