diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2020-05-25 14:07:52 -0700 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2020-06-29 12:00:44 -0700 |
commit | f8b4bb23ec014a5d16663ad70b45d9f46c456ec4 (patch) | |
tree | 19551b890fb5e69190d4aa682114636a80512f45 /tools/testing/selftests/rcutorture/bin | |
parent | rcuperf: Add comments explaining the high reader overhead (diff) | |
download | linux-dev-f8b4bb23ec014a5d16663ad70b45d9f46c456ec4.tar.xz linux-dev-f8b4bb23ec014a5d16663ad70b45d9f46c456ec4.zip |
torture: Add refperf to the rcutorture scripting
This commit updates the rcutorture scripting to include the new refperf
torture-test module.
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin')
-rwxr-xr-x | tools/testing/selftests/rcutorture/bin/kvm-recheck-refperf.sh | 67 | ||||
-rwxr-xr-x | tools/testing/selftests/rcutorture/bin/kvm.sh | 9 | ||||
-rwxr-xr-x | tools/testing/selftests/rcutorture/bin/parse-console.sh | 4 |
3 files changed, 74 insertions, 6 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-recheck-refperf.sh b/tools/testing/selftests/rcutorture/bin/kvm-recheck-refperf.sh new file mode 100755 index 000000000000..6fc06cd3538e --- /dev/null +++ b/tools/testing/selftests/rcutorture/bin/kvm-recheck-refperf.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# +# Analyze a given results directory for refperf performance measurements. +# +# Usage: kvm-recheck-refperf.sh resdir +# +# Copyright (C) IBM Corporation, 2016 +# +# Authors: Paul E. McKenney <paulmck@linux.ibm.com> + +i="$1" +if test -d "$i" -a -r "$i" +then + : +else + echo Unreadable results directory: $i + exit 1 +fi +PATH=`pwd`/tools/testing/selftests/rcutorture/bin:$PATH; export PATH +. functions.sh + +configfile=`echo $i | sed -e 's/^.*\///'` + +sed -e 's/^\[[^]]*]//' < $i/console.log | tr -d '\015' | +awk -v configfile="$configfile" ' +/^[ ]*Threads Time\(ns\) *$/ { + if (dataphase + 0 == 0) { + dataphase = 1; + # print configfile, $0; + } + next; +} + +/[^ ]*[0-9][0-9]* [0-9][0-9]*\.[0-9][0-9]*$/ { + if (dataphase == 1) { + # print $0; + readertimes[++n] = $2; + sum += $2; + } + next; +} + +{ + if (dataphase == 1) + dataphase == 2; + next; +} + +END { + print configfile " results:"; + newNR = asort(readertimes); + if (newNR <= 0) { + print "No refperf records found???" + exit; + } + medianidx = int(newNR / 2); + if (newNR == medianidx * 2) + medianvalue = (readertimes[medianidx - 1] + readertimes[medianidx]) / 2; + else + medianvalue = readertimes[medianidx]; + print "Average reader duration: " sum / newNR " nanoseconds"; + print "Minimum reader duration: " readertimes[1]; + print "Median reader duration: " medianvalue; + print "Maximum reader duration: " readertimes[newNR]; + print "Computed from refperf printk output."; +}' diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh index c279cf9cb010..48b6a7248f50 100755 --- a/tools/testing/selftests/rcutorture/bin/kvm.sh +++ b/tools/testing/selftests/rcutorture/bin/kvm.sh @@ -180,13 +180,14 @@ do shift ;; --torture) - checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\)$' '^--' + checkarg --torture "(suite name)" "$#" "$2" '^\(lock\|rcu\|rcuperf\|refperf\)$' '^--' TORTURE_SUITE=$2 shift - if test "$TORTURE_SUITE" = rcuperf + if test "$TORTURE_SUITE" = rcuperf || test "$TORTURE_SUITE" = refperf then - # If you really want jitter for rcuperf, specify - # it after specifying rcuperf. (But why?) + # If you really want jitter for refperf or + # rcuperf, specify it after specifying the rcuperf + # or the refperf. (But why jitter in these cases?) jitter=0 fi ;; diff --git a/tools/testing/selftests/rcutorture/bin/parse-console.sh b/tools/testing/selftests/rcutorture/bin/parse-console.sh index 4bf62d7b1cbc..85af11d2d0cb 100755 --- a/tools/testing/selftests/rcutorture/bin/parse-console.sh +++ b/tools/testing/selftests/rcutorture/bin/parse-console.sh @@ -33,8 +33,8 @@ then fi cat /dev/null > $file.diags -# Check for proper termination, except that rcuperf runs don't indicate this. -if test "$TORTURE_SUITE" != rcuperf +# Check for proper termination, except for rcuperf and refperf. +if test "$TORTURE_SUITE" != rcuperf && test "$TORTURE_SUITE" != refperf then # check for abject failure |