summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2016-11-02 16:46:29 +0800
committerChase Qi <chase.qi@linaro.org>2016-11-02 16:46:29 +0800
commit75a1fcf916f6a5c970d3c5afeeecdf56efbb9fbf (patch)
treeea3c6e9fe61677fab81d71aef17f4acf839a70e8 /automated
parentdf73087277c1062ae6d1d7f781d5a5a386681ced (diff)
v2: linux: add hackbench test
Change-Id: I2eadf7640554a0f19a59bcc6729055674bf0bdf6 Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rw-r--r--automated/linux/hackbench/bin/README6
-rwxr-xr-xautomated/linux/hackbench/bin/arm64/hackbenchbin0 -> 923784 bytes
-rwxr-xr-xautomated/linux/hackbench/bin/armeabi/hackbenchbin0 -> 708084 bytes
-rwxr-xr-xautomated/linux/hackbench/hackbench.sh70
-rw-r--r--automated/linux/hackbench/hackbench.yaml54
5 files changed, 130 insertions, 0 deletions
diff --git a/automated/linux/hackbench/bin/README b/automated/linux/hackbench/bin/README
new file mode 100644
index 0000000..cf96841
--- /dev/null
+++ b/automated/linux/hackbench/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/hackbench/bin/arm64/hackbench b/automated/linux/hackbench/bin/arm64/hackbench
new file mode 100755
index 0000000..8766a8a
--- /dev/null
+++ b/automated/linux/hackbench/bin/arm64/hackbench
Binary files differ
diff --git a/automated/linux/hackbench/bin/armeabi/hackbench b/automated/linux/hackbench/bin/armeabi/hackbench
new file mode 100755
index 0000000..b505cce
--- /dev/null
+++ b/automated/linux/hackbench/bin/armeabi/hackbench
Binary files differ
diff --git a/automated/linux/hackbench/hackbench.sh b/automated/linux/hackbench/hackbench.sh
new file mode 100755
index 0000000..80eb1e8
--- /dev/null
+++ b/automated/linux/hackbench/hackbench.sh
@@ -0,0 +1,70 @@
+#!/bin/sh -e
+
+. ../../lib/sh-test-lib
+OUTPUT="$(pwd)/output"
+RESULT_FILE="${OUTPUT}/result.txt"
+ITERATION="1000"
+TARGET="host"
+DATASIZE="100"
+LOOPS="100"
+GRPS="10"
+FDS="20"
+PIPE="false"
+THREADS="false"
+
+usage() {
+ echo "Usage: $0 [-i <iterations>] [-t <host|kvm>] [-s <bytes>] [-l <loops>]
+ [-g <groups>] [-f <fds>] [-p <true|false>] [-T <true|false>] [-h]" 1>&2
+ exit 1
+}
+
+while getopts "i:t:s:l:g:f:p:T:h" o; do
+ case "$o" in
+ i) ITERATION="${OPTARG}" ;;
+ t) TARGET="${OPTARG}" ;;
+ s) DATASIZE="${OPTARG}" ;;
+ l) LOOPS="${OPTARG}" ;;
+ g) GRPS="${OPTARG}" ;;
+ f) FDS="${OPTARG}" ;;
+ p) PIPE="${OPTARG}" ;;
+ T) THREADS="${OPTARG}" ;;
+ h|*) usage ;;
+ esac
+done
+
+[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
+mkdir -p "${OUTPUT}"
+TEST_LOG="${OUTPUT}/hackbench-output-${TARGET}.txt"
+
+# Determine hackbench test options.
+OPTS="-s ${DATASIZE} -l ${LOOPS} -g ${GRPS} -f ${FDS}"
+if "${PIPE}"; then
+ OPTS="${OPTS} -p"
+fi
+if "${THREADS}"; then
+ OPTS="${OPTS} -T"
+fi
+info_msg "Hackbench test options: ${OPTS}"
+
+# Test run.
+detect_abi
+for i in $(seq "${ITERATION}"); do
+ info_msg "Running iteration [$i/${ITERATION}]"
+ # shellcheck disable=SC2154
+ ./bin/"${abi}"/hackbench "${OPTS}" 2>&1 | tee -a "${TEST_LOG}"
+done
+
+# Parse output.
+grep "^Time" "${TEST_LOG}" \
+ | awk '{
+ if(min=="") {min=max=$2};
+ if($2>max) {max=$2};
+ if($2< min) {min=$2};
+ total+=$2; count+=1;
+ }
+ END {
+ printf("hackbench-mean pass %s s\n", total/count);
+ printf("hackbench-min pass %s s\n", min);
+ printf("hackbench-max pass %s s\n", max)
+ }' \
+ | tee -a "${RESULT_FILE}"
diff --git a/automated/linux/hackbench/hackbench.yaml b/automated/linux/hackbench/hackbench.yaml
new file mode 100644
index 0000000..4e301a7
--- /dev/null
+++ b/automated/linux/hackbench/hackbench.yaml
@@ -0,0 +1,54 @@
+metadata:
+ format: Lava-Test Test Definition 1.0
+ name: hackbench
+ description: "Hackbench is both a benchmark and a stress test for the Linux
+ kernel scheduler. It's main job is to create a specified
+ number of pairs of schedulable entities (either threads or
+ traditional processes) which communicate via either sockets or
+ pipes and time how long it takes for each pair to send data
+ back and forth."
+ maintainer:
+ - milosz.wasilewski@linaro.org
+ - chase.qi@linaro.org
+ os:
+ - debian
+ - ubuntu
+ - fedora
+ - centos
+ scope:
+ - performance
+ - virtualization
+ devices:
+ - hi6220-hikey
+ - apq8016-sbc
+ - mustang
+ - moonshot
+ - thunderX
+ - d03
+ - d05
+
+params:
+ ITERATION: "1000"
+ TARGET: "host"
+ # Sets the amount of data to send in each message
+ DATASIZE: "100"
+ # How many messages each sender/receiver pair should send
+ LOOPS: "100"
+ # Defines how many groups of senders and receivers should be started
+ GRPS: "10"
+ # Defines how many file descriptors each child should use. Note that the
+ # effective number will be twice the amount you set here, as the sender
+ # and receiver children will each open the given amount of file descriptors.
+ FDS: "20"
+ # Sends the data via a pipe instead of the socket (default)
+ PIPE: "false"
+ # Each sender/receiver child will be a POSIX thread of the parent.
+ # The default is to run in process mode (-P)
+ THREADS: "false"
+
+run:
+ steps:
+ - cd ./automated/linux/hackbench/
+ - "./hackbench.sh -i ${ITERATION} -t ${TARGET} -s ${DATASIZE}
+ -l ${LOOPS} -g ${GRPS} -f ${FDS} -p ${PIPE} -T ${THREADS}"
+ - ../../utils/send-to-lava.sh ./output/result.txt