@@ -29,6 +29,18 @@ source ../include/functions.sh
FILES="online offline possible present"
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
for i in $FILES; do
check_file $i $CPU_PATH || return 1
done
@@ -27,6 +27,18 @@
source ../include/functions.sh
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
check_state() {
local cpu=$1
local dirpath=$CPU_PATH/$1
@@ -27,6 +27,18 @@
source ../include/functions.sh
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
check_affinity_fails() {
local cpu=$1
local cpuid=${cpu:3}
@@ -28,6 +28,18 @@
CPUBURN=../utils/cpuburn
source ../include/functions.sh
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
check_task_migrate() {
local cpu=$1
local cpuid=${cpu:3}
@@ -27,6 +27,18 @@
source ../include/functions.sh
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
check_procinfo() {
local cpu=$1
local cpuid=${cpu:3}
@@ -27,6 +27,18 @@
source ../include/functions.sh
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
check_procinfo() {
local cpu=$1
local cpuid=${cpu:3}
@@ -28,6 +28,18 @@
source ../include/functions.sh
TMPFILE=cpuhotplug_07.tmp
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
waitfor_udevadm() {
while [ 1 ]; do
lsof | grep udevadm | grep 'sock\|netlink' > /dev/null
@@ -27,6 +27,18 @@
source ../include/functions.sh
+is_root
+if [ $? -ne 0 ]; then
+ log_skip "user is not root"
+ exit 0
+fi
+
+cpuhotplug_enabled
+if [ $? -ne 0 ]; then
+ log_skip "cpuhotplug not supported"
+ exit 0
+fi
+
function randomize() {
echo $[ ( $RANDOM % $1 ) + 1 ]
}
@@ -353,6 +353,21 @@ cpuidle_enabled() {
test -d /sys/devices/system/cpu/cpuidle
}
+cpuhotplug_enabled() {
+ cpus=$(ls $CPU_PATH | grep "cpu[0-9].*")
+
+ for cpu in $cpus; do
+ # assuming cpu0 can't be plugged out
+ if [ $cpu != "cpu0" ]; then
+ test -w $CPU_PATH/$cpu/online
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
+ fi
+ done
+ return 0
+}
+
# currently we support ubuntu and android
get_os() {
lsb_release -a 2>&1 | grep -i ubuntu > /dev/null
Signed-off-by: Sanjay Singh Rawat <sanjay.rawat@linaro.org> --- cpuhotplug/cpuhotplug_01.sh | 12 ++++++++++++ cpuhotplug/cpuhotplug_02.sh | 12 ++++++++++++ cpuhotplug/cpuhotplug_03.sh | 12 ++++++++++++ cpuhotplug/cpuhotplug_04.sh | 12 ++++++++++++ cpuhotplug/cpuhotplug_05.sh | 12 ++++++++++++ cpuhotplug/cpuhotplug_06.sh | 12 ++++++++++++ cpuhotplug/cpuhotplug_07.sh | 12 ++++++++++++ cpuhotplug/cpuhotplug_08.sh | 12 ++++++++++++ include/functions.sh | 15 +++++++++++++++ 9 files changed, 111 insertions(+)