summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/rcutorture/bin/kvm.sh
diff options
context:
space:
mode:
authorPaul E. McKenney2017-08-31 00:33:49 +0200
committerPaul E. McKenney2017-10-09 23:26:09 +0200
commitb038c58bd258522d9cde6619d730ebdb1f7be198 (patch)
tree85da631bd0baa455a1a7f6f61a982bab344ec832 /tools/testing/selftests/rcutorture/bin/kvm.sh
parentrcutorture: Dump writer stack if stalled (diff)
downloadkernel-qcow2-linux-b038c58bd258522d9cde6619d730ebdb1f7be198.tar.gz
kernel-qcow2-linux-b038c58bd258522d9cde6619d730ebdb1f7be198.tar.xz
kernel-qcow2-linux-b038c58bd258522d9cde6619d730ebdb1f7be198.zip
torture: Provide TMPDIR environment variable to specify tmpdir
Both rcutorture and locktorture currently place temporary files in /tmp, in keeping with decades-long tradition. However, sometimes it is useful to specify an alternative temporary directory, for example, for space or performance reasons. This commit therefore causes the torture-test scripting to use the path specified in the TMPDIR environment variable, or to fall back to traditional /tmp if this variable is not set. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'tools/testing/selftests/rcutorture/bin/kvm.sh')
-rwxr-xr-xtools/testing/selftests/rcutorture/bin/kvm.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/rcutorture/bin/kvm.sh b/tools/testing/selftests/rcutorture/bin/kvm.sh
index b55895fb10ed..ccd49e958fd2 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm.sh
@@ -30,7 +30,7 @@
scriptname=$0
args="$*"
-T=/tmp/kvm.sh.$$
+T=${TMPDIR-/tmp}/kvm.sh.$$
trap 'rm -rf $T' 0
mkdir $T
@@ -222,7 +222,7 @@ do
exit 1
fi
done
-sort -k2nr $T/cfgcpu > $T/cfgcpu.sort
+sort -k2nr $T/cfgcpu -T="$T" > $T/cfgcpu.sort
# Use a greedy bin-packing algorithm, sorting the list accordingly.
awk < $T/cfgcpu.sort > $T/cfgcpu.pack -v ncpus=$cpus '