Add test which verifies capacity calculation on arm
architecture platforms.
Since there isn't yet a similar calculation done
for arm64 platforms, this architecture isn't supported
by this test (at least as of now).
Signed-off-by: Larry Bassel <larry.bassel(a)linaro.org>
---
cputopology/cputopology_04.sh | 137 +++++++++++++++++++++++++++++++++++++++++
cputopology/cputopology_04.txt | 1 +
2 files changed, 138 insertions(+)
create mode 100755 cputopology/cputopology_04.sh
create mode 100644 cputopology/cputopology_04.txt
diff --git a/cputopology/cputopology_04.sh b/cputopology/cputopology_04.sh
new file mode 100755
index 0000000..26f611c
--- /dev/null
+++ b/cputopology/cputopology_04.sh
@@ -0,0 +1,137 @@
+#!/bin/bash
+#
+# PM-QA validation test suite for the power management on Linux
+#
+# Copyright (C) 2015, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributors:
+# Larry Bassel <larry.bassel(a)linaro.org>
+#
+
+# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/P…
+
+source ../include/functions.sh
+
+calc_freq()
+{
+ byte1=$1
+ byte2=$2
+ byte3=$3
+ byte4=$4
+ freq=$((byte1*0x1000000+byte2*0x10000+byte3*0x100+byte4))
+}
+
+set_eff() {
+ type=$1
+
+ case $type in
+ arm,cortex-a15) eff=3891 ;;
+ arm,cortex-a7) eff=2048 ;;
+ * ) eff=1024 ;;
+ esac
+}
+
+calc_mid_capacity()
+{
+ dt_cpus=$(ls /sys/firmware/devicetree/base/cpus | grep "cpu(a)[0-9].*")
+ min_capacity=$((0xffffffff))
+ max_capacity=0
+ sched_capacity_shift=10
+
+ for dt_cpu in $dt_cpus; do
+ if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency ]; then
+ log_skip "no clock frequency file present"
+ return
+ fi
+ if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible ]; then
+ log_skip "no compatible file present"
+ return
+ fi
+ filename=/sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency
+ echo "clock frequency file: $filename"
+ bytes=$(od -t u1 -A n $filename)
+ calc_freq $bytes
+ echo "clock frequency: $freq"
+ cpu_type=$(cat /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible)
+ echo "cpu type: $cpu_type"
+ set_eff $cpu_type
+ echo "efficiency: $eff"
+ capacity=$((($freq>>20)*$eff))
+ echo "capacity: $capacity"
+ if [ $capacity -gt $max_capacity ]; then
+ max_capacity=$capacity
+ fi
+ if [ $capacity -lt $min_capacity ]; then
+ min_capacity=$capacity
+ fi
+ if [ $(((4 * $max_capacity))) -lt $(((3 * ($max_capacity + $min_capacity)))) ]; then
+ middle_capacity=$((($min_capacity + $max_capacity)>>($sched_capacity_shift+1)))
+ else
+ middle_capacity=$(((($max_capacity / 3)>>($sched_capacity_shift-1))+1))
+ fi
+ echo "min capacity: $min_capacity max: $max_capacity middle: $middle_capacity"
+ done
+}
+
+cpu_num=0
+
+verify_cpu_capacity()
+{
+ for dt_cpu in $dt_cpus; do
+ if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency ]; then
+ log_skip "no clock frequency file present"
+ return
+ fi
+ if [ ! -f /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible ]; then
+ log_skip "no compatible file present"
+ return
+ fi
+ filename=/sys/firmware/devicetree/base/cpus/$dt_cpu/clock-frequency
+ echo "clock frequency file: $filename"
+ bytes=$(od -t u1 -A n $filename)
+ calc_freq $bytes
+ echo "frequency: $freq"
+ cpu_type=$(cat /sys/firmware/devicetree/base/cpus/$dt_cpu/compatible)
+ echo "cpu type: $cpu_type"
+ set_eff $cpu_type
+ echo "efficiency: $eff"
+ capacity=$((($freq>>20)*$eff/$middle_capacity))
+ expected_capacity_string=$(dmesg | grep "CPU$cpu_num: update cpu_capacity")
+ expected_capacity=${expected_capacity_string##*cpu_capacity}
+ echo "cpu num: $cpu_num capacity $capacity expected capacity $expected_capacity"
+ check "expected capacity for cpu$cpu_num equal to computed capacity" "test $expected_capacity -eq $capacity"
+
+ cpu_num=$((cpu_num+1))
+ done
+}
+
+verify_capacity()
+{
+ if ! [ -d /sys/firmware/devicetree/base/cpus ]; then
+ log_skip "no cpus directory present"
+ return
+ fi
+
+ calc_mid_capacity
+ dt_cpus=$(ls -1 /sys/firmware/devicetree/base/cpus | egrep "cpu@.{1,2}$")
+ verify_cpu_capacity
+ dt_cpus=$(ls -1 /sys/firmware/devicetree/base/cpus | egrep "cpu@.{3,4}$")
+ verify_cpu_capacity
+}
+
+verify_capacity || exit 1
+test_status_show
diff --git a/cputopology/cputopology_04.txt b/cputopology/cputopology_04.txt
new file mode 100644
index 0000000..36647db
--- /dev/null
+++ b/cputopology/cputopology_04.txt
@@ -0,0 +1 @@
+test capacity calculation
--
1.8.3.2
Add test which checks and prints scheduler domain flags.
Signed-off-by: Larry Bassel <larry.bassel(a)linaro.org>
---
cputopology/cputopology_03.sh | 109 +++++++++++++++++++++++++++++++++++++++++
cputopology/cputopology_03.txt | 1 +
2 files changed, 110 insertions(+)
create mode 100755 cputopology/cputopology_03.sh
create mode 100644 cputopology/cputopology_03.txt
diff --git a/cputopology/cputopology_03.sh b/cputopology/cputopology_03.sh
new file mode 100755
index 0000000..bfff5de
--- /dev/null
+++ b/cputopology/cputopology_03.sh
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# PM-QA validation test suite for the power management on Linux
+#
+# Copyright (C) 2015, Linaro Limited.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# Contributors:
+# Larry Bassel <larry.bassel(a)linaro.org>
+#
+
+# URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Resources/TestSuite/P…
+
+. ../include/functions.sh
+
+is_flag_set() {
+ flag=$1
+ mask=$2
+ message=$3
+
+ value=$(( $flag & $mask ))
+
+ if [ $value -ne 0 ]; then
+ echo "$message set"
+ else
+ echo "$message not set"
+ fi
+}
+
+are_flags_set() {
+ val=$1
+ domain_num=$2
+
+ # flag value, flag description
+ set -- 0x80 "domain$domain_num share cpu capacity flag" 0x100 "domain$domain_num share power domain flag" 0x200 "domain$domain_num share cpu package resources flag"
+
+ if [ $(($# % 2)) -ne 0 ]; then
+ echo "WARNING: malformed flag value, description in test"
+ fi
+
+ nflags=$(($# / 2))
+ i=1
+
+ while [ $i -le $nflags ] ; do
+ flagval=$((2*i-1))
+ eval "var1=\${$flagval}"
+ flagstr=$((2*i))
+ eval "var2=\${$flagstr}"
+ is_flag_set $val "$var1" "$var2"
+ i=$(( i + 1))
+ done
+}
+
+check_sched_domain_flags() {
+
+ cpu_num=$1
+ domain_num=$2
+
+ sched_domain_flags=/proc/sys/kernel/sched_domain/$cpu_num/domain$domain_num/flags
+ val=$(cat $sched_domain_flags)
+
+ check "sched_domain_flags (domain $domain_num)" "test \"$val\" != \"-1\""
+ printf "domain$domain_num flag 0x%x\n" $val
+
+ mask=$((0x7fff))
+ unexpected_bits=$((val & ~mask))
+
+ if [ $unexpected_bits -ne 0 ]; then
+ printf "NOTE: unexpected flag bits 0x%x set\n" $unexpected_bits
+ fi
+
+ are_flags_set $val $domain_num
+}
+
+check_all_sched_domain_flags() {
+
+ sched_domain_0_path=/proc/sys/kernel/sched_domain/cpu0
+
+ if [ ! -d $sched_domain_0_path ]; then
+ log_skip "no sched_domain directory present"
+ return
+ fi
+
+ n=0
+
+ sched_domain_flags_path=/proc/sys/kernel/sched_domain/$1/domain0/flags
+
+ while [ -e $sched_domain_flags_path ]; do
+ check_sched_domain_flags $1 $n
+ n=$(( n + 1))
+ sched_domain_flags_path=/proc/sys/kernel/sched_domain/$1/domain$n/flags
+ done
+}
+
+for_each_cpu check_all_sched_domain_flags 1 || exit 1
+test_status_show
diff --git a/cputopology/cputopology_03.txt b/cputopology/cputopology_03.txt
new file mode 100644
index 0000000..e43de69
--- /dev/null
+++ b/cputopology/cputopology_03.txt
@@ -0,0 +1 @@
+test that the sched_domain files are present and show the topology related flags
--
1.9.1
****************
Team Work Logged
****************
# milo Progress #
* LAVA-1429 - Dispatcher Refactoring
* LAVA-1932 - dispatcher-slave: retry the HELLO (56.82%)
* More code cleanup and pushed for review first attempt for the HELLO message retry logic.
* Continued working on HELLO-retry logic: avoiding sending multiple HELLO messages since the dispatcher master changes states.
* Refactored HELLO-retry logic, introduced new protocol message (HELLO_RETRY).
* Completed last round of review on HELLO retry logic.
* LAVA-1511 - Upstream Kernel CI
* LAVA-1554 - Email notification system (43.18%)
* Started creating HTML template for boot report.
* Continued work on multi-part email: refactored logic to create TXT based email and used a template also for that. Completed stub template for HTML email.
* Completed boot multipart email report, started work on new build email report.
# stylesen Progress #
* LAVA-1429 - Dispatcher Refactoring
* LAVA-1933 - Connect remote slaves to playground (100.0%)
* Started with a local setup for playground worker.
# gesha Progress #
* LAVA-1429 - Dispatcher Refactoring
* LAVA-1930 - Add level to logging (100.0%)
# stevan.radakovic Progress #
* LAVA-1429 - Dispatcher Refactoring
* LAVA-1929 - Export a set of variables on the DUT (100.0%)
* Local dispatcher setup.
* Add logic for pulling environment variables for device from /etc/lava-server/env.dut.yaml
* Passing the enviromnent varibles from master to slave.
# neil.williams(a)linaro.org Progress #
* LAVA-1429 - Dispatcher Refactoring
* LAVA-1394 - DF: LAVA server integration (26.32%)
* LAVA-1429 - Dispatcher Refactoring
* LAVA-1960 - Fix queueing behaviour in pipeline scheduler (21.05%)
* LAVA-1429 - Dispatcher Refactoring
* LAVA-1954 - Change pipeline store behaviour (52.63%)
****************
Team In-Progress
****************
# georgy.redkozubov(a)linaro.org Plan #
* LAVA-1681 - Update UI to show iteration number
# milo.casagrande(a)linaro.org Plan #
* LAVA-1554 - Email notification system
* LAVA-1944 - Create multi-part email
# neil.williams(a)linaro.org Plan #
* LAVA-1961 - Implement Multinode scheduling for pipeline jobs
# remi.duraffort(a)linaro.org Plan #
* LAVA-1755 - ST boards support
* LAVA-1436 - YAML description display support
# senthil.kumaran(a)linaro.org Plan #
* LAVA-1928 - Add timing to YAML logs
* LAVA-1933 - Connect remote slaves to playground
# stevan.radakovic(a)linaro.org Plan #
* LAVA-1734 - 909
* LAVA-1394 - DF: LAVA server integration
* LAVA-1831 - Add the ability to add/modify/remove meta-data for existing bundles
* LAVA-1929 - Export a set of variables on the DUT
# tyler.baker(a)linaro.org Plan #
* LAVA-1792 - Tyler's Mentoring
* LAVA-1524 - ARM KVM boot testing
* LAVA-1643 - 4. Trending Builds Boots and Tests
* LAVA-1926 - lava-bot ci
== Progress ==
* mourning leave (60%)
* DEVPLAT-321 "clean up ILP32 build job" (15%):
- updated the current ILP32 build job to use the standard QA's LTP test
case (it has got the 2 required fixes), and to pick up the latest
ILP32 and LP64 rootfs'es (vs the hardcoded ones). Submitted for review
the 1st draft of the job configuration in yaml - the job is being moved
to ci/job/configs.git
* CARD-788 "EPIC: Linux linaro baseline maintenance" (5%):
- moved llct to v4.0-rc5
== Plans ==
* CARD-788 "EPIC: Linux linaro baseline maintenance":
- update linux-linaro to v4.0-rc6
* DEVPLAT-321 "clean up ILP32 build job"
== Issues ==
* none
Solved BIOS update issues on D01 (thanks luca) [CARD-1440] 60%
Built,uploaded,unblocked cross-binutils 2.25-5 for jessie [DEVPAT-190] 20%
Full debian rebuild in <48hrs on 14 moonshot nodes
Wookey
--
Principal hats: Linaro, Debian, Wookware, ARM
http://wookware.org/
== Progress ==
* Boot KVM using UEFI (DEVPLAT-338 40%)
* building perf as part of make deb-pkg (DEVPLAT-303 30%)
* Fix Xen jobs to use always latest Xen binary 20%
== Plans ==
* building perf as part of make deb-pkg DEVPLAT-303
* Keep moving Xen/KVM jobs over to configs.git for CI 2.0
== Issues ==
* LAVA filters fail to send mail to me:
https://bugs.linaro.org/show_bug.cgi?id=1371
Couple patches to ensure that PM-QA scripts will run in order
and remove unnecessary checks in cpuidle_08 and cpuidle_09
scripts.
Lisa Nguyen (2):
Test: Add sort function
cpufreq: Remove unnecessary checks
Test.mk | 2 +-
cpufreq/cpufreq_08.sh | 3 ---
cpufreq/cpufreq_09.sh | 6 ------
3 files changed, 1 insertion(+), 10 deletions(-)
--
1.7.9.5