18c2ecf20Sopenharmony_ci#!/bin/bash 28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0+ 38c2ecf20Sopenharmony_ci# 48c2ecf20Sopenharmony_ci# Analyze a given results directory for rcutorture progress. 58c2ecf20Sopenharmony_ci# 68c2ecf20Sopenharmony_ci# Usage: kvm-recheck-rcu.sh resdir 78c2ecf20Sopenharmony_ci# 88c2ecf20Sopenharmony_ci# Copyright (C) IBM Corporation, 2014 98c2ecf20Sopenharmony_ci# 108c2ecf20Sopenharmony_ci# Authors: Paul E. McKenney <paulmck@linux.ibm.com> 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_cii="$1" 138c2ecf20Sopenharmony_ciif test -d "$i" -a -r "$i" 148c2ecf20Sopenharmony_cithen 158c2ecf20Sopenharmony_ci : 168c2ecf20Sopenharmony_cielse 178c2ecf20Sopenharmony_ci echo Unreadable results directory: $i 188c2ecf20Sopenharmony_ci exit 1 198c2ecf20Sopenharmony_cifi 208c2ecf20Sopenharmony_ci. functions.sh 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciconfigfile=`echo $i | sed -e 's/^.*\///'` 238c2ecf20Sopenharmony_cingps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'` 248c2ecf20Sopenharmony_cistopstate="`grep 'End-test grace-period state: g' $i/console.log 2> /dev/null | 258c2ecf20Sopenharmony_ci tail -1 | sed -e 's/^\[[ 0-9.]*] //' | 268c2ecf20Sopenharmony_ci awk '{ print \"[\" $1 \" \" $5 \" \" $6 \" \" $7 \"]\"; }' | 278c2ecf20Sopenharmony_ci tr -d '\012\015'`" 288c2ecf20Sopenharmony_cifwdprog="`grep 'rcu_torture_fwd_prog_cr Duration' $i/console.log 2> /dev/null | sed -e 's/^\[[^]]*] //' | sort -k15nr | head -1 | awk '{ print $14 " " $15 }'`" 298c2ecf20Sopenharmony_ciif test -z "$ngps" 308c2ecf20Sopenharmony_cithen 318c2ecf20Sopenharmony_ci echo "$configfile ------- " $stopstate 328c2ecf20Sopenharmony_cielse 338c2ecf20Sopenharmony_ci title="$configfile ------- $ngps GPs" 348c2ecf20Sopenharmony_ci dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null` 358c2ecf20Sopenharmony_ci if test -z "$dur" 368c2ecf20Sopenharmony_ci then 378c2ecf20Sopenharmony_ci : 388c2ecf20Sopenharmony_ci else 398c2ecf20Sopenharmony_ci ngpsps=`awk -v ngps=$ngps -v dur=$dur ' 408c2ecf20Sopenharmony_ci BEGIN { print ngps / dur }' < /dev/null` 418c2ecf20Sopenharmony_ci title="$title ($ngpsps/s)" 428c2ecf20Sopenharmony_ci fi 438c2ecf20Sopenharmony_ci echo $title $stopstate $fwdprog 448c2ecf20Sopenharmony_ci nclosecalls=`grep --binary-files=text 'torture: Reader Batch' $i/console.log | tail -1 | \ 458c2ecf20Sopenharmony_ci awk -v sum=0 ' 468c2ecf20Sopenharmony_ci { 478c2ecf20Sopenharmony_ci for (i = 0; i <= NF; i++) { 488c2ecf20Sopenharmony_ci sum += $i; 498c2ecf20Sopenharmony_ci if ($i ~ /Batch:/) { 508c2ecf20Sopenharmony_ci sum = 0; 518c2ecf20Sopenharmony_ci i = i + 2; 528c2ecf20Sopenharmony_ci } 538c2ecf20Sopenharmony_ci } 548c2ecf20Sopenharmony_ci } 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci END { 578c2ecf20Sopenharmony_ci print sum 588c2ecf20Sopenharmony_ci }'` 598c2ecf20Sopenharmony_ci if test -z "$nclosecalls" 608c2ecf20Sopenharmony_ci then 618c2ecf20Sopenharmony_ci exit 0 628c2ecf20Sopenharmony_ci fi 638c2ecf20Sopenharmony_ci if test "$nclosecalls" -eq 0 648c2ecf20Sopenharmony_ci then 658c2ecf20Sopenharmony_ci exit 0 668c2ecf20Sopenharmony_ci fi 678c2ecf20Sopenharmony_ci # Compute number of close calls per tenth of an hour 688c2ecf20Sopenharmony_ci nclosecalls10=`awk -v nclosecalls=$nclosecalls -v dur=$dur 'BEGIN { print int(nclosecalls * 36000 / dur) }' < /dev/null` 698c2ecf20Sopenharmony_ci if test $nclosecalls10 -gt 5 -a $nclosecalls -gt 1 708c2ecf20Sopenharmony_ci then 718c2ecf20Sopenharmony_ci print_bug $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i 728c2ecf20Sopenharmony_ci else 738c2ecf20Sopenharmony_ci print_warning $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i 748c2ecf20Sopenharmony_ci fi 758c2ecf20Sopenharmony_ci echo $nclosecalls "Reader Batch close calls in" $(($dur/60)) minute run: $i > $i/console.log.rcu.diags 768c2ecf20Sopenharmony_cifi 77