1 ################################################################
2 #This script will impose stress on specified processors with the
3 #arguments passed based on stress type.
4 ################################################################
8 echo "Usage --> $0 [-c CPU] [-t timeout] [-a stress-args][-h]"
9 echo " CPU : 1/0-2 ; default is 22-43"
10 echo " timeout : N(number)"
11 echo " stress-args : "--cpu=100 --vm=100 --io=10 --hdd=100""
12 echo " -h : Help section"
16 ## --- Parse command line arguments / parameters ---
17 while getopts ":c:t:a:h" option; do
29 echo "Option -$OPTARG requires an argument."
38 echo "Unknown option: $OPTARG."
43 echo "[WARNING] Unknown parameters!!!"
44 echo "Using default values for CPU,timeout and stress parameters"
49 if [[ -z "$processors" ]]
54 if [[ -z "$timeout" ]]
64 stress_params=$(echo $args | sed 's/[,=]/ /g'|sed -e 's/\r//g')
66 cmd="taskset -c $processors stress --timeout ${timeout} ${stress_params}"
70 eval "${cmd}" &>/dev/null &disown