summaryrefslogtreecommitdiff
path: root/automated/linux
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-01-17 16:49:23 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-01-18 19:55:14 +0000
commitf05f6cfcbc54476e8a86c675cc3b6d275e377bdb (patch)
tree906ccfd44e05e60ec0085c3cff76de4c46bf256e /automated/linux
parentc25683acde8bb6309073181088c9c7dc1d68e968 (diff)
automated: linux: add cyclictest
Change-Id: I2a81ff35db40935fe57d25bc35685cf6b54c1fe6 Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated/linux')
-rw-r--r--automated/linux/cyclictest/bin/README6
-rwxr-xr-xautomated/linux/cyclictest/bin/arm64/cyclictestbin0 -> 629504 bytes
-rwxr-xr-xautomated/linux/cyclictest/bin/armeabi/cyclictestbin0 -> 449116 bytes
-rwxr-xr-xautomated/linux/cyclictest/cyclictest.sh49
-rw-r--r--automated/linux/cyclictest/cyclictest.yaml43
5 files changed, 98 insertions, 0 deletions
diff --git a/automated/linux/cyclictest/bin/README b/automated/linux/cyclictest/bin/README
new file mode 100644
index 0000000..cf96841
--- /dev/null
+++ b/automated/linux/cyclictest/bin/README
@@ -0,0 +1,6 @@
+The binaries are provided under the terms of the GNU General Public License,
+Version 2. The source can be viewed here:
+
+https://git.kernel.org/cgit/utils/rt-tests/rt-tests.git/
+
+The binaries were built from branch: stable/v1.0
diff --git a/automated/linux/cyclictest/bin/arm64/cyclictest b/automated/linux/cyclictest/bin/arm64/cyclictest
new file mode 100755
index 0000000..2d6bed6
--- /dev/null
+++ b/automated/linux/cyclictest/bin/arm64/cyclictest
Binary files differ
diff --git a/automated/linux/cyclictest/bin/armeabi/cyclictest b/automated/linux/cyclictest/bin/armeabi/cyclictest
new file mode 100755
index 0000000..1fbe4b3
--- /dev/null
+++ b/automated/linux/cyclictest/bin/armeabi/cyclictest
Binary files differ
diff --git a/automated/linux/cyclictest/cyclictest.sh b/automated/linux/cyclictest/cyclictest.sh
new file mode 100755
index 0000000..7586a84
--- /dev/null
+++ b/automated/linux/cyclictest/cyclictest.sh
@@ -0,0 +1,49 @@
+#!/bin/sh -e
+# cyclictest measures event latency in Linux kernel by measuring the amount of
+# time that passes between when a timer expires and when the thread which set
+# the timer actually runs.
+
+# shellcheck disable=SC1091
+. ../../lib/sh-test-lib
+
+OUTPUT="$(pwd)/output"
+LOGFILE="${OUTPUT}/cyclictest.txt"
+RESULT_FILE="${OUTPUT}/result.txt"
+
+PRIORITY="99"
+INTERVAL="10000"
+THREADS="1"
+LOOPS="10000"
+
+usage() {
+ echo "Usage: $0 [-p priority] [-i interval] [-t threads] [-l loops]" 1>&2
+ exit 1
+}
+
+while getopts ":p:i:t:l:" opt; do
+ case "${opt}" in
+ p) PRIORITY="${OPTARG}" ;;
+ i) INTERVAL="${OPTARG}" ;;
+ t) THREADS="${OPTARG}" ;;
+ l) LOOPS="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+
+! check_root && error_msg "Please run this script as root."
+[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
+mkdir -p "${OUTPUT}"
+
+# Run cyclictest.
+detect_abi
+# shellcheck disable=SC2154
+./bin/"${abi}"/cyclictest -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" \
+ -l "${LOOPS}" | tee "${LOGFILE}"
+
+# Parse test log.
+tail -n "${THREADS}" "${LOGFILE}" \
+ | sed 's/T:/T: /' \
+ | awk '{printf("t%s-min-latency pass %s us\n", $2, $(NF-6))};
+ {printf("t%s-avg-latency pass %s us\n", $2, $(NF-2))};
+ {printf("t%s-max-latency pass %s us\n", $2, $NF)};' \
+ | tee -a "${RESULT_FILE}"
diff --git a/automated/linux/cyclictest/cyclictest.yaml b/automated/linux/cyclictest/cyclictest.yaml
new file mode 100644
index 0000000..3859e69
--- /dev/null
+++ b/automated/linux/cyclictest/cyclictest.yaml
@@ -0,0 +1,43 @@
+metadata:
+ name: cyclictest
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "cyclictest measures event latency in Linux kernel by
+ measuring the amount of time that passes between when a timer
+ expires and when the thread which set the timer actually
+ runs."
+ maintainer:
+ - chase.qi@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - fedora
+ - centos
+ - openembedded
+ scope:
+ - performance
+ environment:
+ - lava-test-shell
+ devices:
+ - hi6220-hikey
+ - apq8016-sbc
+ - mustang
+ - moonshot
+ - thunderX
+ - d03
+ - d05
+
+params:
+ # Priority of highest prio thread.
+ PRIORITY: "99"
+ # Base interval of thread in us.
+ INTERVAL: "10000"
+ # Number of threads.
+ THREADS: "1"
+ # Number of loops.
+ LOOPS: "10000"
+
+run:
+ steps:
+ - cd ./automated/linux/cyclictest/
+ - ./cyclictest.sh -p "${PRIORITY}" -i "${INTERVAL}" -t "${THREADS}" -l "${LOOPS}"
+ - ../../utils/send-to-lava.sh ./output/result.txt