forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
....@@ -1,26 +1,13 @@
11 #!/bin/bash
2
+# SPDX-License-Identifier: GPL-2.0+
23 #
34 # Analyze a given results directory for rcutorture progress.
45 #
56 # Usage: kvm-recheck-rcu.sh resdir
67 #
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
-#
218 # Copyright (C) IBM Corporation, 2014
229 #
23
-# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
10
+# Authors: Paul E. McKenney <paulmck@linux.ibm.com>
2411
2512 i="$1"
2613 if test -d "$i" -a -r "$i"
....@@ -38,6 +25,7 @@
3825 tail -1 | sed -e 's/^\[[ 0-9.]*] //' |
3926 awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' |
4027 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 }'`"
4129 if test -z "$ngps"
4230 then
4331 echo "$configfile ------- " $stopstate
....@@ -52,8 +40,22 @@
5240 BEGIN { print ngps / dur }' < /dev/null`
5341 title="$title ($ngpsps/s)"
5442 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
+ }'`
5759 if test -z "$nclosecalls"
5860 then
5961 exit 0