From f05f6cfcbc54476e8a86c675cc3b6d275e377bdb Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Tue, 17 Jan 2017 16:49:23 +0800 Subject: automated: linux: add cyclictest Change-Id: I2a81ff35db40935fe57d25bc35685cf6b54c1fe6 Signed-off-by: Chase Qi --- automated/linux/cyclictest/bin/README | 6 +++ automated/linux/cyclictest/bin/arm64/cyclictest | Bin 0 -> 629504 bytes automated/linux/cyclictest/bin/armeabi/cyclictest | Bin 0 -> 449116 bytes automated/linux/cyclictest/cyclictest.sh | 49 ++++++++++++++++++++++ automated/linux/cyclictest/cyclictest.yaml | 43 +++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 automated/linux/cyclictest/bin/README create mode 100755 automated/linux/cyclictest/bin/arm64/cyclictest create mode 100755 automated/linux/cyclictest/bin/armeabi/cyclictest create mode 100755 automated/linux/cyclictest/cyclictest.sh create mode 100644 automated/linux/cyclictest/cyclictest.yaml (limited to 'automated/linux') 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 Binary files /dev/null and b/automated/linux/cyclictest/bin/arm64/cyclictest differ diff --git a/automated/linux/cyclictest/bin/armeabi/cyclictest b/automated/linux/cyclictest/bin/armeabi/cyclictest new file mode 100755 index 0000000..1fbe4b3 Binary files /dev/null and b/automated/linux/cyclictest/bin/armeabi/cyclictest 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 -- cgit v1.2.3