blob: 9e34656bf659f3a139f549e041d012089abb81f0 [file] [log] [blame]
Paul E. McKenney2193e162014-02-07 15:16:25 -08001#!/bin/bash
2#
3# Analyze a given results directory for rcutorture progress.
4#
Pranith Kumar3327d922014-07-11 19:47:35 -04005# Usage: kvm-recheck-rcu.sh resdir
Paul E. McKenney2193e162014-02-07 15:16:25 -08006#
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
25i="$1"
SeongJae Park81394e32017-11-03 19:17:25 +090026if test -d "$i" -a -r "$i"
Paul E. McKenney2193e162014-02-07 15:16:25 -080027then
28 :
29else
30 echo Unreadable results directory: $i
31 exit 1
32fi
Paul E. McKenney79619cf2014-11-17 10:12:27 -080033. tools/testing/selftests/rcutorture/bin/functions.sh
Paul E. McKenney2193e162014-02-07 15:16:25 -080034
35configfile=`echo $i | sed -e 's/^.*\///'`
36ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
37if test -z "$ngps"
38then
Paul E. McKenney9eb97fe2014-03-17 13:42:33 -070039 echo "$configfile -------"
Paul E. McKenney2193e162014-02-07 15:16:25 -080040else
41 title="$configfile ------- $ngps grace periods"
42 dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
43 if test -z "$dur"
44 then
45 :
46 else
47 ngpsps=`awk -v ngps=$ngps -v dur=$dur '
48 BEGIN { print ngps / dur }' < /dev/null`
49 title="$title ($ngpsps per second)"
50 fi
51 echo $title
Paul E. McKenney79619cf2014-11-17 10:12:27 -080052 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}'`
53 if test -z "$nclosecalls"
54 then
55 exit 0
56 fi
57 if test "$nclosecalls" -eq 0
58 then
59 exit 0
60 fi
61 # Compute number of close calls per tenth of an hour
62 nclosecalls10=`awk -v nclosecalls=$nclosecalls -v dur=$dur 'BEGIN { print int(nclosecalls * 36000 / dur) }' < /dev/null`
63 if test $nclosecalls10 -gt 5 -a $nclosecalls -gt 1
64 then
65 print_bug $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i
66 else
67 print_warning $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i
68 fi
Paul E. McKenney2193e162014-02-07 15:16:25 -080069fi