[tip:core/rcu] rcutorture: Abstract kvm-recheck.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  2193e1604eac422df05f77b53667237fcf130bf5
Gitweb:     http://git.kernel.org/tip/2193e1604eac422df05f77b53667237fcf130bf5
Author:     Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
AuthorDate: Fri, 7 Feb 2014 15:16:25 -0800
Committer:  Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
CommitDate: Sun, 23 Feb 2014 09:04:28 -0800

rcutorture: Abstract kvm-recheck.sh

This commit creates a plug-in to allow kvm-recheck.sh to process
non-rcutorture console output.

Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
---
 .../bin/{parse-build.sh => kvm-recheck-rcu.sh}     | 52 ++++++++++------------
 .../selftests/rcutorture/bin/kvm-recheck.sh        | 20 +--------
 2 files changed, 24 insertions(+), 48 deletions(-)

diff --git a/tools/testing/selftests/rcutorture/bin/parse-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
similarity index 52%
copy from tools/testing/selftests/rcutorture/bin/parse-build.sh
copy to tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
index 5432309..d75b1dc5 100755
--- a/tools/testing/selftests/rcutorture/bin/parse-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-rcu.sh
@@ -1,13 +1,8 @@
-#!/bin/sh
+#!/bin/bash
 #
-# Check the build output from an rcutorture run for goodness.
-# The "file" is a pathname on the local system, and "title" is
-# a text string for error-message purposes.
+# Analyze a given results directory for rcutorture progress.
 #
-# The file must contain kernel build output.
-#
-# Usage:
-#	sh parse-build.sh file title
+# Usage: sh kvm-recheck-rcu.sh resdir
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -23,35 +18,34 @@
 # along with this program; if not, you can access it online at
 # http://www.gnu.org/licenses/gpl-2.0.html.
 #
-# Copyright (C) IBM Corporation, 2011
+# Copyright (C) IBM Corporation, 2014
 #
 # Authors: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
 
-T=$1
-title=$2
-
-. functions.sh
-
-if grep -q CC < $T
+i="$1"
+if test -d $i
 then
 	:
 else
-	print_bug $title no build
+	echo Unreadable results directory: $i
 	exit 1
 fi
 
-if grep -q "error:" < $T
+configfile=`echo $i | sed -e 's/^.*\///'`
+ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
+if test -z "$ngps"
 then
-	print_bug $title build errors:
-	grep "error:" < $T
-	exit 2
-fi
-exit 0
-
-if egrep -q "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
-then
-	print_warning $title build errors:
-	egrep "rcu[^/]*\.c.*warning:|rcu.*\.h.*warning:" < $T
-	exit 2
+	echo $configfile
+else
+	title="$configfile ------- $ngps grace periods"
+	dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
+	if test -z "$dur"
+	then
+		:
+	else
+		ngpsps=`awk -v ngps=$ngps -v dur=$dur '
+			BEGIN { print ngps / dur }' < /dev/null`
+		title="$title ($ngpsps per second)"
+	fi
+	echo $title
 fi
-exit 0
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
index 89b5dba..31c8706 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck.sh
@@ -37,25 +37,7 @@ do
 			resdir=`echo $i | sed -e 's,/$,,' -e 's,/[^/]*$,,'`
 			head -1 $resdir/log
 		fi
-		configfile=`echo $i | sed -e 's/^.*\///'`
-		ngps=`grep ver: $i/console.log 2> /dev/null | tail -1 | sed -e 's/^.* ver: //' -e 's/ .*$//'`
-		if test -z "$ngps"
-		then
-			echo $configfile
-		else
-			title="$configfile ------- $ngps grace periods"
-			dur=`sed -e 's/^.* rcutorture.shutdown_secs=//' -e 's/ .*$//' < $i/qemu-cmd 2> /dev/null`
-			if test -z "$dur"
-			then
-				:
-			else
-				ngpsps=$((ngps / dur))
-				ngpsps=`awk -v ngps=$ngps -v dur=$dur '
-					BEGIN { print ngps / dur }' < /dev/null`
-				title="$title ($ngpsps per second)"
-			fi
-			echo $title
-		fi
+		kvm-recheck-rcu.sh $i
 		configcheck.sh $i/.config $i/ConfigFragment
 		parse-build.sh $i/Make.out $configfile
 		parse-rcutorture.sh $i/console.log $configfile
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux