summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-04-21 15:24:28 +0800
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-05-04 18:04:48 +0000
commitc1fb98021774268382b94d5d0ef3f8e46f754f88 (patch)
tree220ab1e3d7180d4190d04730e2285723227ab77f /automated
parent7fa0dc9e93d87604a809358796f97880832a2f64 (diff)
automated: linux: add RT pmqtest
Change-Id: I1386f165df1c446f94b22be4253b919cd8540e0b Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rw-r--r--automated/linux/pmqtest/bin/README6
-rwxr-xr-xautomated/linux/pmqtest/bin/arm64/pmqtestbin0 -> 600696 bytes
-rwxr-xr-xautomated/linux/pmqtest/bin/armeabi/pmqtestbin0 -> 424772 bytes
-rwxr-xr-xautomated/linux/pmqtest/pmqtest.sh40
-rw-r--r--automated/linux/pmqtest/pmqtest.yaml35
5 files changed, 81 insertions, 0 deletions
diff --git a/automated/linux/pmqtest/bin/README b/automated/linux/pmqtest/bin/README
new file mode 100644
index 0000000..cf96841
--- /dev/null
+++ b/automated/linux/pmqtest/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/pmqtest/bin/arm64/pmqtest b/automated/linux/pmqtest/bin/arm64/pmqtest
new file mode 100755
index 0000000..d57817c
--- /dev/null
+++ b/automated/linux/pmqtest/bin/arm64/pmqtest
Binary files differ
diff --git a/automated/linux/pmqtest/bin/armeabi/pmqtest b/automated/linux/pmqtest/bin/armeabi/pmqtest
new file mode 100755
index 0000000..8ba0a00
--- /dev/null
+++ b/automated/linux/pmqtest/bin/armeabi/pmqtest
Binary files differ
diff --git a/automated/linux/pmqtest/pmqtest.sh b/automated/linux/pmqtest/pmqtest.sh
new file mode 100755
index 0000000..ae979b3
--- /dev/null
+++ b/automated/linux/pmqtest/pmqtest.sh
@@ -0,0 +1,40 @@
+#!/bin/sh -e
+# shellcheck disable=SC1090
+# shellcheck disable=SC2154
+# pmqtest start pairs of threads and measure the latency of interprocess
+# communication with POSIX messages queues.
+
+TEST_DIR=$(dirname "$(realpath "$0")")
+OUTPUT="${TEST_DIR}/output"
+LOGFILE="${OUTPUT}/pmqtest.log"
+RESULT_FILE="${OUTPUT}/result.txt"
+LOOPS="10000"
+
+usage() {
+ echo "Usage: $0 [-l loops]" 1>&2
+ exit 1
+}
+
+while getopts ":l:" opt; do
+ case "${opt}" in
+ l) LOOPS="${OPTARG}" ;;
+ *) usage ;;
+ esac
+done
+
+. "${TEST_DIR}/../../lib/sh-test-lib"
+
+! check_root && error_msg "Please run this script as root."
+create_out_dir "${OUTPUT}"
+
+# Run pmqtest.
+detect_abi
+./bin/"${abi}"/pmqtest -S -l "${LOOPS}" | tee "${LOGFILE}"
+
+# Parse test log.
+tail -n "$(nproc)" "${LOGFILE}" \
+ | sed 's/,//g' \
+ | awk '{printf("t%s-min-latency pass %s us\n", NR, $(NF-6))};
+ {printf("t%s-avg-latency pass %s us\n", NR, $(NF-2))};
+ {printf("t%s-max-latency pass %s us\n", NR, $NF)};' \
+ | tee -a "${RESULT_FILE}"
diff --git a/automated/linux/pmqtest/pmqtest.yaml b/automated/linux/pmqtest/pmqtest.yaml
new file mode 100644
index 0000000..976c8f8
--- /dev/null
+++ b/automated/linux/pmqtest/pmqtest.yaml
@@ -0,0 +1,35 @@
+metadata:
+ name: pmqtest
+ format: "Lava-Test-Shell Test Definition 1.0"
+ description: "Pmqtest measures the latency of interprocess communication
+ with POSIX messages queues. The test starts pairs of threads
+ that are synchronized via mq_send/mw_receive() and measures
+ the latency between sending and receiving the message."
+ maintainer:
+ - chase.qi@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - centos
+ - fedora
+ - openembedded
+ scope:
+ - performance
+ - preempt-rt
+ devices:
+ - hi6220-hikey
+ - apq8016-sbc
+ - mustang
+ - moonshot
+ - thunderX
+ - d03
+ - d05
+
+params:
+ LOOPS: 10000
+
+run:
+ steps:
+ - cd ./automated/linux/pmqtest/
+ - ./pmqtest.sh -l "${LOOPS}"
+ - ../../utils/send-to-lava.sh ./output/result.txt