Focus on returning the results of each test script rather
than the results of each subtest. This will help to keep the
number of PM-QA test results consistent across multiple boards
regardless of number of frequencies, cores, etc.
Examples before the refactoring:
https://validation.linaro.org/dashboard/streams
/anonymous/lisatn/bundles/331786fb33a49b060adccf51bb509d5f286422e7/
Examples after the refactoring:
https://validation.linaro.org/dashboard/streams/anonymous
/lisatn/bundles/076a3f890e58727f01a23e30d6eb438172b69c7d/
Once this patch is accepted and merged, then there will be a
follow up patch to update the pwrmgmt test definition, so LAVA
can record PM-QA results accurately.
Signed-off-by: Lisa Nguyen <lisa.nguyen(a)linaro.org>
---
Changes from v3 to v4:
- Fix syntax errors that were undetected (e.g. space between
a condition and end square bracket in an if statement) that
affected the pass/fail/skip count
Change from v2 to v3:
- Fix a silly increment error for skip count cause I
didn't look closely enough
Changes from v1 to v2:
- Rewrite test_status_show() function
- Add description and log_skip() function in thermal_05
- Moved skip/fail/pass counts to log_end() function
cpufreq/cpufreq_07.sh | 2 +-
include/functions.sh | 35 ++++++++++++++++++++++++++++++-----
thermal/thermal_05.sh | 3 ++-
thermal/thermal_06.sh | 2 +-
4 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/cpufreq/cpufreq_07.sh b/cpufreq/cpufreq_07.sh
index f8f9e8e..b65d212 100755
--- a/cpufreq/cpufreq_07.sh
+++ b/cpufreq/cpufreq_07.sh
@@ -74,7 +74,7 @@ check_ondemand() {
supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep "ondemand")
if [ -z "$supported" ]; then
log_skip "ondemand not supported"
- exit 0
+ return 0
fi
save_governors
diff --git a/include/functions.sh b/include/functions.sh
index 417c725..3f5acf4 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -32,14 +32,31 @@ INC=0
CPU=
pass_count=0
fail_count=0
+skip_count=0
+test_script_status="pass"
test_status_show() {
- echo "-------- total = $(($pass_count + $fail_count))"
- echo "-------- pass = $pass_count"
- # report failure only if it is there
- if [ $fail_count -ne 0 ] ; then
- echo "-------- fail = $fail_count"
+ if [ $fail_count -ne 0 ]; then
+ test_script_status="fail"
+ else
+ if [ $skip_count -ne 0 ]; then
+ if [ $pass_count -ne 0 ]; then
+ test_script_status="pass"
+ else
+ test_script_status="skip"
+ fi
+ fi
+ fi
+
+ echo " "
+ if [[ "$test_script_status" == "fail" ]]; then
+ echo "$TEST_NAME: fail"
+ elif [[ "$test_script_status" == "skip" ]]; then
+ echo "$TEST_NAME: skip"
+ else
+ echo "$TEST_NAME: pass"
fi
+ echo " "
}
log_begin() {
@@ -49,6 +66,14 @@ log_begin() {
log_end() {
printf "$*\n"
+
+ if [[ "$*" == "Err" ]]; then
+ fail_count=$((fail_count + 1))
+ elif [[ "$*" == "skip" ]]; then
+ skip_count=$((skip_count + 1))
+ else
+ pass_count=$((pass_count + 1))
+ fi
}
log_skip() {
diff --git a/thermal/thermal_05.sh b/thermal/thermal_05.sh
index 05f83d1..52a0ac2 100755
--- a/thermal/thermal_05.sh
+++ b/thermal/thermal_05.sh
@@ -36,7 +36,8 @@ verify_cpufreq_cooling_device_action() {
local cpufreq_cdev=$(cat $dirpath/type)
cat $dirpath/type | grep cpufreq
if [ $? -ne 0 ] ; then
- return 0
+ log_skip "Cannot find cpufreq in $cdev_name..."
+ return 0
fi
local max_state=$(cat $dirpath/max_state)
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh
index 92c987a..d8877f0 100755
--- a/thermal/thermal_06.sh
+++ b/thermal/thermal_06.sh
@@ -30,7 +30,7 @@ source ../include/thermal_functions.sh
if [ "$thermal_try_max" -eq 0 ]; then
log_skip "test of trip points being crossed"
- exit 0
+ return 0
fi
TEST_LOOP=100
--
1.7.9.5
== Progress ==
* Enabling UEFI Fastboot on Panda - on hold (CARD-198: 0 %)
* CARD 1103: Flash support on u-boot fastboot (CARD-1103: 100%)
- Fixed build errors on omap3 beagle config
- consolidated the patches into two, and submitted patches for review
http://lists.denx.de/pipermail/u-boot/2014-August/185194.htmlhttp://lists.denx.de/pipermail/u-boot/2014-August/185195.html
== Plans ==
* CARD-198: Start working on the activity on Panda/BBB (40%)
* CARD 1103: Send the patches for review to u-boot mailing list and
upstream. (CARD-1103: 60%)
- Fix the review comments and code standard related issues
== Issues ==
* None
From: Patrick Bellasi <patrick.bellasi(a)arm.com>
To properly identify the initial PState of each CPU, the idlestat_wake_all
function is used to force an idle state exit on all CPUs by pinning idlestat
on each CPUs. However, this routine forgets to recover the original mask
at the end of the pinning process.
This patch solve this issue, by properly recovering the original CPU
affinity mask. Moreover, it avoids to wake up CPUs that will not be used
to run the workload.
Signed-off-by: Patrick Bellasi <patrick.bellasi(a)arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano(a)linaro.org>
---
idlestat.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/idlestat.c b/idlestat.c
index 0e0e1df..2a0c549 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -1210,6 +1210,7 @@ static int idlestat_wake_all(void)
{
int rcpu, i, ret;
cpu_set_t cpumask;
+ cpu_set_t original_cpumask;
ret = sysconf(_SC_NPROCESSORS_CONF);
if (ret < 0)
@@ -1219,18 +1220,28 @@ static int idlestat_wake_all(void)
if (rcpu < 0)
return -1;
+ /* Keep track of the CPUs we will run on */
+ sched_getaffinity(0, sizeof(original_cpumask), &original_cpumask);
+
for (i = 0; i < ret; i++) {
/* Pointless to wake up ourself */
if (i == rcpu)
continue;
+ /* Pointless to wake CPUs we will not run on */
+ if (!CPU_ISSET(i, &original_cpumask))
+ continue;
+
CPU_ZERO(&cpumask);
CPU_SET(i, &cpumask);
sched_setaffinity(0, sizeof(cpumask), &cpumask);
}
+ /* Enable all the CPUs of the original mask */
+ sched_setaffinity(0, sizeof(original_cpumask), &original_cpumask);
+
return 0;
}
--
1.7.9.5
Focus on returning the results of each test script rather
than the results of each subtest. This will help to keep the
number of PM-QA test results consistent across multiple boards
regardless of number of frequencies, cores, etc.
Examples before the refactoring:
https://validation.linaro.org/dashboard/streams
/anonymous/lisatn/bundles/331786fb33a49b060adccf51bb509d5f286422e7/
Examples after the refactoring:
https://validation.linaro.org/dashboard/streams/anonymous
/lisatn/bundles/3451b80ed9ba8a813b109dac1c41b09f0445f819/
Once this patch is accepted and merged, then there will be a
follow up patch to update the pwrmgmt test definition, so LAVA
can record PM-QA results accurately.
Signed-off-by: Lisa Nguyen <lisa.nguyen(a)linaro.org>
---
Change from v2 to v3:
- Fix a silly increment error for skip count cause I
didn't look closely enough
Changes from v1 to v2:
- Rewrite test_status_show() function
- Add description and log_skip() function in thermal_05
- Moved skip/fail/pass counts to log_end() function
cpufreq/cpufreq_07.sh | 2 +-
include/functions.sh | 35 ++++++++++++++++++++++++++++++-----
thermal/thermal_05.sh | 1 +
thermal/thermal_06.sh | 2 +-
4 files changed, 33 insertions(+), 7 deletions(-)
diff --git a/cpufreq/cpufreq_07.sh b/cpufreq/cpufreq_07.sh
index f8f9e8e..b65d212 100755
--- a/cpufreq/cpufreq_07.sh
+++ b/cpufreq/cpufreq_07.sh
@@ -74,7 +74,7 @@ check_ondemand() {
supported=$(cat $CPU_PATH/cpu0/cpufreq/scaling_available_governors | grep "ondemand")
if [ -z "$supported" ]; then
log_skip "ondemand not supported"
- exit 0
+ return 0
fi
save_governors
diff --git a/include/functions.sh b/include/functions.sh
index 417c725..763f413 100644
--- a/include/functions.sh
+++ b/include/functions.sh
@@ -32,14 +32,31 @@ INC=0
CPU=
pass_count=0
fail_count=0
+skip_count=0
+test_script_status="pass"
test_status_show() {
- echo "-------- total = $(($pass_count + $fail_count))"
- echo "-------- pass = $pass_count"
- # report failure only if it is there
- if [ $fail_count -ne 0 ] ; then
- echo "-------- fail = $fail_count"
+ if [ "$fail_count" -ne "0" ]; then
+ test_script_status="fail"
+ else
+ if [ "$skip_count" -ne "0" ]; then
+ if [ "$pass_count" -ne "0"]; then
+ test_script_status="pass"
+ else
+ test_script_status="skip"
+ fi
+ fi
+ fi
+
+ echo " "
+ if [[ "$test_script_status" == "fail" ]]; then
+ echo "$TEST_NAME: fail"
+ elif [[ "$test_script_status" == "skip" ]]; then
+ echo "$TEST_NAME: skip"
+ else
+ echo "$TEST_NAME: pass"
fi
+ echo " "
}
log_begin() {
@@ -49,6 +66,14 @@ log_begin() {
log_end() {
printf "$*\n"
+
+ if [[ "$*" == "Err" ]]; then
+ fail_count=$(($fail_count + 1))
+ elif [[ "$*" == "skip" ]]; then
+ skip_count=$(($skip_count + 1))
+ else
+ pass_count=$(($pass_count + 1))
+ fi
}
log_skip() {
diff --git a/thermal/thermal_05.sh b/thermal/thermal_05.sh
index 05f83d1..c621b49 100755
--- a/thermal/thermal_05.sh
+++ b/thermal/thermal_05.sh
@@ -36,6 +36,7 @@ verify_cpufreq_cooling_device_action() {
local cpufreq_cdev=$(cat $dirpath/type)
cat $dirpath/type | grep cpufreq
if [ $? -ne 0 ] ; then
+ log_skip "Cannot find cpufreq in $cdev_name..."
return 0
fi
diff --git a/thermal/thermal_06.sh b/thermal/thermal_06.sh
index 92c987a..d8877f0 100755
--- a/thermal/thermal_06.sh
+++ b/thermal/thermal_06.sh
@@ -30,7 +30,7 @@ source ../include/thermal_functions.sh
if [ "$thermal_try_max" -eq 0 ]; then
log_skip "test of trip points being crossed"
- exit 0
+ return 0
fi
TEST_LOOP=100
--
1.7.9.5
From: Patrick Bellasi <patrick.bellasi(a)arm.com>
To properly identify the initial PState of each CPU, the idlestat_wake_all
function is used to force an idle state exit on all CPUs by pinning idlestat
on each CPUs. However, this routine forgets to recover the original mask
at the end of the pinning process.
This patch solve this issue, by properly recovering the original CPU
affinity mask. Moreover, it avoids to wake up CPUs that will not be used
to run the workload.
Signed-off-by: Patrick Bellasi <patrick.bellasi(a)arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano(a)linaro.org>
---
idlestat.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/idlestat.c b/idlestat.c
index 0e0e1df..2a0c549 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -1210,6 +1210,7 @@ static int idlestat_wake_all(void)
{
int rcpu, i, ret;
cpu_set_t cpumask;
+ cpu_set_t original_cpumask;
ret = sysconf(_SC_NPROCESSORS_CONF);
if (ret < 0)
@@ -1219,18 +1220,28 @@ static int idlestat_wake_all(void)
if (rcpu < 0)
return -1;
+ /* Keep track of the CPUs we will run on */
+ sched_getaffinity(0, sizeof(original_cpumask), &original_cpumask);
+
for (i = 0; i < ret; i++) {
/* Pointless to wake up ourself */
if (i == rcpu)
continue;
+ /* Pointless to wake CPUs we will not run on */
+ if (!CPU_ISSET(i, &original_cpumask))
+ continue;
+
CPU_ZERO(&cpumask);
CPU_SET(i, &cpumask);
sched_setaffinity(0, sizeof(cpumask), &cpumask);
}
+ /* Enable all the CPUs of the original mask */
+ sched_setaffinity(0, sizeof(original_cpumask), &original_cpumask);
+
return 0;
}
--
1.7.9.5