.. | .. |
---|
1 | 1 | #!/bin/bash |
---|
| 2 | +# SPDX-License-Identifier: GPL-2.0+ |
---|
2 | 3 | # |
---|
3 | 4 | # Analyze a given results directory for rcutorture progress. |
---|
4 | 5 | # |
---|
5 | 6 | # Usage: kvm-recheck-rcu.sh resdir |
---|
6 | 7 | # |
---|
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 | 8 | # Copyright (C) IBM Corporation, 2014 |
---|
22 | 9 | # |
---|
23 | | -# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> |
---|
| 10 | +# Authors: Paul E. McKenney <paulmck@linux.ibm.com> |
---|
24 | 11 | |
---|
25 | 12 | i="$1" |
---|
26 | 13 | if test -d "$i" -a -r "$i" |
---|
.. | .. |
---|
38 | 25 | tail -1 | sed -e 's/^\[[ 0-9.]*] //' | |
---|
39 | 26 | awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' | |
---|
40 | 27 | tr -d '\012\015'`" |
---|
| 28 | +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 }'`" |
---|
41 | 29 | if test -z "$ngps" |
---|
42 | 30 | then |
---|
43 | 31 | echo "$configfile ------- " $stopstate |
---|
.. | .. |
---|
52 | 40 | BEGIN { print ngps / dur }' < /dev/null` |
---|
53 | 41 | title="$title ($ngpsps/s)" |
---|
54 | 42 | fi |
---|
55 | | - echo $title $stopstate |
---|
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}'` |
---|
| 43 | + echo $title $stopstate $fwdprog |
---|
| 44 | + nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | \ |
---|
| 45 | + awk -v sum=0 ' |
---|
| 46 | + { |
---|
| 47 | + for (i = 0; i <= NF; i++) { |
---|
| 48 | + sum += $i; |
---|
| 49 | + if ($i ~ /Batch:/) { |
---|
| 50 | + sum = 0; |
---|
| 51 | + i = i + 2; |
---|
| 52 | + } |
---|
| 53 | + } |
---|
| 54 | + } |
---|
| 55 | + |
---|
| 56 | + END { |
---|
| 57 | + print sum |
---|
| 58 | + }'` |
---|
57 | 59 | if test -z "$nclosecalls" |
---|
58 | 60 | then |
---|
59 | 61 | exit 0 |
---|