hi Lisa,

Can we have this in way like, mask for cpuhotplug. I believe out
of cpu0-N one will be permanent. We can pass it like cpu_hotplug_mask=cpuX
and skip hotplugging that specific cpu only.

On Wednesday 25 June 2014 09:48 AM, Lisa Nguyen wrote:
Pass hotplug_cpu_start=0 to make check like
these examples below:

sudo make -C cpuhotplug hotplug_cpu_start=0 check
sudo make hotplug_cpu_start=0 check

to enable cpuhotplug to run on cpu0 to N.

The hotplug_cpu_start variable will take the default
value of 1 if no value is passed so cpuhotplug will
run on cpu1 to N.

This fixes bug #49:
https://bugs.linaro.org/show_bug.cgi?id=49

Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
---
 Makefile                    |    4 +++-
 cpuhotplug/Makefile         |    2 +-
 cpuhotplug/cpuhotplug_02.sh |    2 +-
 cpuhotplug/cpuhotplug_03.sh |    2 +-
 cpuhotplug/cpuhotplug_04.sh |    2 +-
 cpuhotplug/cpuhotplug_05.sh |    2 +-
 cpuhotplug/cpuhotplug_06.sh |    2 +-
 cpuhotplug/cpuhotplug_07.sh |    2 +-
 cpuhotplug/cpuhotplug_08.sh |    6 +++++-
 9 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 731619d..24bbd59 100644
--- a/Makefile
+++ b/Makefile
@@ -22,13 +22,15 @@
 #       - initial API and implementation
 #
 
+hotplug_cpu_start?=1
+
 all:
 	@(cd utils; $(MAKE))
 
 check:
 	@(cd utils; $(MAKE) check)
 	@(cd cpufreq; $(MAKE) check)
-	@(cd cpuhotplug; $(MAKE) check)
+	@(cd cpuhotplug; $(MAKE) hotplug_cpu_start=${hotplug_cpu_start} check)
 	@(cd cpuidle; $(MAKE) check)
 #	@(cd suspend; $(MAKE) check)
 	@(cd thermal; $(MAKE) check)
diff --git a/cpuhotplug/Makefile b/cpuhotplug/Makefile
index df0b8f4..a6670c3 100644
--- a/cpuhotplug/Makefile
+++ b/cpuhotplug/Makefile
@@ -21,5 +21,5 @@
 #     Daniel Lezcano <daniel.lezcano@linaro.org> (IBM Corporation)
 #       - initial API and implementation
 #
-
+export hotplug_cpu_start?=1
 include ../Test.mk
diff --git a/cpuhotplug/cpuhotplug_02.sh b/cpuhotplug/cpuhotplug_02.sh
index 3157307..3f678b9 100755
--- a/cpuhotplug/cpuhotplug_02.sh
+++ b/cpuhotplug/cpuhotplug_02.sh
@@ -33,7 +33,7 @@ check_state() {
     local state=
     shift 1
 
-    if [ "$cpu" == "cpu0" ]; then
+    if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
 	return 0
     fi
 
diff --git a/cpuhotplug/cpuhotplug_03.sh b/cpuhotplug/cpuhotplug_03.sh
index 13a0ce9..57ff40e 100755
--- a/cpuhotplug/cpuhotplug_03.sh
+++ b/cpuhotplug/cpuhotplug_03.sh
@@ -33,7 +33,7 @@ check_affinity_fails() {
     local dirpath=$CPU_PATH/$1
     local ret=
 
-    if [ "$cpu" == "cpu0" ]; then
+    if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
 	return 0
     fi
 
diff --git a/cpuhotplug/cpuhotplug_04.sh b/cpuhotplug/cpuhotplug_04.sh
index 394a512..9c08fba 100755
--- a/cpuhotplug/cpuhotplug_04.sh
+++ b/cpuhotplug/cpuhotplug_04.sh
@@ -36,7 +36,7 @@ check_task_migrate() {
     local pid=
     local ret=
 
-    if [ "$cpu" == "cpu0" ]; then
+    if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
 	return 0
     fi
 
diff --git a/cpuhotplug/cpuhotplug_05.sh b/cpuhotplug/cpuhotplug_05.sh
index a8eb312..f5eb994 100755
--- a/cpuhotplug/cpuhotplug_05.sh
+++ b/cpuhotplug/cpuhotplug_05.sh
@@ -32,7 +32,7 @@ check_procinfo() {
     local cpuid=${cpu:3}
     local ret=
 
-    if [ "$cpu" == "cpu0" ]; then
+    if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
 	return 0
     fi
 
diff --git a/cpuhotplug/cpuhotplug_06.sh b/cpuhotplug/cpuhotplug_06.sh
index 347906d..93fbadd 100755
--- a/cpuhotplug/cpuhotplug_06.sh
+++ b/cpuhotplug/cpuhotplug_06.sh
@@ -32,7 +32,7 @@ check_procinfo() {
     local cpuid=${cpu:3}
     local ret=
 
-    if [ "$cpu" == "cpu0" ]; then
+    if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
 	return 0
     fi
 
diff --git a/cpuhotplug/cpuhotplug_07.sh b/cpuhotplug/cpuhotplug_07.sh
index eaeba77..2457891 100755
--- a/cpuhotplug/cpuhotplug_07.sh
+++ b/cpuhotplug/cpuhotplug_07.sh
@@ -34,7 +34,7 @@ check_notification() {
     local pid=
     local ret=
 
-    if [ "$cpu" == "cpu0" ]; then
+    if [[ "$cpu" == "cpu0" && $hotplug_cpu_start -ne 0 ]]; then
 	return 0
     fi
 
diff --git a/cpuhotplug/cpuhotplug_08.sh b/cpuhotplug/cpuhotplug_08.sh
index 9e2c355..52e1fc2 100755
--- a/cpuhotplug/cpuhotplug_08.sh
+++ b/cpuhotplug/cpuhotplug_08.sh
@@ -28,7 +28,11 @@
 source ../include/functions.sh
 
 function randomize() {
-    echo $[ ( $RANDOM % $1 )  + 1 ]
+    if [ $hotplug_cpu_start -ne 0 ]; then
+	echo $[ ( $RANDOM % $1 )  + 1 ]
+    else
+  	echo $[ ( $RANDOM % $1 ) ]
+    fi
 }
 
 random_stress() {

-- 
sanjay