Paul E. McKenney | 2193e16 | 2014-02-07 15:16:25 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Analyze a given results directory for rcutorture progress. |
| 4 | # |
Pranith Kumar | 3327d92 | 2014-07-11 19:47:35 -0400 | [diff] [blame] | 5 | # Usage: kvm-recheck-rcu.sh resdir |
Paul E. McKenney | 2193e16 | 2014-02-07 15:16:25 -0800 | [diff] [blame] | 6 | # |
| 7 | # This program is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 2 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | # This program is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with this program; if not, you can access it online at |
| 19 | # http://www.gnu.org/licenses/gpl-2.0.html. |
| 20 | # |
| 21 | # Copyright (C) IBM Corporation, 2014 |
| 22 | # |
| 23 | # Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
| 24 | |
| 25 | i="$1" |
SeongJae Park | 81394e3 | 2017-11-03 19:17:25 +0900 | [diff] [blame] | 26 | if test -d "$i" -a -r "$i" |
Paul E. McKenney | 2193e16 | 2014-02-07 15:16:25 -0800 | [diff] [blame] | 27 | then |
| 28 | : |
| 29 | else |
| 30 | echo Unreadable results directory: $i |
| 31 | exit 1 |
| 32 | fi |
SeongJae Park | feef2d2 | 2017-11-03 19:17:28 +0900 | [diff] [blame] | 33 | . functions.sh |
Paul E. McKenney | 2193e16 | 2014-02-07 15:16:25 -0800 | [diff] [blame] | 34 | |
| 35 | configfile=`echo $i | sed -e 's/^.*\///'` |
| 36 | ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'` |
Paul E. McKenney | 413e551 | 2018-04-19 08:57:36 -0700 | [diff] [blame^] | 37 | stopstate="`grep 'End-test grace-period state: g' $i/console.log 2> /dev/null | |
| 38 | tail -1 | sed -e 's/^\[[ 0-9.]*] //' | |
| 39 | awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' | |
| 40 | tr -d '\012\015'`" |
Paul E. McKenney | 2193e16 | 2014-02-07 15:16:25 -0800 | [diff] [blame] | 41 | if test -z "$ngps" |
| 42 | then |
Paul E. McKenney | 413e551 | 2018-04-19 08:57:36 -0700 | [diff] [blame^] | 43 | echo "$configfile ------- " $stopstate |
Paul E. McKenney | 2193e16 | 2014-02-07 15:16:25 -0800 | [diff] [blame] | 44 | else |
| 45 | title="$configfile ------- $ngps grace periods" |
| 46 | dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null` |
| 47 | if test -z "$dur" |
| 48 | then |
| 49 | : |
| 50 | else |
| 51 | ngpsps=`awk -v ngps=$ngps -v dur=$dur ' |
| 52 | BEGIN { print ngps / dur }' < /dev/null` |
| 53 | title="$title ($ngpsps per second)" |
| 54 | fi |
Paul E. McKenney | 413e551 | 2018-04-19 08:57:36 -0700 | [diff] [blame^] | 55 | echo $title $stopstate |
Paul E. McKenney | 79619cf | 2014-11-17 10:12:27 -0800 | [diff] [blame] | 56 | nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | awk '{for (i=NF-8;i<=NF;i++) sum+=$i; } END {print sum}'` |
| 57 | if test -z "$nclosecalls" |
| 58 | then |
| 59 | exit 0 |
| 60 | fi |
| 61 | if test "$nclosecalls" -eq 0 |
| 62 | then |
| 63 | exit 0 |
| 64 | fi |
| 65 | # Compute number of close calls per tenth of an hour |
| 66 | nclosecalls10=`awk -v nclosecalls=$nclosecalls -v dur=$dur 'BEGIN { print int(nclosecalls * 36000 / dur) }' < /dev/null` |
| 67 | if test $nclosecalls10 -gt 5 -a $nclosecalls -gt 1 |
| 68 | then |
| 69 | print_bug $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i |
| 70 | else |
| 71 | print_warning $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i |
| 72 | fi |
Paul E. McKenney | 2193e16 | 2014-02-07 15:16:25 -0800 | [diff] [blame] | 73 | fi |