cpufreq.sh (e66d5b673741cf6b7da250da9f84a165b1e4342d) | cpufreq.sh (b03eaf8dbac5534590ec52612f789d8fb292af9c) |
---|---|
1#!/bin/bash 2 3# protect against multiple inclusion 4if [ $FILE_CPUFREQ ]; then 5 return 0 6else 7 FILE_CPUFREQ=DONE 8fi --- 185 unchanged lines hidden (view full) --- 194 reboot_cpus 5 195 196 # Test all frequencies 197 shuffle_frequency_for_all_cpus 2 198 199 # Test all governors 200 shuffle_governors_for_all_cpus 1 201} | 1#!/bin/bash 2 3# protect against multiple inclusion 4if [ $FILE_CPUFREQ ]; then 5 return 0 6else 7 FILE_CPUFREQ=DONE 8fi --- 185 unchanged lines hidden (view full) --- 194 reboot_cpus 5 195 196 # Test all frequencies 197 shuffle_frequency_for_all_cpus 2 198 199 # Test all governors 200 shuffle_governors_for_all_cpus 1 201} |
202 203# Suspend/resume 204# $1: "suspend" or "hibernate", $2: loop count 205do_suspend() 206{ 207 printf "** Test: Running ${FUNCNAME[0]}: Trying $1 for $2 loops **\n\n" 208 209 # Is the directory available 210 if [ ! -d $SYSFS/power/ -o ! -f $SYSFS/power/state ]; then 211 printf "$SYSFS/power/state not available\n" 212 return 1 213 fi 214 215 if [ $1 = "suspend" ]; then 216 filename="mem" 217 elif [ $1 = "hibernate" ]; then 218 filename="disk" 219 else 220 printf "$1 is not a valid option\n" 221 return 1 222 fi 223 224 if [ -n $filename ]; then 225 present=$(cat $SYSFS/power/state | grep $filename) 226 227 if [ -z "$present" ]; then 228 printf "Tried to $1 but $filename isn't present in $SYSFS/power/state\n" 229 return 1; 230 fi 231 232 for i in `seq 1 $2`; do 233 printf "Starting $1\n" 234 echo $filename > $SYSFS/power/state 235 printf "Came out of $1\n" 236 237 printf "Do basic tests after finishing $1 to verify cpufreq state\n\n" 238 cpufreq_basic_tests 239 done 240 fi 241} |
|