3
echo "Beginning CPU Offlining Test" 1>&2
9
for cpu_num in `ls /sys/devices/system/cpu | grep -o cpu[0-9]*`; do
10
if [ -f /sys/devices/system/cpu/$cpu_num/online ]; then
11
if [ "$cpu_num" != "cpu0" ]; then
13
echo "Offlining $cpu_num" 1>&2
14
echo 0 > /sys/devices/system/cpu/$cpu_num/online
16
grep -w -i -q $cpu_num /proc/interrupts
18
echo "ERROR: Failed to offline $cpu_num" 1>&2
26
for cpu_num in `ls /sys/devices/system/cpu | grep -o cpu[0-9]*`; do
27
if [ -f /sys/devices/system/cpu/$cpu_num/online ]; then
28
if [ "$cpu_num" != "cpu0" ]; then
29
echo "Onlining $cpu_num" 1>&2
30
echo 1 > /sys/devices/system/cpu/$cpu_num/online
31
grep -w -i -q $cpu_num /proc/interrupts
33
echo "ERROR: Failed to online $cpu_num" 1>&2
40
if [ $result -eq 0 ]; then
41
echo "Successfully turned $cpu_count cores off and back on"
43
echo "Error with offlining one or more cores." 1>&2