2014-02-07 15:16:25 -08:00
#!/bin/bash
2019-02-11 07:14:09 -08:00
# SPDX-License-Identifier: GPL-2.0+
2014-02-07 15:16:25 -08:00
#
# Analyze a given results directory for rcutorture progress.
#
2014-07-11 19:47:35 -04:00
# Usage: kvm-recheck-rcu.sh resdir
2014-02-07 15:16:25 -08:00
#
# Copyright (C) IBM Corporation, 2014
#
2019-02-11 07:14:09 -08:00
# Authors: Paul E. McKenney <paulmck@linux.ibm.com>
2014-02-07 15:16:25 -08:00
i = " $1 "
2017-11-03 19:17:25 +09:00
if test -d " $i " -a -r " $i "
2014-02-07 15:16:25 -08:00
then
:
else
echo Unreadable results directory: $i
exit 1
fi
2017-11-03 19:17:28 +09:00
. functions.sh
2014-02-07 15:16:25 -08:00
configfile = ` echo $i | sed -e 's/^.*\///' `
ngps = ` grep ver: $i /console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//' `
2018-04-19 08:57:36 -07:00
stopstate = " `grep 'End-test grace-period state: g' $i /console.log 2> /dev/null |
tail -1 | sed -e 's/^\[[ 0-9.]*] //' |
awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' |
tr -d '\012\015' ` "
2019-11-04 12:02:12 -08:00
fwdprog = " `grep 'rcu_torture_fwd_prog_cr Duration' $i /console.log 2> /dev/null | sed -e 's/^\[[^]]*] //' | sort -k15nr | head -1 | awk '{ print $14 " " $15 }'` "
2014-02-07 15:16:25 -08:00
if test -z " $ngps "
then
2018-04-19 08:57:36 -07:00
echo " $configfile ------- " $stopstate
2014-02-07 15:16:25 -08:00
else
2018-04-19 09:44:01 -07:00
title = " $configfile ------- $ngps GPs "
2021-03-14 15:19:59 -07:00
dur = ` grep -v '^#' $i /qemu-cmd | sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' `
2014-02-07 15:16:25 -08:00
if test -z " $dur "
then
:
else
ngpsps = ` awk -v ngps = $ngps -v dur = $dur '
BEGIN { print ngps / dur } ' < /dev/null`
2018-04-19 09:44:01 -07:00
title = " $title ( $ngpsps /s) "
2014-02-07 15:16:25 -08:00
fi
2019-11-04 12:02:12 -08:00
echo $title $stopstate $fwdprog
2020-02-14 14:43:44 -08:00
nclosecalls = ` grep --binary-files= text 'torture: Reader Batch' $i /console.log | tail -1 | \
awk -v sum = 0 '
{
for ( i = 0; i <= NF; i++) {
sum += $i ;
if ( $i ~ /Batch:/) {
sum = 0;
i = i + 2;
}
}
}
END {
print sum
} ' `
2014-11-17 10:12:27 -08:00
if test -z " $nclosecalls "
then
exit 0
fi
if test " $nclosecalls " -eq 0
then
exit 0
fi
# Compute number of close calls per tenth of an hour
nclosecalls10 = ` awk -v nclosecalls = $nclosecalls -v dur = $dur 'BEGIN { print int(nclosecalls * 36000 / dur) }' < /dev/null`
if test $nclosecalls10 -gt 5 -a $nclosecalls -gt 1
then
print_bug $nclosecalls "Reader Batch close calls in" $(( $dur / 60 )) minute run: $i
else
print_warning $nclosecalls "Reader Batch close calls in" $(( $dur / 60 )) minute run: $i
fi
2018-05-03 14:41:54 -07:00
echo $nclosecalls "Reader Batch close calls in" $(( $dur / 60 )) minute run: $i > $i /console.log.rcu.diags
2014-02-07 15:16:25 -08:00
fi