treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / tools / testing / selftests / rcutorture / bin / kvm-recheck-lock.sh
blobf3a7a5e2b89d49a0752a0714f64714f7eaf50b6d
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0+
4 # Analyze a given results directory for locktorture progress.
6 # Usage: kvm-recheck-lock.sh resdir
8 # Copyright (C) IBM Corporation, 2014
10 # Authors: Paul E. McKenney <paulmck@linux.ibm.com>
12 i="$1"
13 if test -d "$i" -a -r "$i"
14 then
16 else
17 echo Unreadable results directory: $i
18 exit 1
21 configfile=`echo $i | sed -e 's/^.*\///'`
22 ncs=`grep "Writes: Total:" $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* Total: //' -e 's/ .*$//'`
23 if test -z "$ncs"
24 then
25 echo "$configfile -------"
26 else
27 title="$configfile ------- $ncs acquisitions/releases"
28 dur=`sed -e 's/^.* locktorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
29 if test -z "$dur"
30 then
32 else
33 ncsps=`awk -v ncs=$ncs -v dur=$dur '
34 BEGIN { print ncs / dur }' < /dev/null`
35 title="$title ($ncsps per second)"
37 echo $title