Commit 25f47e3e authored by Mark Brown's avatar Mark Brown Committed by Will Deacon
Browse files

selftests: arm64: Add wrapper scripts for stress tests



Add wrapper scripts which invoke fpsimd-test and sve-test with several
copies per CPU such that the context switch code will be appropriately
exercised.

Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarDave Martin <Dave.Martin@arm.com>
Acked-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20200819114837.51466-6-broonie@kernel.org


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent fc7e611f
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2015-2019 ARM Limited.
# Original author: Dave Martin <Dave.Martin@arm.com>

set -ue

NR_CPUS=`nproc`

pids=
logs=

cleanup () {
	trap - INT TERM CHLD
	set +e

	if [ -n "$pids" ]; then
		kill $pids
		wait $pids
		pids=
	fi

	if [ -n "$logs" ]; then
		cat $logs
		rm $logs
		logs=
	fi
}

interrupt () {
	cleanup
	exit 0
}

child_died () {
	cleanup
	exit 1
}

trap interrupt INT TERM EXIT
trap child_died CHLD

for x in `seq 0 $((NR_CPUS * 4))`; do
	log=`mktemp`
	logs=$logs\ $log
	./fpsimd-test >$log &
	pids=$pids\ $!
done

# Wait for all child processes to be created:
sleep 10

while :; do
	kill -USR1 $pids
done &
pids=$pids\ $!

wait

exit 1
+59 −0
Original line number Diff line number Diff line
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2015-2019 ARM Limited.
# Original author: Dave Martin <Dave.Martin@arm.com>

set -ue

NR_CPUS=`nproc`

pids=
logs=

cleanup () {
	trap - INT TERM CHLD
	set +e

	if [ -n "$pids" ]; then
		kill $pids
		wait $pids
		pids=
	fi

	if [ -n "$logs" ]; then
		cat $logs
		rm $logs
		logs=
	fi
}

interrupt () {
	cleanup
	exit 0
}

child_died () {
	cleanup
	exit 1
}

trap interrupt INT TERM EXIT

for x in `seq 0 $((NR_CPUS * 4))`; do
	log=`mktemp`
	logs=$logs\ $log
	./sve-test >$log &
	pids=$pids\ $!
done

# Wait for all child processes to be created:
sleep 10

while :; do
	kill -USR1 $pids
done &
pids=$pids\ $!

wait

exit 1