Path: blob/master/tools/testing/selftests/fpu/run_test_fpu.sh
26288 views
#!/bin/bash1# SPDX-License-Identifier: GPL-2.02#3# Load kernel module for FPU tests45uid=$(id -u)6if [ $uid -ne 0 ]; then7echo "$0: Must be run as root"8exit 19fi1011if ! which modprobe > /dev/null 2>&1; then12echo "$0: You need modprobe installed"13exit 414fi1516if ! modinfo test_fpu > /dev/null 2>&1; then17echo "$0: You must have the following enabled in your kernel:"18echo "CONFIG_TEST_FPU=m"19exit 420fi2122NR_CPUS=$(getconf _NPROCESSORS_ONLN)23if [ ! $NR_CPUS ]; then24NR_CPUS=125fi2627modprobe test_fpu2829if [ ! -e /sys/kernel/debug/selftest_helpers/test_fpu ]; then30mount -t debugfs none /sys/kernel/debug3132if [ ! -e /sys/kernel/debug/selftest_helpers/test_fpu ]; then33echo "$0: Error mounting debugfs"34exit 435fi36fi3738echo "Running 1000 iterations on all CPUs... "39for i in $(seq 1 1000); do40for c in $(seq 1 $NR_CPUS); do41./test_fpu &42done43done4445rmmod test_fpu464748